Mastodon hub

Mastodon Posts Batch API

Up to 20 post ids from one server in one request, with the missing ones named.

GET /v1/mastodon/posts/batch

1 credit Failed requests are free

About this endpoint

GET /v1/mastodon/posts/batch?host=mastodon.social&ids=1 takes one server and a comma-separated list of post ids from that server. It returns data.posts with full post records and data.missingIds for the requested ids the server did not return. A deleted post, a followers-only post and an id that never existed all land in missingIds, because the server does not tell them apart.

The route accepts 1 to 20 ids and does not page. Ids are local to the server: pass post ids from the same host, which you can collect from a profile's posts, a timeline or a batch of post URLs. Use it instead of one request per id when hydrating a page of posts.

Mastodon Posts Batch API FAQ

How do I pass the ids?

Send host with the server name and ids as a comma-separated list, for example ids=1,2. Between 1 and 20 ids are accepted, and duplicates are rejected.

How many credits does one batch 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.

Why is a post in missingIds?

The server did not return it: it was deleted, is not public, or the id never existed there. The server does not explain each id, so missingIds is the only signal.

Can I batch posts from different servers?

No. One request asks one host. Split the ids by server, because post ids are local to the server that issued them.