Reddit Subreddit Post Comments - Data API Endpoint

Subreddit Post Comments by post id, subreddit, user agent and access token.


Get bulk Subreddit Post Comments data from the Reddit API | Official API: https://www.reddit.com/dev/api/ | 👥  Contributors: steve 🚩  Report

✏️ Inputs

Post ID post_id Required

ID of the post in the subreddit. Corresponds to data.id in the results here: https://stevesie.com/apps/reddit-api/subreddit-posts

E.g. nl58at
Subreddit subreddit Required

Name of the subreddit.

E.g. MachineLearning
User Agent user_agent Required

A unique User-Agent identifying yourself: https://github.com/reddit-archive/reddit/wiki/API

E.g. ChangeMeClient/0.1 by YourUsername
Access Token access_token Required

Your Reddit app’s API Access Token. Generate with curl on the command line:

curl -X POST -u CLIENT_ID:CLIENT_SECRET "https://www.reddit.com/api/v1/access_token?grant_type=https://oauth.reddit.com/grants/installed_client&device_id=DEVICE_ID"

  • CLIENT_ID the string shown on https://www.reddit.com/prefs/apps (make sure your app is personal use script)
  • CLIENT_SECRET the string labeled secret on your app after clicking through on https://www.reddit.com/prefs/apps
  • DEVICE_ID 20-30 character string to identify your app. You can just use something like 00000000000000000000 for basic usage.

📝 Notes

Returns comments for a post in a Subreddit.

Posted by steve on June 29, 2022, 6:31 a.m. 🚩  Report

⚡️ Endpoint

GET https://oauth.reddit.com/r/{{subreddit}}/comments/{{post_id}}?limit=100

Body

None

Headers

Authorization
Bearer {{ access_token }}
User-Agent
{{ user_agent }}