Subreddit Comments API
Get the latest comments posted anywhere in a subreddit, with author, score, and the post each comment belongs to. JSON, $0.01 per call.
/v1/reddit/subreddit-commentsReturns the newest comments across a whole subreddit — a live feed of the community's conversation. Each comment carries the title and URL of the post it was left on. For the comment tree of a single post, use the Reddit Comments API.
Usage
const res = await fetch('https://api.yepapi.com/v1/reddit/subreddit-comments', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"subreddit": "python"}),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/reddit/subreddit-comments \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subreddit": "python"}'import requests
res = requests.post(
"https://api.yepapi.com/v1/reddit/subreddit-comments",
headers={"x-api-key": "YOUR_API_KEY"},
json={"subreddit": "python"},
)
print(res.json()["data"])Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
subreddit | string | Yes | Subreddit name — python, r/python, or a reddit.com/r/python URL (2–21 characters) | — |
cursor | string | No | cursor from the previous response, to fetch the next page | — |
Response
{
"ok": true,
"data": {
"comments": [
{
"author": "Amazing_Learn",
"body": "Maybe, that can happen, if you look into the current [source](https://github.com/notypecheck/passlib/blob/73370df5fd9d1b864d3a1f7a6cd0b1c800ef8523/passlib/handlers/argon2.py#L106-L113) it is a bit tri…",
"created_at": "2026-10-30T23:12:36+00:00",
"created_utc": 1793401956,
"edited": false,
"id": "19rwhoa1trgqt",
"is_submitter": true,
"name": "t1_19rwhoa1trgqt",
"parent_id": "t1_19rwhb2qcl1fn",
"permalink": "https://www.reddit.com/r/Python/comments/1xj74pw/im_now_maintaining_passlib/19rwhoa1trgqt/",
"post_id": "t3_1xj74pw",
"post_title": "I'm now maintaining passlib",
"post_url": "https://www.reddit.com/r/Python/comments/1xj74pw/im_now_maintaining_passlib/",
"score": 1,
"stickied": false,
"subreddit": "Python"
},
{
"author": "maikeu",
"body": "Maybe I am recalling a different smaller library :o ",
"created_at": "2026-10-30T23:04:23+00:00",
"created_utc": 1793401463,
"edited": false,
"id": "19rwhb2qcl1fn",
"is_submitter": false,
"name": "t1_19rwhb2qcl1fn",
"parent_id": "t1_19rwgybuvlabm",
"permalink": "https://www.reddit.com/r/Python/comments/1xj74pw/im_now_maintaining_passlib/19rwhb2qcl1fn/",
"post_id": "t3_1xj74pw",
"post_title": "I'm now maintaining passlib",
"post_url": "https://www.reddit.com/r/Python/comments/1xj74pw/im_now_maintaining_passlib/",
"score": 2,
"stickied": false,
"subreddit": "Python"
}
],
"cursor": "t1_19rvzzpcbll7l"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.comments | object[] | Latest comments, newest first |
data.comments[].id | string | Comment ID |
data.comments[].name | string | Fullname, t1_ + ID |
data.comments[].author | string | Author username |
data.comments[].body | string | Comment text in Markdown |
data.comments[].score | number | Net upvotes |
data.comments[].subreddit | string | Subreddit name |
data.comments[].permalink | string | Full URL of the comment |
data.comments[].parent_id | string | Fullname of the parent (t1_ comment or t3_ post) |
data.comments[].post_id | string | Fullname of the post the comment is on |
data.comments[].post_title | string | Title of that post |
data.comments[].post_url | string | URL of that post |
data.comments[].created_utc | number | Unix timestamp (seconds) |
data.comments[].created_at | string | ISO 8601 timestamp |
data.comments[].edited | boolean | Comment was edited |
data.comments[].stickied | boolean | Pinned by moderators |
data.comments[].is_submitter | boolean | Author is the post's author (OP) |
data.cursor | string | null | Cursor for the next page |
Pagination
Each response includes a cursor. Send the same request again with that value in cursor to get the next page. When cursor is null, there are no more results. A query with no matches returns 200 with an empty list and cursor: null. Every page is a separate $0.01 call.
Caching
Responses are cached for 15 minutes.
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | subreddit is missing or not a valid subreddit name |
429 | RATE_LIMITED_UPSTREAM | Too many requests in a short burst — retry after a few seconds |
502 | UPSTREAM_ERROR | Temporary problem fetching data from Reddit — retry |
Failed calls are not charged.
Related Endpoints
- Reddit Comments API — the full comment tree for one post
- Subreddit Posts API — the subreddit's posts
- Reddit User Comments API — comments by one account
Subreddit Posts API
Subreddit Posts API and subreddit scraper — list a subreddit's hot, new, top, or controversial posts with scores, comment counts, and media as JSON. $0.01 per call.
Subreddit Rules API
Get a subreddit's rules — title, full description, report reason, and whether each applies to posts or comments. JSON, $0.01 per call.