Reddit API endpoint
Returns flat public comment entries from a subreddit latest-comments feed. A `503` with a `Retry-After` header means Reddit is temporarily throttling the request; wait that many seconds and retry. If source.type is redlib, public fields and credit weights are preserved.
/reddit/subreddit/{subreddit}/commentsPath parameters: subreddit is required and accepts a subreddit name without r/.
Query parameters: limit defaults to 25 and clamps to 100. after is an optional Reddit pagination token.
Notable response behavior: invalid subreddit names or limits return 400. Empty result sets return 404. Reddit block pages, malformed upstream responses, and transport failures return 503. When Reddit rate limits the request, the response is 503 with a Retry-After header giving the number of seconds to wait; this is a temporary throttle rather than a permanent failure, so clients should back off for that long and retry instead of treating the endpoint as unavailable. The score field remains in the schema but is not populated by the default feed.
When the native Reddit source fails, the service can use the internal Redlib provider. Fallback responses retain the same fields and credit weights and report source.type=redlib with a public Reddit URL. Listing cursors use the upstream JSON cursor; results remain bounded by limit. Temporary provider, authentication, rate-limit and parser failures return 503, while confirmed missing resources return 404. Provider selection is server configuration.
| Field | Filled in, of 20 checked | Values in the sample |
|---|---|---|
| id | 20 | |
| name | 20 | |
| parent_id | 20 | |
| author | 20 | |
| body | 20 | median 230 characters |
| permalink | 20 | reddit.com |
| created_utc | 20 | 2026-10-13 |
| created | 20 | 2026-10-13 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| subreddit (path) | string | Yes | Subreddit name, without r/ | OpenAI | |
| limit | integer | No | 25 and clamps to 100 | Maximum comments, defaults to 25 and clamps to 100 | |
| after | string | No | Reddit pagination token | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/reddit/subreddit/OpenAI/comments?limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"subreddit": "OpenAI",
"comments": [
{
"id": "kabc123",
"name": "t1_kabc123",
"parent_id": "t3_1abcxyz",
"author": {
"name": "commenter_one",
"profile_url": "https://www.reddit.com/user/commenter_one/"
},
"body": "I agree with this post.",
"permalink": "https://www.reddit.com/r/OpenAI/comments/1abcxyz/openai_discussion_thread/kabc123/",
"created": "2024-04-19T00:05:00Z"
}
],
"pagination": {
"limit": 25,
"after": "t1_kabc123"
},
"source": {
"type": "feed",
"url": "https://www.reddit.com/r/OpenAI/comments/?limit=25"
}
}
}Request schema
No body schema
Response schema
#/definitions/reddit.subredditCommentsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | reddit.SubredditCommentsResponse | No | ||||
| data.comments | array | No | Recent comments in the subreddit. | |||
| data.comments[].author | object | No | Reddit user who wrote the comment. | |||
| data.comments[].author.name | string | No | reddit_user | Reddit username of the author. | ||
| data.comments[].author.profile_url | string | No | https://www.reddit.com/user/reddit_user/ | URL of the author's Reddit profile page. | ||
| data.comments[].award_count | integer | No | Number of awards the comment received. Set only when metrics are requested. | |||
| data.comments[].body | string | No | I agree with this post. | Text of the comment as written by the author. | ||
| data.comments[].created | string | No | 2024-04-19T00:00:00Z | Time the comment was posted, in UTC (RFC 3339). | ||
| data.comments[].created_utc | integer | No | 1713484800 | Time the comment was posted, in Unix seconds. | ||
| data.comments[].depth | integer | No | 1 | Nesting level of the comment in the thread. | ||
| data.comments[].id | string | No | kabc123 | Reddit comment id. | ||
| data.comments[].name | string | No | t1_kabc123 | Reddit full name of the comment, the id prefixed with `t1_`. | ||
| data.comments[].parent_id | string | No | t3_1abcxyz | Full name of the post or comment this comment replies to, for example `t3_1abcxyz`. | ||
| data.comments[].permalink | string | No | https://www.reddit.com/r/OpenAI/comments/1abcxyz/openai_discussion_thread/kabc123/ | Reddit URL of the comment. | ||
| data.comments[].replies | array | No | Replies to this comment, in the same shape. | |||
| data.comments[].score | integer | No | Net score of the comment. Set only when metrics are requested. | |||
| data.pagination | object | No | Page size and cursor for the next page. | |||
| data.pagination.after | string | No | t3_1abcxyz | Cursor to pass as the `after` parameter to fetch the next page. | ||
| data.pagination.limit | integer | No | 25 | Maximum number of items requested for this page. | ||
| data.source | object | No | Reddit page the comments were read from. | |||
| data.source.type | string | No | feed | Kind of Reddit source the data was read from. | ||
| data.source.url | string | No | https://www.reddit.com/r/OpenAI/ | Reddit URL the data was read from. | ||
| data.subreddit | string | No | OpenAI | Subreddit name, without `r/`. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/reddit/subreddit/OpenAI/comments?limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"