Get a public profile by username
GET /users/by-username/{username}
Returns a person’s public profile by username, for public profile pages.
Visitors who aren’t signed in can call this when public mode is on; with it off they get 401. Signed-in callers always can. The username is matched exactly, including case; an unknown one gets 404, and one that can’t be decoded from the path gets a plain-text 400.
For visitors who aren’t signed in, the full name is left out and the display name skips it, and a profile whose owner hid it from visitors gets the same 404 as an unknown username. Signed-in callers get the full name where there is one and also see hidden profiles. Everything else is the same for everyone, including the bio, location, links, language and theme preferences and the post count, and accounts are returned whatever their status.
The profile is read fresh each time. The person’s work is listed by the asset, post and collection endpoints, not here. Server errors get a plain-text 500.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The account’s username, matched exactly, including case. The length limit shown isn’t checked.
Responses
Section titled “ Responses ”The profile.
A person’s profile. Which names are included depends on whether
you’re signed in; see display_name and fullname.
object
The account’s username; an empty string if it has none.
The account’s full name. Sent only to signed-in callers, and only when it isn’t empty; profile edits don’t change it.
The name to show, never empty: the profile’s display name, then the
account’s full name, then the username, and as a last resort user
followed by the account number. For readers who aren’t signed in,
the full name is skipped.
An empty string when none is set.
The stored picture address; the server doesn’t upload, fetch or check it. Left out when unset; clearing it through this API returns an empty string.
An empty string when none is set.
The website address as saved; its format isn’t checked. Left out when unset; clearing it through this API returns an empty string.
Platform names mapped to handles or links stored in the profile; nothing is checked. Left out when there are none.
object
The owner’s language preference as saved, meant to be a tag such as
en or es-AR; the server doesn’t check it. Left out when not set.
The owner’s theme preference: light, dark or system, which
follows each device’s setting. Left out when not set.
When the account was created.
How many published posts the person has that aren’t deleted. Every one counts, including posts you can’t open, so it can be higher than what you can see.
The server a copied profile came from. Left out for this server’s own users; nothing in the API creates copies.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Resource not found
object
Human-readable error summary
Example
the request could not be completed