← All guides

DIY guide · Medium API

Trending pages are a product, not a spreadsheet

Readers trust "Best of JavaScript this week." Medium already ranks stories—you expose that ranking through **topfeeds**, **latestposts**, and **tag info** in JSON your front end owns.

UX patterns

  • Tabs: Hot / New / Top month / All-time via {mode}
  • Topic landing: hero stats from tag info + feed below
  • Related topics sidebar from related_tags

Performance

Cache feeds 5–15 minutes. Trending does not need second-level freshness. Pre-render popular tags at build time for static sites.

Endpoints

  • /tag/{tag}
  • /latestposts/{topic_slug}
  • /topfeeds/{tag}/{mode}
  • /related_tags/{tag}