Mastodon

Get Mastodon profiles by id

Get up to 40 Mastodon profiles by their ids.

GET/v1/mastodon/profiles/batch
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
2
hoststringrequiredquery

The Mastodon server to ask, e.g. `mastodon.social`. A server URL is also accepted. The server you name is the one that answers.

idsarrayrequiredquery

Comma-separated account ids on `host`, 1 to 40. Ids belong to that server.

Response fields
64

Endpoint-specific response payload.

datalookupStatus
string

`found`, `not_found`, `restricted` (login required or closed), `unsupported` (this server does not offer it) or `not_compatible` (the host is not a Mastodon-compatible server). See `reason`.

one of: found, not_found, restricted, unsupported, not_compatible

datahost
string

The server that was asked.

datasoftware
stringnullableoptional

Only on a `not_compatible` result (and always on the server endpoint): the software the host runs, from its NodeInfo, e.g. `misskey` or `lemmy`; null when it does not say. Absent otherwise.

Why `lookupStatus` is not `found`, or null when it is `found`.

datareasoncode
string

Machine-readable reason.

one of: login_required, closed_by_operator, hidden_by_owner, suspended, not_implemented, disabled_by_operator, not_a_mastodon_server, unsupported_server_software, host_not_found, post_not_visible

datareasonmessage
string

Plain-language explanation.

Accounts the server returned, in the order it returned them.

dataaccounts[]id
string

Account id on `host`.

dataaccounts[]host
string

The server this record came from.

dataaccounts[]handle
string

`user@host`, with the account's home server.

dataaccounts[]username
string

Username without the host.

dataaccounts[]url
stringnullable

Profile page.

dataaccounts[]actorUri
stringnullable

ActivityPub id, when the server shows it.

dataaccounts[]displayName
stringnullable

Display name.

dataaccounts[]bioHtml
stringnullable

Bio as sanitised HTML.

dataaccounts[]bio
stringnullable

Bio as plain text.

An avatar or header image.

dataaccounts[]avatarurl
stringnullable

Image URL on the server or its media store.

dataaccounts[]avatarstaticUrl
stringnullable

Still frame of an animated image.

dataaccounts[]avatardescription
stringnullable

Alt text.

An avatar or header image.

dataaccounts[]headerurl
stringnullable

Image URL on the server or its media store.

dataaccounts[]headerstaticUrl
stringnullable

Still frame of an animated image.

dataaccounts[]headerdescription
stringnullable

Alt text.

dataaccounts[]createdAt
stringnullable

Account creation, rounded to midnight UTC by the server.

dataaccounts[]lastPostDate
stringnullable

Date of the latest post (a date, not a time).

The server's own counters.

dataaccounts[]statsfollowers
integernullable

Accounts following this account.

dataaccounts[]statsfollowing
integernullable

Accounts this account follows.

dataaccounts[]statsposts
integernullable

Posts by this account.

dataaccounts[]isBot
boolean

True when the account is marked as a bot.

dataaccounts[]isGroup
boolean

True when the account is a group.

dataaccounts[]isLocked
boolean

Follow requests need approval. Public posts are still public.

dataaccounts[]isLimited
boolean

The server's moderators limited (silenced) the account.

dataaccounts[]isSuspended
boolean

True when the server suspended the account.

dataaccounts[]isDiscoverable
booleannullable

The owner's opt-in to the profile directory and recommendations. null on servers that do not report it.

dataaccounts[]isIndexable
booleannullable

The owner's opt-in to search engines indexing public posts. null when not reported.

dataaccounts[]noIndex
booleannullable

The owner asks search engines to skip the profile. null when not reported.

dataaccounts[]hidesNetwork
booleannullable

The owner hides the follower and following lists. null when not reported.

The account this one moved to.

dataaccounts[]movedToid
stringnullable

Account id on the server that returned it.

dataaccounts[]movedTohandle
string

`user@host` of the account this one moved to.

dataaccounts[]movedTourl
stringnullable

Profile page of the new account.

dataaccounts[]movedTodisplayName
stringnullable

Display name of the new account.

Profile metadata fields, in the owner's order.

dataaccounts[]fields[]name
string

Label.

dataaccounts[]fields[]valueHtml
string

Value as sanitised HTML.

dataaccounts[]fields[]value
string

Value as plain text.

dataaccounts[]fields[]verifiedAt
stringnullable

When a link in the value was verified with rel=me.

Custom emojis used in the display name or bio.

dataaccounts[]emojis[]shortcode
string

Shortcode without colons.

dataaccounts[]emojis[]url
stringnullable

Emoji image.

dataaccounts[]emojis[]staticUrl
stringnullable

Still frame.

Public badges such as Owner or Moderator.

dataaccounts[]roles[]id
stringnullable

Role id on `host`.

dataaccounts[]roles[]name
string

Role name, such as Owner or Moderator.

dataaccounts[]roles[]color
stringnullable

Badge colour as a hex value, when set.

Requested ids the server did not return.

datamissingIds[]
stringoptional

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/mastodon/profiles/batch?host=mastodon.social&ids=1" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Accounts from one server.