Mastodon Profile Posts API
An account's public posts, newest first, filtered to what you need and paged with a cursor.
GET /v1/mastodon/profiles/{handle}/posts1 credit Failed requests are free
About this endpoint
GET /v1/mastodon/profiles/{handle}/posts resolves the account, then returns one page of its posts. filter=all (the default) includes replies and boosts, original leaves both out, media keeps posts with media, and pinned returns the pinned posts. Add tag to keep only posts with that hashtag.
Each entry in data.posts is a full post: id, host, url, createdAt, contentHtml and text, author, stats (replies, boosts, favourites, quotes), media, hashtags, mentions, card, poll, plus isBoost, boostOf and quote. data.profile is a reference to the account. Continue with page.nextCursor while page.hasMore is true; the cursor walks backwards in time even while new posts arrive.
Mastodon Profile Posts API FAQ
Which filter should I use?
Use all for everything the account posted publicly, original to leave out replies and boosts, media for posts with an attachment, and pinned for the posts the owner pinned to the profile.
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.
How do I get older posts?
Pass page.nextCursor from the previous response as cursor while page.hasMore is true. limit accepts 1 to 40 and defaults to 20. Pinned results do not page.
Does it include boosts and replies?
Yes under filter=all. A boost has isBoost true and the boosted post in boostOf. A quote has quote.state and quote.post when the server supports quotes. Replies are posts too and carry replyTo.
What if the account does not exist?
The response is lookupStatus not_found with profile and posts null or empty. A suspended account is restricted. Neither is an error and neither is read from an error page.
Other Mastodon endpoints
- ProfileGET /v1/mastodon/profiles/{handle}
- 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
- Post editsGET /v1/mastodon/posts/edits