Mastodon API

API

REST API for reading and posting statuses on Mastodon servers

Price
Free, open source
Access
OAuth to post; public reads open

About

Mastodon's REST API reads timelines and statuses, posts statuses and manages notifications and conversations on any Mastodon server, which federates over ActivityPub. Public data is readable without a token unless the server disables public preview; posting needs an OAuth token.

What you can do with it

  • Read the public timeline or a single public status without a token
  • Post statuses from a bot or app with an OAuth token
  • Run your own Mastodon server and build against its API

Get started

  1. Pick a Mastodon server or run your own
  2. Register an application on it to get an OAuth token
  3. Call the statuses and timelines endpoints

Example

# Public timeline (no token unless the server disables public preview)
curl "https://mastodon.social/api/v1/timelines/public?limit=5"
# Post a status (needs a token with the write:statuses scope)
curl -X POST https://mastodon.social/api/v1/statuses \
  -H "Authorization: Bearer $MASTODON_TOKEN" \
  -d "status=Hello from the API"

Details

Hosting
Hosted service, Self-hosted
Available in
Worldwide
MCP server
None

Tasks

Alternatives

Other tools for the same tasks.

Last checked on .