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.
POST
https://api.sandbase.ai/v1/runModel ID
reddit/bulk/posts01
Input Schema
26 parameters · 0 required · 26 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
sort | string | Optional | Sort search by Relevance, Hot, Top, New or Comments · Options: , relevance, hot, top, new, rising, comments · Default: "new" relevancehottopnewrisingcomments |
time | string | Optional | Filter posts by last hour, week, day, month or year · Options: all, hour, day, week, month, year allhourdayweekmonthyear |
maxItems | integer | Optional | The 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 |
searches | array | Optional | Here you can provide a search query which will be used to search Reddit`s topics. |
debugMode | boolean | Optional | Activate to see detailed logs · Default: false |
startUrls | array | Optional | If 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. |
includeNSFW | boolean | Optional | You can choose to include or exclude NSFW content from your search · Default: true |
maxComments | integer | Optional | The 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 |
searchMedia | boolean | Optional | Will search for media with the provided search · Default: false |
searchPosts | boolean | Optional | Will search for posts with the provided search · Default: true |
searchUsers | boolean | Optional | Will search for users with the provided search · Default: false |
maxPostCount | integer | Optional | The maximum number of posts that will be scraped for each Posts Page or Communities&Users URL · Min: -9007199254740991 · Max: 9007199254740991 · Default: 10 |
maxUserCount | integer | Optional | The maximum number of `Users`'s pages that will be scraped. · Min: -9007199254740991 · Max: 9007199254740991 · Default: 2 |
skipComments | boolean | Optional | This will skip scrapping comments when going through posts · Default: false |
postDateLimit | string | Optional | Use this value to only retrieve posts published after a specific date. |
scrollTimeout | integer | Optional | Set the timeout in seconds in which the page will stop scrolling down to load new items · Min: -9007199254740991 · Max: 9007199254740991 · Default: 40 |
skipCommunity | boolean | Optional | This will skip scrapping community info but will still get community posts if they were not skipped. · Default: false |
skipUserPosts | boolean | Optional | This will skip scrapping user posts when going through user activity · Default: false |
searchComments | boolean | Optional | Will search for comments with the provided search · Default: false |
ignoreStartUrls | boolean | Optional | Mainly used as a fix for ignoring starUrl on Zapier · Default: false |
commentDateLimit | string | Optional | Use this value to only retrieve comments published after a specific date inside a post. |
includeMediaLinks | boolean | Optional | This 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 |
navigationTimeout | integer | Optional | Set the navigation timeout in seconds for page loading · Min: 20 · Max: 60 · Default: 60 |
searchCommunities | boolean | Optional | Will search for communities with the provided search · Default: false |
maxCommunitiesCount | integer | Optional | The 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 |
searchCommunityName | string | Optional | If provided, the search will be performed only inside this community (e.g., 'programming'). |
02
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom 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"
