Documentation Index Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
Use this file to discover all available pages before exploring further.
This tutorial walks you through sending a synchronous request to each Bright Data Reddit Scraper API endpoint. By the end, you’ll have working examples for collecting posts, discovering posts and collecting comments.
Prerequisites
Request structure
Every synchronous request follows the same pattern:
POST https://api.brightdata.com/datasets/v3/scrape?dataset_id={DATASET_ID}&format=json
Authorization : Bearer YOUR_API_KEY
Content-Type : application/json
[{ "url" : "https://www.reddit.com/..." }]
The only things that change between endpoints are the dataset_id and the input shape.
Synchronous requests support up to 20 URLs and have a 1-minute timeout. If the request takes longer, the API automatically returns a snapshot_id instead. See async requests .
Posts, Collect by URL
Scrape a specific Reddit post by its URL.
Dataset ID: gd_lvz8ah06191smkebj4
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.reddit.com/r/learnpython/comments/1asdf12/how_do_i_start_learning_python/"}]'
You should see a 200 response. This takes 10 to 30 seconds.
[
{
"post_id" : "1asdf12" ,
"url" : "https://www.reddit.com/r/learnpython/comments/1asdf12/how_do_i_start_learning_python/" ,
"user_posted" : "example_user" ,
"title" : "How do I start learning Python?" ,
"description" : "I'm a complete beginner and want to know the best resources..." ,
"num_upvotes" : 1240 ,
"num_comments" : 86 ,
"date_posted" : "2025-03-14T18:22:00Z" ,
"tag" : "Tutorial" ,
"community_name" : "learnpython" ,
"community_url" : "https://www.reddit.com/r/learnpython" ,
"community_description" : "Subreddit for posting questions..." ,
"community_members_num" : 1120000 ,
"community_rank" : "Top 1%" ,
"photos" : [],
"videos" : []
}
]
Full Posts - Collect by URL schema
Posts, Discover by subreddit URL
Scrape recent posts from a specific subreddit, optionally sorted by new, top or hot.
Dataset ID: gd_lvz8ah06191smkebj4
Discovery endpoints are best used asynchronously via /trigger since they may return many results. The sync example below is for quick testing.
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4&format=json&type=discover_new&discover_by=subreddit_url" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.reddit.com/r/learnpython/", "sort_by": "hot"}]'
Full Discover by subreddit URL schema
Posts, Discover by keyword
Find Reddit posts matching a search term, filtered by date.
Dataset ID: gd_lvz8ah06191smkebj4
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4&format=json&type=discover_new&discover_by=keyword" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"keyword": "machine learning", "date": "Past week", "num_of_posts": 20}]'
Full Discover by keyword schema
Scrape all comments from a Reddit post or a specific comment thread, with optional filtering by age.
Dataset ID: gd_lvzdpsdlw09j6t702
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvzdpsdlw09j6t702&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.reddit.com/r/learnpython/comments/1asdf12/", "days_back": 7}]'
[
{
"comment_id" : "kabc1de" ,
"user_posted" : "example_commenter" ,
"comment" : "Start with the official Python tutorial, it's free and covers all the basics." ,
"date_posted" : "2025-03-14T19:02:11Z" ,
"num_upvotes" : 412 ,
"num_replies" : 8 ,
"replies" : [],
"post_url" : "https://www.reddit.com/r/learnpython/comments/1asdf12/" ,
"post_id" : "1asdf12" ,
"post_type" : "text" ,
"community_name" : "learnpython" ,
"community_url" : "https://www.reddit.com/r/learnpython" ,
"is_moderator" : false ,
"is_pinned" : false ,
"is_locked" : false
}
]
Full Comments - Collect by URL schema
Next steps
Async batch requests Scrape thousands of posts or run keyword discovery jobs in a single async request.
API reference Full endpoint specs, parameters and response schemas.