Post Comments
GET/v1/reddit/post/comments1 credit
Returns a post's comments as a tree, each comment with its author, text, score and replies, plus the post itself on the first page.
01Query parameters
| Name | Type | Description |
|---|---|---|
| urlrequired | string | The post URL (`https://www.reddit.com/r/<subreddit>/comments/<id>/...`) or a share URL. |
| cursoroptional | string | A cursor from the previous answer: `more.cursor` for more top-level comments, or a comment's `replies.more.cursor` for more replies to it. |
| trimoptional | boolean | `true` drops some fields: `selftext_html`, `created_at_iso`, `permalink`, `over_18` and `spoiler` from the post, `permalink` and `body_html` from comments.Default: false |
02Request
curl "https://api.scrapesocial.ai/v1/reddit/post/comments?url=https%3A%2F%2Fwww.reddit.com%2Fr%2FAskReddit%2Fcomments%2Fablzuq%2Fpeople_who_havent_pooped_in_2019_yet_why_are_you%2F" \ -H "x-api-key: $SCRAPESOCIAL_KEY"
03Responses
Real answers from the API. Lists are shortened to 2 items.
GET /v1/reddit/post/comments?url=https%3A%2F%2Fwww.reddit.com%2Fr%2FAskReddit%2Fcomments%2Fablzuq%2Fpeople_who_havent_pooped_in_2019_yet_why_are_you%2F
{
"success": true,
"credits_remaining": 4980,
"credits_charged": 1,
"post": {
"id": "ablzuq",
"author": "ShoddySubstance",
"author_fullname": "t2_2uhed5z4",
"subreddit": "AskReddit",
"title": "People who haven't pooped in 2019 yet, why are you still holding on to last years shit?",
"selftext": null,
"selftext_html": null,
"downs": 0,
"name": "t3_ablzuq",
"upvote_ratio": null,
"ups": 221993,
"total_awards_received": null,
"score": 221993,
"created": 1546376787,
"created_utc": 1546376787,
"created_at_iso": "2019-01-01T21:06:27.000Z",
"num_comments": 7896,
"url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/",
"permalink": "/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/",
"subreddit_subscribers": null,
"is_video": false,
"archived": true,
"locked": null,
"over_18": false,
"spoiler": false
},
"comments": [
{
"url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/comment/ed1emmi/",
"created_utc": 1546379793,
"created_at_iso": "2019-01-01T21:56:33.000Z",
"id": "ed1emmi",
"author": "abksploder",
"author_fullname": "t2_1jqhk71",
"body": "Bold of you to assume I'm going to take a shit this year.",
"body_html": "\n <p>\n Bold of you to assume I'm going to take a shit this year.\n </p>\n ",
"distinguished": null,
"is_submitter": false,
"stickied": false,
"collapsed": false,
"name": "t1_ed1emmi",
"parent_id": "t3_ablzuq",
"permalink": "/r/AskReddit/comments/ablzuq/comment/ed1emmi/",
"ups": 34854,
"downs": 0,
"score": 34854,
"replies": {
"items": [
{
"url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/comment/ed1erpi/",
"created_utc": 1546379905,
"created_at_iso": "2019-01-01T21:58:25.000Z",
"id": "ed1erpi",
"author": "ShoddySubstance",
"author_fullname": "t2_2uhed5z4",
"body": "bottling it up is not healthy!",
"body_html": "\n <p>\n bottling it up is not healthy!\n </p>\n ",
"distinguished": null,
"is_submitter": true,
"stickied": false,
"collapsed": false,
"name": "t1_ed1erpi",
"parent_id": "t1_ed1emmi",
"permalink": "/r/AskReddit/comments/ablzuq/comment/ed1erpi/",
"ups": 7610,
"downs": 0,
"score": 7610,
"replies": {
"items": [],
"more": {
"has_more": true,
"cursor": "eyJ0eXBlIjoic2hyZWRkaXRfbW9yZV9jb21tZW50cyIsInNyYyI6Ii9zdmMvc2hyZWRkaXQvbW9yZS1jb21tZW50cy9Bc2tSZWRkaXQvdDNfYWJsenVxP3NvcnQ9Q09ORklERU5DRSZzdGFydGluZ0RlcHRoPTImY29tbWVudFBhcmVudFBvc2l0aW9ucz0wLDAiLCJjdXJzb3IiOiJZMjl0YldWdWRIUnlaV1U2TlRkbU9XVXhORFFzT2pveU9tUXhPblF4WDJWa01XVnljR2s9Iiwic3VicmVkZGl0IjoiQXNrUmVkZGl0IiwicG9zdElkIjoiYWJsenVxIiwicGFyZW50VGhpbmdJZCI6InQxX2VkMWVycGkifQ"
}
}
}
],
"more": {
"has_more": true,
"cursor": "eyJ0eXBlIjoic2hyZWRkaXRfbW9yZV9jb21tZW50cyIsInNyYyI6Ii9zdmMvc2hyZWRkaXQvbW9yZS1jb21tZW50cy9Bc2tSZWRkaXQvdDNfYWJsenVxP3NvcnQ9Q09ORklERU5DRSZzdGFydGluZ0RlcHRoPTEmY29tbWVudFBvc2l0aW9uT2Zmc2V0PTEmY29tbWVudFBhcmVudFBvc2l0aW9ucz0wIiwiY3Vyc29yIjoiWTI5dGJXVnVkSFJ5WldVNllUTmxOalJrWXpjc09qb3hPbVY0T2lWUGVGUmZYZz09Iiwic3VicmVkZGl0IjoiQXNrUmVkZGl0IiwicG9zdElkIjoiYWJsenVxIiwicGFyZW50VGhpbmdJZCI6InQxX2VkMWVtbWki…"
}
}
},
{
"url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/comment/ed1ap8n/",
"created_utc": 1546376851,
"created_at_iso": "2019-01-01T21:07:31.000Z",
"id": "ed1ap8n",
"author": "NaziGazpacho",
"author_fullname": "t2_nuzmznc",
"body": "It's all I have",
"body_html": "\n <p>\n It's all I have\n </p>\n ",
"distinguished": null,
"is_submitter": false,
"stickied": false,
"collapsed": false,
"name": "t1_ed1ap8n",
"parent_id": "t3_ablzuq",
"permalink": "/r/AskReddit/comments/ablzuq/comment/ed1ap8n/",
"ups": 46488,
"downs": 0,
"score": 46488,
"replies": {
"items": [],
"more": {
"has_more": true,
"cursor": "eyJ0eXBlIjoic2hyZWRkaXRfbW9yZV9jb21tZW50cyIsInNyYyI6Ii9zdmMvc2hyZWRkaXQvbW9yZS1jb21tZW50cy9Bc2tSZWRkaXQvdDNfYWJsenVxP3NvcnQ9Q09ORklERU5DRSZzdGFydGluZ0RlcHRoPTEmY29tbWVudFBhcmVudFBvc2l0aW9ucz0xIiwiY3Vyc29yIjoiWTI5dGJXVnVkSFJ5WldVNlltTXdObU15WVRBc09qb3hPbVF4T25ReFgyVmtNV0Z3T0c0PSIsInN1YnJlZGRpdCI6IkFza1JlZGRpdCIsInBvc3RJZCI6ImFibHp1cSIsInBhcmVudFRoaW5nSWQiOiJ0MV9lZDFhcDhuIn0"
}
}
}
],
"more": {
"has_more": true,
"cursor": "eyJ0eXBlIjoic2hyZWRkaXRfbW9yZV9jb21tZW50cyIsInNyYyI6Ii9zdmMvc2hyZWRkaXQvbW9yZS1jb21tZW50cy9Bc2tSZWRkaXQvdDNfYWJsenVxP3NlZWtlci1zZXNzaW9uPWZhbHNlJnJlbmRlci1tb2RlPXBhcnRpYWwmdG9wLWxldmVsPTEmY29tbWVudHMtcmVtYWluaW5nPTc1JmNvbW1lbnRQb3NpdGlvbk9mZnNldD0yMCIsImN1cnNvciI6IlkyOXRiV1Z1ZEhSeVpXVTZabUUzT0RZNU9UY3NPam93T21WNE9pVlBlRDVrVkRvblIxOXZSMk1tVm1sUU9pTXZPeUpmSkNOeVZTSkNPMlpJSWxZd0kzSXpRbVp3SWpCa0ltMWFJ…"
}
}Common to every endpoint
Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.
GET /v1/cosmos/profile?handle=design
{
"success": false,
"message": "Invalid API key"
}04Notes
The first page holds about 20 top-level comments with their nested replies. `more.has_more` and `more.cursor` page the top-level comments; each comment's `replies.more` pages its replies. Pass one cursor at a time, with the same `url`. Cursors can be long; the POST form of this route takes them in a JSON body. An unknown post is a free 404; a cursor from another post is a free 400.
05Errors & credits
Every error has success: false, a real HTTP status and costs no credits.
400missing_parameter
A required parameter is missing or invalid.
403private_account
The account is private or age-restricted.
404not_found
No such account.
503upstream_error
The platform did not answer; retry shortly.