Sand AISand AI MAGI-2ตอนนี้ MAGI-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.00035USD / คำขอ
Method
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.

สำรวจเพิ่มเติม

APIs ที่เกี่ยวข้อง

APIs ทั้งหมด
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

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ Reddit Subreddit Search API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/reddit/subreddit-search โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน 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 ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ Reddit ไหม?

ไม่จำเป็น Reddit Subreddit Search ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Reddit API แยกต่างหาก

ฉันจะค้นหา subreddit เดียวด้วยคีย์เวิร์ดและจำกัดช่วงเวลาได้อย่างไร?

ส่งชื่อชุมชนโดยไม่ใส่ r/ เป็น subreddit และใส่คำค้นใน query endpoint นี้รองรับ sort และ timeframe; ใช้ค่าที่ระบุไว้แทนชื่อพารามิเตอร์ของ Reddit API ทางการ Keyword Search และ endpoint app Dynamic Search มีฟิลด์คำขอคนละแบบ

ฉันจะขอหน้าถัดไปได้อย่างไร และ requireFields จะเปลี่ยนราคาได้ไหม?

หากต้องการแบ่งหน้า ให้ขอ nextCursor ใน requireFields ตอนการเรียกครั้งแรก และตรวจสอบราคาที่ระบุไว้ในเครื่องหมายคำพูด: การกำหนดฟิลด์อาจเลือกแหล่งข้อมูลที่แพงกว่า ส่ง data.nextCursor ที่ได้มาครบถ้วนเป็น cursor สำหรับหน้าถัดไป หน้าหลังจากนั้นจะใช้แหล่งข้อมูลเดิมที่เลือกสำหรับหน้าแรก หากไม่กำหนดข้อนี้ แหล่งข้อมูลที่ถูกกว่าอาจไม่ส่งต่อเนื่องมา ฟิลด์ที่ร้องขออาจยังหายไปได้หากโพสต์นั้นไม่มีจริง อย่านำ cursor ที่ย่อจากตัวอย่างเอกสารมาใช้ซ้ำ

ผลการค้นหามีโพสต์ฉบับสมบูรณ์และคอมเมนต์ทั้งหมดหรือไม่?

ไม่มี reference อนุญาตให้ selftext ไม่มีหรือถูกย่อได้ และผลการค้นหาเป็นเพียงตัวอย่าง ไม่ใช่คลังการสนทนาฉบับสมบูรณ์ เปิดโพสต์ที่เลือกและใช้ endpoint Post Comments พร้อม URL ของมันเมื่อคุณต้องการคำตอบ อย่ามอง title, snippet หรือ score ว่าเป็นฟีดแบ็กผลิตภัณฑ์ที่ยืนยันแล้ว