> ## 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.

# Reddit Scraper API endpoints

> Send synchronous requests to every Bright Data Reddit Scraper API endpoint with copy-paste examples for posts, comments and subreddit data across 3 surfaces.

This guide shows you how to send a synchronous request to each Bright Data Reddit Scraper API endpoint. It covers collecting posts, discovering posts and collecting comments.

## Prerequisites

* A [Bright Data account](https://brightdata.com/products/web-scraper/reddit?hs_signup=1\&utm_source=docs) with an active API key
* Completed the [Quickstart](/products/scrapers/reddit/quickstart)

## Request structure

Every synchronous request follows the same pattern:

```http theme={null}
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.

<Note>
  The `/scrape` endpoint is built for real-time, single-URL requests. Bright Data recommends 20 URLs or fewer per request, a best practice rather than a hard limit, and the endpoint waits up to 1 minute. If collection takes longer, the response is HTTP `202` with a `snapshot_id` instead of data, and collection continues asynchronously. Fetch the result with [async requests](/products/scrapers/scrapers-library/async-requests) or have it pushed to you with [webhook delivery](/products/scrapers/scrapers-library/data-delivery).
</Note>

## Posts, Collect by URL

Scrape a specific Reddit post by its URL.

**Dataset ID:** `gd_lvz8ah06191smkebj4`

<CodeGroup>
  ```bash cURL theme={null}
  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/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/"}]'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={"dataset_id": "gd_lvz8ah06191smkebj4", "format": "json"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      json=[{"url": "https://www.reddit.com/r/learnpython/comments/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/"}],
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4&format=json",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify([
        { url: "https://www.reddit.com/r/learnpython/comments/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/" }
      ]),
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

You should see a `200` response. Processing time varies with target-site conditions and scraper workload.

<Accordion title="Example response">
  ```json theme={null}
  [
    {
      "post_id": "t3_1w8chn8",
      "url": "https://www.reddit.com/r/learnpython/comments/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/",
      "user_posted": "xq_***x",
      "title": "found a for loop and can't find an explanation. Can someone explain, please?",
      "description": "Hey there, I just started the Project Euler Archive and started with the classic \"Find the sum of all the multiples of 3 or 5 below 1000.\" And when I wanted...",
      "num_upvotes": 8,
      "num_comments": 14,
      "date_posted": "2026-09-05T21:03:33.625Z",
      "tag": null,
      "community_name": "learnpython"
    }
  ]
  ```
</Accordion>

[Full Posts - Collect by URL schema](/api-reference/scrapers/social-media-apis/reddit-posts-collect-by-url)

### Which output fields does the Reddit posts scraper return?

The Reddit posts scraper (`gd_lvz8ah06191smkebj4`, `collect_by_url`) returns 27 output fields.

<Accordion title="Output fields (27)">
  | Field | Type | Description |
  | - | - | - |
  | `post_id` | text | Post ID |
  | `url` | url | URL of the post |
  | `user_posted` | text | Username of the post creator |
  | `title` | text | Title of the post |
  | `description` | text | Post text description |
  | `num_comments` | number | Number of comments |
  | `date_posted` | date | Post publication date |
  | `community_name` | text | Name of the community |
  | `num_upvotes` | number | Number of upvotes |
  | `photos` | array | URLs of attached photos |
  | `videos` | array | URLs of attached videos |
  | `tag` | text | The name of the tag |
  | `related_posts` | array | Related posts |
  | `comments` | array | Comments of the post |
  | `community_url` | url | URL of the community |
  | `community_description` | text | Description of the community |
  | `community_members_num` | number | Number of community members |
  | `community_rank` | object | Community ranked |
  | `post_karma` | number | post\_karma |
  | `bio_description` | text | bio\_description |
  | `embedded_links` | array | embedded\_links |
  | `description_markdown` | text | Post content with original line breaks and Markdown formatting |
  | `subreddit_icon_image` | url | Subreddit icon image |
  | `author_icon` | url | Author icon link |
  | `user_id` | text | posting user unique id |
  | `archived` | text | archived |
  | `locked_post` | boolean | Indicator if the post is locked and new comments cannot be posted. |
</Accordion>

Machine-readable version with the input schema: [`/scrapers/gd_lvz8ah06191smkebj4.json`](/scrapers/gd_lvz8ah06191smkebj4.json)

## Posts, Discover by subreddit URL

Scrape recent posts from a specific subreddit, optionally sorted with `sort_by`. Values are case-sensitive and match the labels on Reddit, for example `Hot`. Lowercase `hot` is rejected with a validation error.

**Dataset ID:** `gd_lvz8ah06191smkebj4`

<Note>
  Discovery endpoints are best used asynchronously via [`/trigger`](/products/scrapers/scrapers-library/async-requests) since they may return many results. The sync example below is for quick testing.
</Note>

<CodeGroup>
  ```bash cURL theme={null}
  # limit_per_input caps the records returned for each input
  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 '{"input": [{"url": "https://www.reddit.com/r/learnpython/", "sort_by": "Hot"}], "limit_per_input": 10}'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={
          "dataset_id": "gd_lvz8ah06191smkebj4",
          "format": "json",
          "type": "discover_new",
          "discover_by": "subreddit_url",
      },
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      # limit_per_input caps the records returned for each input
      json={
          "input": [{"url": "https://www.reddit.com/r/learnpython/", "sort_by": "Hot"}],
          "limit_per_input": 10,
      },
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4&format=json&type=discover_new&discover_by=subreddit_url",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      // limit_per_input caps the records returned for each input
      body: JSON.stringify({
        input: [{ url: "https://www.reddit.com/r/learnpython/", sort_by: "Hot" }],
        limit_per_input: 10,
      }),
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

[Full Discover by subreddit URL schema](/api-reference/scrapers/social-media-apis/reddit-posts-discover-by-subreddit-url)

## Posts, Discover by keyword

Find Reddit posts matching a search term, filtered by date.

**Dataset ID:** `gd_lvz8ah06191smkebj4`

<CodeGroup>
  ```bash cURL theme={null}
  # limit_per_input caps the records returned for each input
  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 '{"input": [{"keyword": "machine learning", "date": "Past week", "num_of_posts": 20}], "limit_per_input": 10}'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={
          "dataset_id": "gd_lvz8ah06191smkebj4",
          "format": "json",
          "type": "discover_new",
          "discover_by": "keyword",
      },
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      # limit_per_input caps the records returned for each input
      json={
          "input": [{"keyword": "machine learning", "date": "Past week", "num_of_posts": 20}],
          "limit_per_input": 10,
      },
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4&format=json&type=discover_new&discover_by=keyword",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      // limit_per_input caps the records returned for each input
      body: JSON.stringify({
        input: [{ keyword: "machine learning", date: "Past week", num_of_posts: 20 }],
        limit_per_input: 10,
      }),
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

[Full Discover by keyword schema](/api-reference/scrapers/social-media-apis/reddit-posts-discover-by-keyword)

## Comments, Collect by URL

Scrape all comments from a Reddit post or a specific comment thread, with optional filtering by age.

**Dataset ID:** `gd_lvzdpsdlw09j6t702`

<CodeGroup>
  ```bash cURL theme={null}
  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/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/", "days_back": 7}]'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={"dataset_id": "gd_lvzdpsdlw09j6t702", "format": "json"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      json=[{"url": "https://www.reddit.com/r/learnpython/comments/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/", "days_back": 7}],
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvzdpsdlw09j6t702&format=json",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify([
        { url: "https://www.reddit.com/r/learnpython/comments/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/", days_back: 7 }
      ]),
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

<Accordion title="Example response">
  ```json theme={null}
  [
    {
      "comment_id": "p841ojc",
      "user_posted": "rec***e",
      "comment": "[List\\_comprehension](https://en.wikipedia.org/wiki/List_comprehension) have an interesting history. It use in functional programming language which python a...",
      "date_posted": "2026-09-06T05:58:16.000Z",
      "num_upvotes": 1,
      "num_replies": 0,
      "replies": null,
      "post_url": "https://www.reddit.com/r/learnpython/comments/1w8chn8/found_a_for_loop_and_cant_find_an_explanation_can/",
      "post_id": "1w8chn8",
      "post_type": null
    }
  ]
  ```
</Accordion>

[Full Comments - Collect by URL schema](/api-reference/scrapers/social-media-apis/reddit-comments-collect-by-url)

### Which output fields does the Reddit comments scraper return?

The Reddit comments scraper (`gd_lvzdpsdlw09j6t702`, `collect_by_url`) returns 34 output fields.

<Accordion title="Output fields (34)">
  | Field | Type | Description |
  | - | - | - |
  | `url` | url | URL of comment |
  | `comment_id` | text | ID of comment |
  | `user_posted` | text | Username of the user who posted the comment |
  | `comment` | text | Description of the comment |
  | `date_posted` | date | Date posted |
  | `post_url` | url | URL of the post this comment appears at |
  | `post_id` | text | ID of the post this comment appears at |
  | `community_name` | text | The name of the community the comment was posted at |
  | `community_url` | text | URL of the community where the comment was posted at |
  | `community_description` | text | Description of the community this comment was posted at |
  | `community_members_num` | text | Number of community members where the comment was posted at |
  | `community_rank` | object | |
  | `replies` | array | |
  | `num_upvotes` | number | Number of comment's upvotes |
  | `num_replies` | number | Number of replies to the comment |
  | `days_back` | number | Reproduce from Input |
  | `is_moderator` | boolean | A post has a "MOD" icon - this means it was posted by a moderator or bot in some cases |
  | `is_pinned` | boolean | pinned or stickied comment, placed on top of all |
  | `has_bot_in_username` | boolean | The username has a substring "bot" - This parameter can be an indirect sign of a bot In most cases, but can also occur in common usernames |
  | `is_locked` | boolean | The post has a "lock" icon - this means that comments are blocked by moderators and no one but them can comment on them. This parameter can be an indirect sign of a bot |
  | `is_admin_post` | boolean | hidden is labeled as "distinguished admin" |
  | `is_archived_post` | boolean | Indicates whether the post is archived or not |
  | `is_moderator_post` | boolean | Specifies if the post is made by a moderator |
  | `is_quarantined_post` | boolean | Indicates if the post is quarantined |
  | `is_not_safe_for_work_post` | boolean | Flags whether the post contains content not safe for work |
  | `is_eligible_for_content_blocking_post` | boolean | Specifies if the post is eligible for content blocking |
  | `is_promoted_post` | boolean | Indicates if the post is promoted content |
  | `post_language` | text | Language in which the post is written |
  | `post_state` | text | Current state/status of the post |
  | `post_type` | text | Type or category of the post |
  | `images` | array | Images from the comment |
  | `parent_comment_id` | text | |
  | `root_comment_id` | text | Links all replies to the original root comment |
  | `videos` | array | Video and GIF URLs |
</Accordion>

Machine-readable version with the input schema: [`/scrapers/gd_lvzdpsdlw09j6t702.json`](/scrapers/gd_lvzdpsdlw09j6t702.json)

## Related

<CardGroup cols={2}>
  <Card title="Async batch requests" icon="layer-group" href="/products/scrapers/scrapers-library/async-requests">
    Scrape thousands of posts or run keyword discovery jobs in a single async request.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/scrapers/social-media-apis/reddit-posts-collect-by-url">
    Full endpoint specs, parameters and response schemas.
  </Card>
</CardGroup>
