Blog

Reddit Hot Posts API: Fetch the Oct 27 Board in Python

Fetch Reddit hot posts in Python with one POST: the call, the row shape, and the freshness check that caught a 24-day-old snapshot.

Trends API team Published Data as of 2026-11-20

The latest Reddit Hot Posts snapshot is dated October 27, 2026

One POST fetches the Reddit hot posts board. The call is get_top_trends with type Reddit Hot Posts and a limit. It works: a live call in this run returned 10 rows for 1 request. The catch sits in the timestamp. The snapshot is dated 2026-10-27T20:01:34Z, 24 days before this run, and three calls, with limits 10 and 5, returned the identical snapshot. Treat this board as a frozen copy of the front page from October 27, not as today. World News, checked the same day, was only 3 days old, so check each board on its own, not once per source. Request limits live on /pricing.

One POST returns the ten rows from the Oct 27 snapshot

One helper is enough: it posts the body, checks the envelope, and parses the body string a second time.

import json, os
import requests

KEY = os.environ["TRENDS_API_KEY"]
URL = "https://api.trendsmcp.ai/api"

def call(body):
    resp = requests.post(URL, headers={
        "Authorization": f"Bearer {KEY}",
        "Content-Type": "application/json",
    }, json=body, timeout=30)
    resp.raise_for_status()
    envelope = resp.json()
    if envelope.get("statusCode") != 200:
        raise SystemExit(envelope)
    parsed = envelope["body"]
    return json.loads(parsed) if isinstance(parsed, str) else parsed

The envelope carries statusCode 200, and its body field holds the result as a JSON string to parse again. Code that skips that second parse ends up holding text where it expected a list. A direct POST in this run confirmed the shape: HTTP 200, statusCode 200, and a body string holding the board. The Reddit trends page shows the same board without code.

board = call({"mode": "get_top_trends", "type": "Reddit Hot Posts", "limit": 10})
print(board["as_of_ts"], board["count"])
for rank, title in board["data"]:
    print(rank, title)

Each row is a pair: rank, then post title. The first three rows in this run read: "Second woman to ever lift the dinnie stones side by side - Angelica Jardine.", "This should happen in every country", and "Proud parents welcome their first baby to the world". The call costs 1 request on REST.

Read as_of_ts first, this board is 24 days old

The board answers "what was hot" only if the snapshot is recent, so the first thing the code should do after the call is read as_of_ts and compare it with today.

from datetime import datetime, timezone

snapshot = datetime.fromisoformat(board["as_of_ts"])
age_days = (datetime.now(timezone.utc) - snapshot).days
print("snapshot:", board["as_of_ts"], "age in days:", age_days)
if age_days > 1:
    print("WARNING: board is stale, do not quote as current")

In this run the check prints an age of 23 days by elapsed time, 24 by calendar date, and the warning fires. The staleness is not a one-call fluke. Three calls returned the same snapshot timestamp, 2026-10-27T20:01:34.275337+00:00, with the same top five rows in the same order: two calls through the kit tool with limits 10 and 5, and one direct POST with limit 10. A board that returns identical rows across calls is a frozen snapshot, and this one froze on October 27. Earlier runs flagged the same problem, so the freeze predates this run.

The freeze is specific to this board, not to Reddit as a whole. The Reddit World News board returned a snapshot dated 2026-11-17T17:01:34Z in the same run, three days before this tutorial, with 5 rows headed by a WorldNews live thread on Ukraine. That board moves. Hot Posts does not. Check as_of_ts per board, never once per source.

Climbers return nothing when the board turns over

The climbers call returned 0 rows in this run, because the board turned over completely against the 7-day baseline. To ask for the biggest climbers, pass sort as rank_change with a window such as 7d; the API documents climber rows as objects with prev_rank and rank_change instead of plain pairs, though no rows were observed in this run to confirm it.

climbers = call({
    "mode": "get_top_trends",
    "type": "Reddit Hot Posts",
    "limit": 5,
    "sort": "rank_change",
    "window": "7d",
})
print(climbers["count"], climbers["data"])
print(climbers["note"])

The call in this run returned 0 rows against a baseline dated 2026-10-21T02:01:37Z. The note explains why: "The 'Reddit Hot Posts' board turned over completely versus the 7d baseline: no item appears in both snapshots, so no rank change can be computed. Use sort=\"rank\" for the current board." An empty list here is a normal result, not an error, and the code should handle it as one. The interesting detail is the baseline date: that turnover suggests the board moved between October 21 and October 27, then stopped. The freeze started after October 27, not before. The climbers call costs 1 request, same as the board call.

A row carries a title and nothing else

Each row is [rank, title] only: no subreddit, score, author, URL, or timestamp. The title is the whole payload. That rules out the obvious next steps: ranking by score is impossible from this board, filtering by subreddit is impossible, and linking a reader to the post needs a separate lookup by title.

The titles themselves show why the missing subreddit matters. Rank 8 in this run is "Meirl" and rank 10 is "Wait wait for real?", and neither means anything without the community it came from. Rank 5, "Hand Feeding a Spider", could sit in half a dozen subreddits. A dashboard that prints titles without their subreddit prints riddles for the bottom half of the board.

The other route to Reddit detail did not answer in this run either. A get_context call for Elden Ring on Reddit returned 0 items with the note "source unavailable". The same failure appeared in an earlier run, so treat Reddit context as unreliable until a run shows otherwise. Code that calls it should accept an empty items list and carry on, not crash.

For a dashboard, the honest shape is a table of rank and title plus the snapshot timestamp in the header, refreshed only when as_of_ts moves. The guide to Reddit trends without the Reddit API covers the same board from the setup side. Until the snapshot moves, the board is a record of October 27, and any page built on it should say so next to the data.

Poll for a new snapshot, not for new posts

A frozen board punishes polling. Calling every hour returns the same ten rows and spends 1 request each time, so the polling loop should compare timestamps and stop there.

seen = None

def fresh_board():
    global seen
    board = call({"mode": "get_top_trends", "type": "Reddit Hot Posts", "limit": 10})
    if board["as_of_ts"] == seen:
        return None
    seen = board["as_of_ts"]
    return board

A None return means the snapshot has not moved, and the dashboard keeps showing the old rows with the old timestamp. A new board means as_of_ts changed, and only then is a re-render worth doing. The same pattern fits any board: World News moved within three days in this run, Hot Posts did not move in 24. One loop serves both, and the timestamp decides the work.

Questions

Is the Reddit Hot Posts board live?

The call works, but the snapshot in this run is dated 2026-10-27, 24 days before the run. Check as_of_ts on every call before quoting the board.

What does each row contain?

Rank and post title only. No subreddit, score, author, URL, or timestamp travels with the row.

Can I get the biggest climbers instead?

Sort rank_change returns objects with prev_rank and rank_change, but in this run it returned 0 rows because the board turned over completely against the 7-day baseline.

Sources