# Get Reddit Comments

<p>Retrieve a public Reddit post and normalized nested comments using its URL, or provide both post_id and subreddit. Each successful request costs <strong>1 credit</strong>; 404, 422, 502, and 503 responses are not billable.</p>

- **Documentation:** [https://scrappa.co/docs/reddit-api/reddit_comments](https://scrappa.co/docs/reddit-api/reddit_comments)
- **API group:** Reddit API
- **Endpoint:** `GET https://scrappa.co/api/reddit/comments`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | No | Full reddit.com post URL, up to 2,000 characters. Provide url or post_id. |
| `post_id` | string | No | Reddit post ID containing 4-20 letters, numbers, or underscores. Provide post_id or url. |
| `subreddit` | string | No | Subreddit name without r/. Required with post_id when url is omitted; 2-100 letters, numbers, or underscores. |
| `sort` | string | No | Optional comment sort: confidence, top, new, controversial, old, or qa. |
| `limit` | integer | No | Optional number of comments from 1 to 100. Defaults to 25. |
| `extraction_path` | string | No | Optional source: public_json or old_reddit. Defaults to public_json. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/reddit/comments?url=https%3A%2F%2Fwww.reddit.com%2Fr%2FLaravel%2Fcomments%2Fabc123%2Flaravel_13_release_notes%2F&sort=confidence&limit=25&extraction_path=public_json"
```

## Example response

```json
{
    "source": "public_json",
    "data": {
        "post": {
            "id": "abc123",
            "name": "t3_abc123",
            "subreddit": "Laravel",
            "title": "Laravel 13 release notes",
            "author": "example_user",
            "permalink": "https://www.reddit.com/r/Laravel/comments/abc123/laravel_13_release_notes/",
            "url": "https://www.reddit.com/r/Laravel/comments/abc123/laravel_13_release_notes/",
            "selftext": "A discussion of the latest Laravel release.",
            "score": 128,
            "upvote_ratio": 0.95,
            "num_comments": 36,
            "created_utc": 1781900000,
            "over_18": false,
            "spoiler": false,
            "stickied": false,
            "flair": "News",
            "thumbnail": "self"
        },
        "comments": [
            {
                "id": "def456",
                "name": "t1_def456",
                "parent_id": "t3_abc123",
                "link_id": "t3_abc123",
                "author": "helpful_user",
                "body": "The upgrade guide covers the main changes.",
                "score": 18,
                "created_utc": 1781901000,
                "permalink": "https://www.reddit.com/r/Laravel/comments/abc123/laravel_13_release_notes/def456/",
                "replies": []
            }
        ]
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Reddit Content Not Found |  |
| 422 | Validation Error |  |
| 502 | Reddit Upstream Error |  |
| 503 | Reddit Temporarily Unavailable |  |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
