Use cases / Mastodon

Mastodon post data API

Mastodon is not one website. It is many independently run servers that talk to each other, so the same kind of post can live at thousands of different addresses. If a user pastes a Mastodon link into your product, you need the text, the author and the date without first working out which server it came from or what that server allows.

What the official Mastodon interface gives, and where it stops

Every Mastodon server exposes the same REST API, and public posts can often be read from it directly. The limits quoted are the defaults in the Mastodon software, applied by each server; an operator can run a different setup. Use the native API when you post, follow, read timelines or act for a signed-in account.

What the FoxAPIs endpoint adds

You pass the address of one post to FoxAPIs and get back a flat object with the same field names the other post endpoints here use: text, title, author name and handle, author address and publication time where the post carries them. Code that already reads another source from this key needs no new parser for Mastodon, and you do not keep a list of servers or tokens. It reads one public post per call. It does not search the network, stream timelines, publish, or reach posts that are private or limited to followers.

It suits link previews in a community tool, collecting posts that your own users submit as evidence or testimonials, and archiving the wording of an announcement with the time it was published. Because the author may edit or delete a post later, store what you read together with the time you read it if the wording matters to you.

POST /v1/social/mastodon/post costs 1 credit for a successful call; an answer with no data is not charged. Plans and top-ups are on the pricing page. Endpoint page · Get a key

A real response

Captured 22 November 2026 from a live call, shortened here: long text and long lists are cut, and contact details and lists of people are left out.

{
  "url": "https://mastodon.social/@Gargron/117621282276303009",
  "platform": "mastodon",
  "extracted_at": "2026-11-22T01:32:45.806503+00:00",
  "text": "#SilentSunday",
  "title": "#SilentSunday",
  "description": null,
  "author_name": "Eugen Rochko",
  "author_handle": "Gargron",
  "author_url": "https://mastodon.social/@Gargron",
  "author_avatar": "https://files.mastodon.social/accounts/avatars/000/000/001/original/6b2384b33799a0dd.png",
  "author_followers": 381405,
  "author_verified": true,
  "published_at": "2026-11-15T15:58:55.527Z",
  "published_at_unix": null,
  "modified_at": null,
  "date_source": "mastodon_api",
  "likes": 251,
  "comments_count": 2,
  "shares": null,
  "views": null,
  "reposts": 59,
  "saves": null
}

The call in curl, JavaScript and Python

curl

curl -X POST "https://api.foxapis.com/v1/social/mastodon/post" \
  -H "Authorization: Bearer $FOXAPIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://mastodon.social/@Gargron/117621282276303009"}'

JavaScript

const res = await fetch("https://api.foxapis.com/v1/social/mastodon/post", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.FOXAPIS_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({"url":"https://mastodon.social/@Gargron/117621282276303009"}),
});
if (!res.ok) throw new Error("HTTP " + res.status);
console.log(await res.json());

Python

import os, requests

res = requests.post(
    "https://api.foxapis.com/v1/social/mastodon/post",
    headers={"Authorization": "Bearer " + os.environ["FOXAPIS_KEY"]},
    json={"url":"https://mastodon.social/@Gargron/117621282276303009"},
    timeout=60,
)
res.raise_for_status()
print(res.json())

Questions people ask about the mastodon api

What is the Mastodon API rate limit?

The software's documented default is 300 calls within 5 minutes, listed both per account and per IP address. Response headers report the limit that applies to you on a given server.

Do I need a Mastodon API token?

Not for this endpoint: you send your FoxAPIs key and the post address. Native calls that act for an account need a token from that server.

Which servers work?

You give the full address of a public post. A server that is down, blocks the request or has removed the post cannot be read, and an answer with no data is not charged.

Can I search posts by keyword?

No. This endpoint reads one post that you already have the address of.

Related

Mastodon is a name of its owner. FoxAPIs is not affiliated with or endorsed by Mastodon. You are responsible for using the data within the source's terms.

For changes to the software behind these posts, see the Mastodon changelog, release by release.

Run this free, then pay per call

Start with 10,000 credits, no card. They arrive once you confirm your email and expire 90 days after they are added; credits you buy never expire. Start with 10,000 credits

1 credit a call: $0.80 per 1,000 calls on Production, $0.98 on Builder.

Run this freeBuy credits

Building an AI agent? See the MCP server