honesthook

mastodon-api/posts

Mastodon posts API — recent posts, boosts excluded

Recent posts from the profile itself, via the official API of the account's own instance. No key.

Parameters

NameWhat it is
handleuser@instance. Without the instance, 400.
limit1 to 40, default 20. Outside the range it is refused with 400 rather than clamped — the source clamps in silence, and someone asking for 100 would get 40 and think the account has 40 posts.

Handle format and anchor

What this endpoint does not return.

A field we cannot read comes back null, never 0. A zero would be a claim about the account; null is a fact about our collection.

Where this goes wrong.

A boost is a third party's post and does not enter — 15 in every 20 of the raw feed. The outer object of a boost arrives with empty text and zeroed metrics, so counting them would report an account posting empty statuses. A reply to another person DOES enter, because the account wrote it. The body comes in two fields: text, already stripped of HTML, and text_html with the original — that one is third-party HTML and must be sanitised before it reaches a page.

Cost

1 credit per call. A call that finds nothing costs nothing.

Why are boosts excluded when they are most of the feed?

Because a boost is not a post by this account. The outer object carries empty text and zeroed metrics.

Are replies included?

Yes. The account wrote the reply, so it is the account's post.

Can I put text_html straight on a page?

No. It is third-party HTML and needs sanitising first, or you have an XSS. Use text if you want it already clean.

Other routes for this platform

← mastodon-api