Sand AISand AI MAGI-2MAGI-2가 이제 SandBase에서 제공됩니다: 네이티브 오디오가 포함된 1080p 동영상지금 사용해 보기

Reddit Subreddit Search

API 문서
https://api.sandbase.ai/v1/api/reddit/subreddit-search

Search posts within a single subreddit by query, sort, and timeframe.

가격
$0.00035부터USD / 호출
메서드
POST
응답
JSON
매개변수
필수 1개 · 선택 사항 5개

Playground

입력
Subreddit name without the r/ prefix (e.g. 'Fitness').
Optional sort order: relevance, hot, top, new, comments.
Optional search query to match posts (e.g. 'push ups').
Optional pagination token from a previous response. Include `nextCursor` in requireFields on the first request to make sure a source that supports pagination serves it.
Optional time filter: all, year, month, week, day, hour.
Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `nextCursor` or `selftext`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. Name `nextCursor` only if you will fetch more than the first page: when you leave it out, a cheaper source that cannot paginate may serve the request, and its nextCursor is null, so there is no next page to ask for. A named field can still be absent on a post that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted.
출력준비됨

출력이 여기에 표시됩니다

입력을 완료한 다음 Run을 클릭하세요.

API README

Reddit Subreddit Search API

Returns Reddit posts from one subreddit that match a search query. It needs a subreddit name without the r/ prefix, and it accepts an optional query, sort and timeframe.

Use cases

  • Find past discussions of a topic, such as push-ups, inside r/Fitness.
  • Rank the top posts of a subreddit for a keyword by score or numComments to see which threads got the most attention.
  • Collect post titles and text from a community to study how people talk about a topic.
  • Track new posts that mention a brand or term in a subreddit by sorting with new.

Request

curl -X POST "https://api.sandbase.ai/v1/api/reddit/subreddit-search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "push ups", "subreddit": "Fitness"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
subredditstringYesSubreddit name without the r/ prefix (e.g. 'Fitness').
cursorstringNoOptional pagination token from a previous response. Include nextCursor in requireFields on the first request to make sure a source that supports pagination serves it.
querystringNoOptional search query to match posts (e.g. 'push ups').
requireFieldsarrayNoOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example nextCursor or selftext, and it is served only by a source that ret
sortstringNoOptional sort order: relevance, hot, top, new, comments.
timeframestringNoOptional time filter: all, year, month, week, day, hour.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "nextCursor": "cur_vSRO4dkJp_Wni4NIHlJvKQ",
    "posts": [
      {
        "author": "Yea_Red",
        "authorId": "j6hq9",
        "createdUtc": 1428859519,
        "id": "32cksu",
        "nsfw": false,
        "numComments": 528,
        "permalink": "/r/Fitness/comments/32cksu/how_much_will_pushups_help_my_chest/",
        "score": 2003,
        "selftext": "I try to do 100 a day. Is this doing anything for me, or should I just focus on …",
        "subreddit": "Fitness",
        "title": "How much will push-ups help my chest?",
        "url": "https://www.reddit.com/r/Fitness/comments/32cksu/how_much_will_pushups_help_my_c…"
      }
    ]
  },
  "found": true
}

Response fields

FieldMeaning
data.posts[].titleTitle of the post.
data.posts[].selftextBody text of the post. Long text may be cut, and link posts may have none.
data.posts[].scoreScore of the post.
data.posts[].numCommentsNumber of comments on the post.
data.posts[].author / data.posts[].authorIdUsername and ID of the post author.
data.posts[].createdUtcCreation time of the post as a Unix timestamp in seconds (UTC).
data.posts[].idShort ID of the post, such as 32cksu.
data.posts[].permalink / data.posts[].urlPath and full URL of the post on Reddit.
data.posts[].nsfwtrue if the post is marked NSFW.
data.nextCursorToken to pass as cursor to get the next page of results.

Notes

For a Python request example that keeps the search and comment parameters separate, follow the community-research tutorial.

  • Pass the subreddit name without the r/ prefix, for example Fitness.
  • For more than the first page, add nextCursor to requireFields on the first request. Then send the returned data.nextCursor as cursor on the next call.
  • Add selftext, isArchived or isLocked to requireFields if you need those fields on every post.
  • To read the comments of a post, call Reddit Post Comments with the post.

Pricing

Billed at the actual cost of each call, about $0.00035 for the request above. Failed calls are not charged.

더 살펴보기

관련 API

모든 API
API가격응답
Reddit호출당 $0.00035부터JSON
Reddit$0.001 / 호출JSON
Reddit$0.001 / 호출JSON
Reddit$0.001 / 호출JSON
Reddit$0.001 / 호출JSON
Reddit$0.001 / 호출JSON

가이드:Best Reddit API in 2026: Pricing Compared

질문

FAQ

Reddit Subreddit Search API를 어떻게 사용하나요?

Authorization 헤더(Bearer)에 SandBase API 키를 넣고, 매개변수를 JSON 본문으로 담아 https://api.sandbase.ai/v1/api/reddit/subreddit-search에 POST 요청을 보내세요. 이 페이지의 Playground에서도 코드를 작성하지 않고 직접 테스트할 수 있습니다.

Reddit Subreddit Search API 비용은 얼마인가요?

호출당 $0.00035부터, SandBase 잔액에서 청구됩니다. 사용한 호출에 대해서만 요금이 부과되며, 구독은 없습니다.

Reddit Subreddit Search API는 어떤 매개변수를 받나요?

필수: subreddit (string). 선택: sort(relevance, hot, top, new, comments 중 하나), query (string), cursor (string), timeframe(all, year, month, week, day, hour 중 하나) 및 requireFields (array). 이 페이지의 Parameters 표와 Playground에 모든 필드가 나와 있습니다.

Reddit Subreddit Search API는 무엇을 반환하나요?

같은 HTTP 요청에서 반환되는 JSON 응답입니다(동기식). 이 페이지의 README에 샘플 응답이 포함되어 있습니다.

Reddit 개발자 계정이나 API 키가 필요한가요?

아니요. Reddit Subreddit Search은 SandBase를 통해 실행되므로, SandBase API 키 하나로 이 엔드포인트와 카탈로그의 다른 모든 API 및 모델을 사용할 수 있습니다. Reddit API 액세스를 별도로 신청할 필요는 없습니다.

하나의 subreddit에서 키워드를 검색하고 시간 범위를 제한하려면 어떻게 하나요?

community 이름에서 r/를 뺀 값을 subreddit으로 넣고, 검색어는 query에 넣으세요. 이 endpoint는 sort와 timeframe을 지원합니다. 공식 Reddit API의 parameter 이름이 아니라 여기에 나열된 값을 사용하세요. Keyword Search와 app Dynamic Search endpoint는 요청 필드가 다릅니다.

다음 페이지는 어떻게 요청하나요? requireFields가 가격을 바꿀 수 있나요?

pagination이 필요하면 첫 호출에서 requireFields에 nextCursor를 요청하고, 표시된 가격을 확인하세요. 필드 요구 사항에 따라 더 비싼 source를 선택할 수 있습니다. 반환된 data.nextCursor 전체를 다음 페이지의 cursor로 전달하세요. 이후 페이지는 첫 페이지에서 선택된 source를 유지합니다. 이 요구 사항이 없으면 더 저렴한 source가 continuation을 제공하지 않을 수 있습니다. 요청된 필드가 실제로 그 값을 가지지 않는 post에서는 여전히 누락될 수 있습니다. 문서 예시의 짧아진 cursor를 재사용하지 마세요.

검색 결과에 게시물 전체와 모든 댓글이 포함되나요?

아닙니다. reference에서는 selftext가 없거나 축약될 수 있으며, 검색 결과는 완전한 토론 아카이브가 아니라 샘플입니다. 답글이 필요하면 선택한 post를 열고 URL과 함께 Post Comments endpoint를 사용하세요. 제목, 스니펫, score를 검증된 제품 피드백으로 보지 마세요.