API reference · Reddit

reddit/bulk/posts

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDreddit/bulk/posts
01

Input Schema

26 parameters · 0 required · 26 optional

ParameterTypeRequiredDescription
sortstringOptionalSort search by Relevance, Hot, Top, New or Comments · Options: , relevance, hot, top, new, rising, comments · Default: "new"
relevancehottopnewrisingcomments
timestringOptionalFilter posts by last hour, week, day, month or year · Options: all, hour, day, week, month, year
allhourdayweekmonthyear
maxItemsintegerOptionalThe maximum number of items that will be saved in the dataset. If you are scrapping for Communities&Users, remember to consider that each category inside a community is saved as a separated item. · Min: -9007199254740991 · Max: 9007199254740991 · Default: 10
searchesarrayOptionalHere you can provide a search query which will be used to search Reddit`s topics.
debugModebooleanOptionalActivate to see detailed logs · Default: false
startUrlsarrayOptionalIf you already have URL(s) of page(s) you wish to scrape, you can set them here. If you want to use the search field below, remove all startUrls here.
includeNSFWbooleanOptionalYou can choose to include or exclude NSFW content from your search · Default: true
maxCommentsintegerOptionalThe maximum number of comments that will be scraped for each Comments Page. If you don't want to scrape comments you can set this to zero. · Min: -9007199254740991 · Max: 9007199254740991 · Default: 10
searchMediabooleanOptionalWill search for media with the provided search · Default: false
searchPostsbooleanOptionalWill search for posts with the provided search · Default: true
searchUsersbooleanOptionalWill search for users with the provided search · Default: false
maxPostCountintegerOptionalThe maximum number of posts that will be scraped for each Posts Page or Communities&Users URL · Min: -9007199254740991 · Max: 9007199254740991 · Default: 10
maxUserCountintegerOptionalThe maximum number of `Users`'s pages that will be scraped. · Min: -9007199254740991 · Max: 9007199254740991 · Default: 2
skipCommentsbooleanOptionalThis will skip scrapping comments when going through posts · Default: false
postDateLimitstringOptionalUse this value to only retrieve posts published after a specific date.
scrollTimeoutintegerOptionalSet the timeout in seconds in which the page will stop scrolling down to load new items · Min: -9007199254740991 · Max: 9007199254740991 · Default: 40
skipCommunitybooleanOptionalThis will skip scrapping community info but will still get community posts if they were not skipped. · Default: false
skipUserPostsbooleanOptionalThis will skip scrapping user posts when going through user activity · Default: false
searchCommentsbooleanOptionalWill search for comments with the provided search · Default: false
ignoreStartUrlsbooleanOptionalMainly used as a fix for ignoring starUrl on Zapier · Default: false
commentDateLimitstringOptionalUse this value to only retrieve comments published after a specific date inside a post.
includeMediaLinksbooleanOptionalThis will include upVotes, upVoteRatio, imageUrls, videoUrls, and numberOfComments when scraping posts. Enabling this will use a more detailed extraction method, which may affect performance. · Default: false
navigationTimeoutintegerOptionalSet the navigation timeout in seconds for page loading · Min: 20 · Max: 60 · Default: 60
searchCommunitiesbooleanOptionalWill search for communities with the provided search · Default: false
maxCommunitiesCountintegerOptionalThe maximum number of `Communities`'s pages that will be scraped if your search or startUrl is a Communities type. · Min: -9007199254740991 · Max: 9007199254740991 · Default: 2
searchCommunityNamestringOptionalIf provided, the search will be performed only inside this community (e.g., 'programming').
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "reddit/bulk/posts",
  "sort": "new",
  "maxItems": 10,
  "debugMode": false,
  "includeNSFW": true,
  "maxComments": 10,
  "searchMedia": false,
  "searchPosts": true,
  "searchUsers": false,
  "maxPostCount": 10,
  "maxUserCount": 2,
  "skipComments": false,
  "scrollTimeout": 40,
  "skipCommunity": false,
  "skipUserPosts": false,
  "searchComments": false,
  "ignoreStartUrls": false,
  "includeMediaLinks": false,
  "navigationTimeout": 60,
  "searchCommunities": false,
  "maxCommunitiesCount": 2,
  "prompt": "a beautiful sunset over mountains"
}'

# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
  -H "Authorization: Bearer YOUR_API_KEY"