Scraper APIMastodon
mastodon.profile
A Mastodon account's profile on its own server: names, bio, profile fields, pictures, follower, following and post counts.
- Id
mastodon.profile- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/mastodon.profile/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
accountrequired | string | The account as @user@server, e.g. @Mastodon@mastodon.social, or its profile address (https://mastodon.social/@Mastodon).Limit: at most 400 characters. |
Record fields
Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.
| Field | Type | Notes |
|---|---|---|
id | string | The account's id on its server. |
username | string or null | The username, without the server. |
acct | string | The account's full address, user@server. |
url | string or null | The profile's address on the web. |
display_name | string or null | The display name. |
bio | string or null | The profile's bio text, links written out; null when there is none. |
fields | array of object | The label and value pairs the profile shows under the bio. |
name (in fields[]) | string | The label of a profile field, e.g. Website. |
value (in fields[]) | string or null | Its text, links written out. |
verified (in fields[]) | boolean | True when the server checked that the linked page links back to the profile.Default: false. |
avatar_url | string or null | The profile picture. |
header_url | string or null | The header image; null when there is none. |
follower_count | integer or null | Number of followers; null when the account hides it. |
following_count | integer or null | Number of accounts this one follows; null when the account hides it. |
post_count | integer or null | Number of posts the account has published. |
created_at | string (date-time) or null | When the account was created, in UTC (Mastodon gives the day). |
last_post_on | string (date-time) or null | The day of the account's last post, in UTC. |
bot | boolean or null | True when the account says it is automated. |
group | boolean or null | True when the account is a group. |
locked | boolean or null | True when the account approves its followers by hand. |
discoverable | boolean or null | True when the owner lets the server feature the account in its directory. |
indexable | boolean or null | True when the owner lets the account's public posts be found by full-text search. |
noindex | boolean or null | True when the owner asked search engines not to index the profile. |
moved_to | string or null | The account it moved to, as user@server, when it has moved. |
fetched_at | string (date-time) | When the answer was read, in UTC. |
Example request
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/mastodon.profile/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"account":"@Mastodon@mastodon.social"}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("mastodon.profile", {
"account": "@Mastodon@mastodon.social",
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("mastodon.profile", {
account: "@Mastodon@mastodon.social",
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "mastodon.profile", map[string]any{"account": "@Mastodon@mastodon.social"})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("mastodon.profile", Map.of("account", "@Mastodon@mastodon.social"));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run mastodon.profile --input account=@Mastodon@mastodon.socialInstall it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"input": {
"account": "@Mastodon@mastodon.social"
}
}Example response
The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "mastodon.profile",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"account": "@Mastodon@mastodon.social"
},
"record_count": 1,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.
{
"records": [
{
"id": "13179",
"username": "Mastodon",
"acct": "Mastodon@mastodon.social",
"url": "https://mastodon.social/@Mastodon",
"display_name": "Mastodon",
"bio": "Our mission is to connect the world through thriving online communities.\nThis is the primary account for the Mastodon project.\nFor technical software updates, follow @MastodonEngineering\nFor news and updates on the Mastodon servers that we … [truncated]",
"fields": [
{
"name": "Homepage",
"value": "https://joinmastodon.org",
"verified": true
},
{
"name": "Source Code",
"value": "https://github.com/mastodon",
"verified": true
}
],
"avatar_url": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png",
"header_url": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png",
"follower_count": 878842,
"following_count": 51,
"post_count": 568,
"created_at": "2016-11-23T00:00:00Z",
"last_post_on": "2026-11-16T00:00:00Z",
"bot": false,
"group": false,
"locked": false,
"discoverable": true,
"indexable": true,
"noindex": false,
"moved_to": null,
"fetched_at": "2026-11-19T18:07:40.973228Z"
}
],
"next_cursor": null
}What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].
- Shortened:
bio: 279 characters, the first 239 shown. - Shortened:
fields: 4 items, the first 2 shown.
A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Mastodon scrapers are in their own section there.