Mastodon API

Read public posts from Mastodon instances as JSON with one EveryInfra API key: the posts and identity of accounts, hashtag topics, trending posts and timelines, from $1.39 per 1,000 calls.

All you need is one API key, no Mastodon account or cookie. It also works as an MCP tool in Claude and Cursor. Star our two GitHub repositories to claim $1 in trial credit and try it first. The credit is valid for 24 hours after you claim it.

  • 5 endpoints, one key.
  • Failed calls and empty results are not charged.
  • It reads the instance you name, not the whole fediverse.

Real samples of the trending list and the timeline

POST /api/v1/social params {}

One call with no parameters for each of the trending list and the timeline, captured September 26, 2026 (UTC). Without instance, the two endpoints read different instances. Each box links to its endpoint page.

Platform availability

24h health
Normal
Normal

Last 30 days

Available capabilities

Retrieve public Mastodon statuses, lightweight profiles, and public timelines by account, hashtag, or instance.

Set the instance domain for timeline queries. Usernames on other instances need the matching server name.

Accounts

  • Pull the posts of one Mastodon account, given as a handle or user@instance in username.

    user_posts$1.39 per 1,000 callsEvery 20 rows count as one call

  • ProfilesNormal

    Resolve a Mastodon handle or user@instance address to one account's display name, full handle, home instance and profile link.

    profile$1.39 per 1,000 calls

Topics and timelines

  • HashtagNormal

    Browse the posts under a Mastodon hashtag, given without the # in hashtag, with author, text, language, media links and like, boost and reply counts.

    hashtag$1.39 per 1,000 callsEvery 20 rows count as one call

  • TrendingNormal

    Get the posts trending on a Mastodon instance, mastodon.social unless instance names another.

    trending$1.39 per 1,000 callsEvery 20 rows count as one call

  • TimelineNormal

    Read the public timeline of a Mastodon instance, fosstodon.org by default.

    timeline$1.39 per 1,000 callsEvery 20 rows count as one call

5 questions to ask before choosing a data API for Mastodon

Do I need to log in to Mastodon or provide a cookie to make calls?

No. Send Authorization: Bearer with your API key in the request header, and put platform, action and the capability parameters in the request body. There is no QR-code login, no login state to maintain and no browser to run.

How is it billed? Are failed requests charged? Is there a free trial?

Billing is per request, $1.39 per 1,000 requests. Failed requests, empty results, invalid parameters and authentication failures are not charged. Star both everyinfra/everyinfra-agent-plugins and everyinfra/seo-skills on GitHub, then claim $1 under Balance & top-ups in the console. It is valid for 24 hours after you claim it, and no credit card is needed.

Can I connect this Mastodon API to Claude or Cursor?

Yes. The remote MCP URL is https://api.everyinfra.com/mcp. Add Authorization: Bearer and your API key as a request header; there is no local program to install. Setup for Claude, Cursor, ChatGPT and Claude Code is on https://everyinfra.com/en/mcp-server.

What compliance points apply when using Mastodon data?

The EveryInfra Terms of Service require you to make sure your use of the data complies with applicable law and the platform's terms. They prohibit unlawful use, violating privacy or intellectual property, and bulk scraping for harassment, fraud or other malicious purposes. If you use personal information such as nicknames and avatars, keep only the fields your business needs.

What Mastodon data can I get?

Available Mastodon capabilities (5): Posts by user, Profiles, Hashtag, Trending, Timeline. The parameters and response fields of each capability are in the API reference on this page.

Use cases

  • Follow accounts

    Read the posts and the identity of an account by name, and use handle to tell apart accounts with the same name on different instances.

    Usesuser_postsprofile

  • Watch topics and the mood of an instance

    Read topics by tag, then look at trending posts and the timeline to see what an instance discusses.

    Useshashtagtrendingtimeline

Mastodon API vs EveryInfra

The Mastodon documentation is split into pages by method (timelines, trends, accounts and more). How each endpoint compares with its method is shown on the endpoint pages.

ComparedMastodon APIEveryInfra

The platform page shows no comparison table. Official sources:

What does each Mastodon action accept?

Parameter table for all 5 actions

Sync delivery for every action.

ActionRequiredOptionalLimitPer 1,000Response fields
user_posts

Posts by user

Pull the posts of one Mastodon account, given as a handle or user@instance in username. Get like, boost and reply counts, language and a flag that marks boosts. Same-named accounts on other instances stay separate. The full history is not guaranteed.

usernameinstanceCatalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.$1.39 per 1,000 requestsEvery 20 rows count as one callid · url · text · author_name · author_username · author_url · instance · like_count · reblog_count · comment_count · language · is_reblog · posted_at · platform · media_urls · hashtags
profile

Profiles

Resolve a Mastodon handle or user@instance address to one account's display name, full handle, home instance and profile link. A bare handle is looked up on mastodon.social unless instance is set, and a match does not prove it is the account you meant.

usernameinstance—$1.39 per 1,000 requestsusername · display_name · handle · instance · url · platform
hashtag

Hashtag

Browse the posts under a Mastodon hashtag, given without the # in hashtag, with author, text, language, media links and like, boost and reply counts. They come from one instance's tag timeline and leave out boosts and replies, so they do not measure the whole federated conversation.

hashtaginstanceCatalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.$1.39 per 1,000 requestsEvery 20 rows count as one callid · url · text · author_name · author_username · author_url · instance · like_count · reblog_count · comment_count · language · is_reblog · posted_at · platform · media_urls · hashtags
trending

Trending

Get the posts trending on a Mastodon instance, mastodon.social unless instance names another. Each post has author, text, language, media and like, boost and reply counts. Positions and counts show the moment of the call. They do not explain the trending algorithm or rank the whole fediverse.

instanceCatalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.$1.39 per 1,000 requestsEvery 20 rows count as one callid · url · text · author_name · author_username · author_url · instance · like_count · reblog_count · comment_count · language · is_reblog · posted_at · platform · media_urls · hashtags
timeline

Timeline

Read the public timeline of a Mastodon instance, fosstodon.org by default. Each post has author, text, language, media links and like, boost and reply counts. It is not a signed-in personal feed or an archive of everything on Mastodon.

instanceCatalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.$1.39 per 1,000 requestsEvery 20 rows count as one callid · url · text · author_name · author_username · author_url · instance · like_count · reblog_count · comment_count · language · is_reblog · posted_at · platform · media_urls · hashtags
What each action's parameters mean (5 actions)

Each answer below pairs one callable action with its real inputs. Parameter meanings and allowed values are action-specific; a familiar name does not carry the same meaning across every platform.

Official sources are linked only to clarify the platform term beside them. They do not imply platform authorization or endorsement, and features of the official site are not part of the EveryInfra API unless this page lists them.

What do the Mastodon user_posts parameters mean?

Pull the posts of one Mastodon account, given as a handle or user@instance in username. Get like, boost and reply counts, language and a flag that marks boosts. Same-named accounts on other instances stay separate. The full history is not guaranteed.

Full API reference: parameters, code samples, response example and health
usernameRequired
Specifies the Mastodon account handle or full user@instance format, with an optional leading @ symbol. Providing a short handle without specifying an instance defaults to mastodon.social, and identical usernames across different instances represent distinct accounts.
Mastodon WebFinger: Account Handles Require Domain Resolution — Official documentation explicitly states that @user@example.com and @user@example.org are distinct accounts, defined by both username and domain. This document clarifies account identification rules and does not imply that this gateway returns all official Account metadata. · Checked
instanceOptional
Selects a Mastodon instance domain without a scheme or path. Timeline defaults to fosstodon.org and other actions default to mastodon.social. An explicit instance takes precedence over the domain in username, so keep the two values consistent.

What do the Mastodon profile parameters mean?

Resolve a Mastodon handle or user@instance address to one account's display name, full handle, home instance and profile link. A bare handle is looked up on mastodon.social unless instance is set, and a match does not prove it is the account you meant.

Full API reference: parameters, code samples, response example and health
usernameRequired
Specifies the Mastodon account handle or full user@instance format, with an optional leading @ symbol. Providing a short handle without specifying an instance defaults to mastodon.social, and identical usernames across different instances represent distinct accounts.
Mastodon WebFinger: Account Handles Require Domain Resolution — Official documentation explicitly states that @user@example.com and @user@example.org are distinct accounts, defined by both username and domain. This document clarifies account identification rules and does not imply that this gateway returns all official Account metadata. · Checked
instanceOptional
Selects a Mastodon instance domain without a scheme or path. Timeline defaults to fosstodon.org and other actions default to mastodon.social. An explicit instance takes precedence over the domain in username, so keep the two values consistent.

What do the Mastodon hashtag parameters mean?

Browse the posts under a Mastodon hashtag, given without the # in hashtag, with author, text, language, media links and like, boost and reply counts. They come from one instance's tag timeline and leave out boosts and replies, so they do not measure the whole federated conversation.

Full API reference: parameters, code samples, response example and health
hashtagRequired
Specifies the topic tag without the leading # to fetch the hashtag timeline on a target instance. Excludes boosts and replies, so it does not represent a complete sample of federated network tags.
Mastodon: Hashtag Streams and Public Instance Preview Limits — Official documentation states that hashtag feeds retrieve public statuses containing a given tag, with tag paths excluding the # symbol; instance access is constrained when public previews are disabled. EveryInfra parameters for excluding Boosts/replies are the ones documented on this page, not a copy of every official query key. · Checked
instanceOptional
Selects a Mastodon instance domain without a scheme or path. Timeline defaults to fosstodon.org and other actions default to mastodon.social. An explicit instance takes precedence over the domain in username, so keep the two values consistent.

What do the Mastodon trending parameters mean?

Get the posts trending on a Mastodon instance, mastodon.social unless instance names another. Each post has author, text, language, media and like, boost and reply counts. Positions and counts show the moment of the call. They do not explain the trending algorithm or rank the whole fediverse.

Full API reference: parameters, code samples, response example and health

What do the Mastodon timeline parameters mean?

Read the public timeline of a Mastodon instance, fosstodon.org by default. Each post has author, text, language, media links and like, boost and reply counts. It is not a signed-in personal feed or an archive of everything on Mastodon.

Full API reference: parameters, code samples, response example and health
instanceOptional
Selects a Mastodon instance domain without a scheme or path. Timeline defaults to fosstodon.org and other actions default to mastodon.social. An explicit instance takes precedence over the domain in username, so keep the two values consistent.

How to use the Mastodon API

  1. 01Choose a platform action from the public catalog.
  2. 02Send the platform, action, and required parameters to POST /api/v1/social.
  3. 03Read the result from the response. For an asynchronous action, poll the returned job ID.
  4. 04Store the response fields that your application needs.
mastodon_user_posts.sh
curl -X POST https://api.everyinfra.com/api/v1/social \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"mastodon","action":"user_posts","params":{"username":"<username>"}}'

Mastodon API questions

What can I retrieve with the Mastodon API?

Set platform to mastodon. The current catalog lists posts by user, profiles, hashtag, trending, and timeline. These action names identify different Mastodon objects or views; they are not interchangeable search modes.

Which input starts the Mastodon user_posts request?

Specifies the Mastodon account handle or full user@instance format, with an optional leading @ symbol. Providing a short handle without specifying an instance defaults to mastodon.social, and identical usernames across different instances represent distinct accounts. Send it as username inside params.

Which fields can Mastodon user_posts return?

Its declared schema includes text, author_name, author_username, and author_url. A declared field can still be absent from an individual record, and every other action has its own field list.

Does every Mastodon action return immediately?

Actions labeled asynchronous return a job ID you poll. Every other action can also run asynchronously: add "mode": "async" to the request body to receive a job ID immediately, useful for slow tasks or large limits. The current catalog contains sync delivery.

Google Analytics needs consent. Privacy