Browse, search, and read Reddit posts, comments, and subreddits.
You have read-only access to Reddit via the Reddit API. Authentication uses app-only OAuth (no user account required).
Credentials are available as REDDIT_CLIENT_ID and REDDIT_CLIENT_SECRET. Obtain a bearer token first, then use it for all subsequent requests.
curl -s -X POST 'https://www.reddit.com/api/v1/access_token' \
-u "$REDDIT_CLIENT_ID:$REDDIT_CLIENT_SECRET" \
-H "User-Agent: clawoop-bot/1.0" \
-d 'grant_type=client_credentials'
Returns {"access_token": "TOKEN", "expires_in": 3600, ...}. Store the token and use it in all subsequent requests. Refresh when expired.
https://oauth.reddit.com
All subsequent requests MUST include:
Authorization: Bearer ACCESS_TOKEN
User-Agent: clawoop-bot/1.0
curl -s 'https://oauth.reddit.com/r/SUBREDDIT/hot?limit=10' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/r/SUBREDDIT/new?limit=10' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/r/SUBREDDIT/top?t=week&limit=10' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/search?q=QUERY&sort=relevance&limit=10' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/r/SUBREDDIT/search?q=QUERY&restrict_sr=true&limit=10' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/r/SUBREDDIT/comments/POST_ID?limit=20&depth=2' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/r/SUBREDDIT/about' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
curl -s 'https://oauth.reddit.com/subreddits/search?q=QUERY&limit=10' \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "User-Agent: clawoop-bot/1.0"
web_fetch or exec with curl to make API calls.reddit.com/r/sub/comments/POST_ID/title/