Mastodon Trending Links API
Articles and pages a server is sharing most, with the link card and daily share counts.
GET /v1/mastodon/trends/links1 credit Failed requests are free
About this endpoint
GET /v1/mastodon/trends/links?host=mastodon.social returns data.links. Each link is a link card plus its history: url, title, description, type, providerName, providerUrl, authors, publishedAt, language, image and history. Each history day has date, uses and accounts, newest first.
The list is cursor-paged: read data.page.hasMore and pass page.nextCursor as cursor for the next slice. The offset parameter also works. Mastodon orders trends live, so a link can move between requests and appear on two pages; remove repeats by url. limit accepts 1 to 20 and defaults to 20. Trends are local to the server, and some operators close the trending link feed: that returns lookupStatus: restricted and may include declaredAccess.
Mastodon Trending Links API FAQ
What does a trending link include?
A link card with url, title, description, type, providerName, providerUrl, authors, publishedAt, language and image, plus history with daily uses and accounts for the last seven days.
How many credits does a page cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth. Each paginated page is a separate billed request.
Why is the link feed restricted?
Some operators close the trending link feed to the public. reason.code says whether a login is required or the operator disabled it.
How does cursor paging work here?
Read page.hasMore and pass page.nextCursor as cursor for the next slice. Trending lists shift between requests, so a shifted list can repeat or skip an item.
Other Mastodon endpoints
- ProfileGET /v1/mastodon/profiles/{handle}
- Profile postsGET /v1/mastodon/profiles/{handle}/posts
- FollowersGET /v1/mastodon/profiles/{handle}/followers
- FollowingGET /v1/mastodon/profiles/{handle}/following
- CollectionsGET /v1/mastodon/profiles/{handle}/collections
- Profiles by idGET /v1/mastodon/profiles/batch
- PostGET /v1/mastodon/posts
- Post contextGET /v1/mastodon/posts/context