Reddit API with Python: Posts, Comments and Search as Normalized JSON
Pull Reddit posts, comments, subreddit feeds and people search through one normalized API — real endpoints, sealed cursors, freshness control and honest billing.
Last reviewed
Quickstart
Every request needs one header: Authorization: Bearer $FETCHPI_API_KEY. Create a free key in the console and you can replay every snippet on this page as-is.
curl -s -H "Authorization: Bearer $FETCHPI_API_KEY" "https://fetchpi.com/v1/reddit/subreddits/{name}/posts?freshness=default"The capability map
GET /v1/reddit/users/{username}— profile (karma, created).GET /v1/reddit/users/{username}/posts— the profile post feed.GET /v1/reddit/users/{username}/comments— comment history.GET /v1/reddit/posts/{id}— post detail;/commentsfor the discussion.GET /v1/reddit/search/postsand/search/users— keyword search.GET /v1/reddit/subreddits/{name}/posts— subreddit feed by sort.
Search that paginates for real
Reddit's dynamic search returns a deep cursor token; FetchPI seals it into an opaque platform cursor and accepts it back on the next call — page two is one parameter away. The posts come back filtered to organic results (promoted entries are dropped extractor-side) with the SubredditPost facts you care about: title, score, comment count, author, subreddit.
import os, requests
r = requests.get(
"https://fetchpi.com/v1/reddit/search/posts",
headers={"Authorization": f"Bearer {os.environ['FETCHPI_API_KEY']}"},
params={"q": "openai", "freshness": "live"}, timeout=30,
)
page = r.json()
print([p["title"] for p in page["data"]])
page2 = requests.get(
"https://fetchpi.com/v1/reddit/search/posts",
headers={"Authorization": f"Bearer {os.environ['FETCHPI_API_KEY']}"},
params={"q": "openai", "freshness": "live", "cursor": page["next_cursor"]},
timeout=30,
).json()Monitoring-friendly defaults
For recurring reads use freshness=default&max_age=900 — the repeat pages ride the response cache and meta.billing.cache_hit shows it. This is exactly what the social monitoring demo runs.