Users

User by username

Profile of one account by handle, including its numeric user ID.

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

get/user/by/username/{username}

Request

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

Path parameters

usernamestring required

Handle, with or without a leading @. 2 to 15 characters: letters, digits and underscore.

Query parameters

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 UserByScreenName query (data.user.result, with rest_id and legacy profile fields). When X returns no user, the API answers 200 with {"data": {}, "userExists": false}.

With format=simple: {data: User}, or {data: null} when the handle does not exist.

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.