Users

User by ID

Profile of one account by numeric user ID.

Reference: https://www.twittrapi.com/docs/reference/user-userid

get/user/{userId}

Request

  • Base URL: https://api.twittrapi.com
  • URL: https://api.twittrapi.com/user/{userId}
  • Auth: API key in header X-API-KEY

Path parameters

userIdstring required

Numeric user ID (digits only, up to 30). To pass a handle instead, use -1 here and set username.

Query parameters

usernamestring

Handle, with or without @. When set, it is used instead of userId: the API looks up the ID first, which makes the call a little slower. Still one billed call.

format'raw' | 'simple'

raw (default): X's JSON passed through. simple: flat camelCase JSON with a fixed schema and a {data, nextCursor, previousCursor, hasNextPage} envelope. Same price. The header X-Response-Format: simple does the same.

Response

Raw JSON of X's UserByRestId query (data.user.result).

With format=simple: {data: User}.

OR
RawPassthrough required

X's own JSON (raw format, the default), passed through unchanged. The shape is X's and can change; see https://www.twittrapi.com/docs/response-format.

Changes

No recorded changes to this operation across all 1 revision of this API.