Social networks
Mastodon API
Retrieve public Mastodon profiles, posts, replies, boosts and favourites, followers, hashtags, search, trends and server details.
Ten authenticated endpoints read Mastodon’s public API on 28 major servers and reach accounts on any other server through mastodon.social’s federated view.
API availability: Available
http://localhost:3044Public API: https://api.scrapeatlas.com.Endpoints
/v1/mastodon/profileGet a Mastodon profile
Retrieve a public Mastodon account by address or profile URL: names, bio, images, profile fields, verified links, follower/following/post counts and account flags.
Reference/v1/mastodon/user/postsGet a Mastodon user’s posts
Retrieve up to 40 public posts and boosts from an account, newest first. Filter to original posts, posts without replies, media posts or pinned posts, and page with the returned cursor.
Reference/v1/mastodon/user/connectionsGet Mastodon followers or following
Retrieve up to 80 accounts that follow, or are followed by, a public Mastodon account, with each account’s profile and counters. Page with the returned cursor.
Reference/v1/mastodon/postGet a Mastodon post
Retrieve one public Mastodon post from its URL with content, media, link preview, poll, hashtags, mentions and reply/boost/favourite/quote counts. The author and ID must match the URL.
Reference/v1/mastodon/post/repliesGet Mastodon post replies
Retrieve the conversation around a public Mastodon post: the posts it replies to and up to 60 replies. Rebuild the reply tree from in_reply_to_id.
Reference/v1/mastodon/post/interactionsGet Mastodon post boosts or favourites
Retrieve up to 80 accounts that boosted or favourited a public Mastodon post, with each account’s profile and counters. Page with the returned cursor.
Reference/v1/mastodon/hashtagGet Mastodon hashtag posts
Retrieve up to 40 recent public posts with a hashtag as a Mastodon server sees them, newest first. The first page adds daily usage for the last seven days.
Reference/v1/mastodon/searchSearch Mastodon accounts and hashtags
Search a Mastodon server for accounts or hashtags. Returns up to 40 accounts with profiles and counters, or up to 40 hashtags with daily usage.
Reference/v1/mastodon/trendsGet Mastodon trends
Retrieve what is trending on a Mastodon server: up to 40 posts, 20 hashtags with daily usage, or 20 news links with share history. Page with the returned cursor.
Reference/v1/mastodon/serverGet a Mastodon server
Retrieve a Mastodon server’s public details: title, description, version, monthly active users, languages, rules, registration settings and contact, plus up to 12 weeks of post, login and sign-up counts.
ReferenceQuick start
Create an API key on your account page, then call the public API. Values below are placeholders.
curl "https://api.scrapeatlas.com/v1/mastodon/profile?handle=example%40mastodon.social" \
-H "x-api-key: YOUR_API_KEY"Coverage & limits
- Independent, stateless worker: eight concurrent operations with a queue of 32 waiting up to 8 seconds; 20-second total deadline including the queue; at most four upstream HTTP requests per operation.
- Fixed HTTPS origins: the 28 supported Mastodon servers. Caller input becomes a validated path or query value, never a destination. No login, cookies, browser, outbound link visits, media downloads or result storage.
- Each upstream request is retried at most once, on a network failure, 5xx, broken body or 429; a 429 retry uses a different network identity when one is configured.
- The worker reads each server’s published rate-limit headers and rests its direct address on a server whose window is nearly spent; with no other identity configured, those requests fail as upstream_rate_limited without contacting the server.
- At most 4 MiB decoded JSON per operation, depth 32 and 100,000 parsed nodes. Page sizes: 40 posts, 80 accounts, 40 search results, 40 trending posts, 20 trending hashtags or links, 40 ancestors and 60 replies.
- Posts embed the author’s identity only; follower, following and post counts are returned by profile, connections, interactions and search records. A boost is returned as a thin entry around the boosted post.
- A bounded in-process map of account address to account ID (5,000 entries, 6-hour lifetime) saves the lookup request on repeat reads; a miss performs the lookup.
| HTTP | failure.code | Meaning |
|---|---|---|
| 200 | partial | Usable data with federated_view, counters_hidden, reply_limit, ancestor_limit, activity_unavailable or unsupported_*_omitted warnings. |
| 400 | invalid_request | Missing, duplicate, unsafe or unsupported parameters, a post URL outside the supported servers or an invalid cursor. |
| 401 | unauthorized | Missing or invalid worker API key. |
| 403 | restricted_page | The server does not share this data without login, or the account hides its followers and following. |
| 404 | not_found | Unknown or removed account, post or hashtag. |
| 429 | upstream_rate_limited | The server’s rate limit is exhausted for every available network identity. |
| 502 | upstream_challenged | The server answered with a challenge or non-JSON page. |
| 502 | unsupported_page | Malformed, mismatched or looping source data. |
| 502 | response_too_large payload_too_complex | Response exceeded byte or parsing limits. |
| 502 | unsafe_redirect request_limit upstream_error | Bounded source retrieval could not complete. |
| 503 | busy | All worker slots and queue places are occupied. |
| 504 | timeout | Total request deadline expired. |