---
title: "Get user by username"
method: GET
path: "/v1/twitter/users/{username}/by_username"
tags: ["Users"]
---

# Get user by username

`GET /v1/twitter/users/{username}/by_username`

## Request

- Base URL: `https://scrapebadger.com`
- URL: `https://scrapebadger.com/v1/twitter/users/{username}/by_username`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/scrapebadger/apis/scrapebadger-account-api/docs/v1/twitter/users/:username/by_username/get.ts> (a function with typed inputs; its response is checked against the schema)

Get a user profile by their username (screen name). Returns comprehensive profile data including bio, follower/following counts, verification status, and account metadata. The most common way to look up a user profile.

## Path parameters

- `username` string, required

## Response `200`

Successfully retrieved user profile.

- UserData: Comprehensive user profile data including bio, metrics, verification status, and account metadata.
  - `id` string, required: Unique numeric user identifier.
  - `username` string, required: The user's screen name (handle).
  - `name` string, required: The user's display name.
  - `description` string, nullable: The user's bio/description.
  - `location` string, nullable: The user's self-reported location.
  - `url` string, nullable: URL in the user's profile.
  - `profile_image_url` string, nullable: URL of the user's profile image.
  - `profile_banner_url` string, nullable: URL of the user's profile banner.
  - `followers_count` integer: Number of followers.
  - `following_count` integer: Number of accounts this user follows.
  - `tweet_count` integer: Total number of tweets posted.
  - `listed_count` integer: Number of lists this user appears on.
  - `favourites_count` integer, nullable: Number of tweets this user has liked.
  - `media_count` integer, nullable: Number of media items posted.
  - `verified` boolean: Whether the user is verified (legacy verification).
  - `verified_type` string, nullable: Type of verification (e.g., Government, Business).
  - `is_blue_verified` boolean, nullable: Whether the user has a Twitter Blue/Premium subscription.
  - `created_at` string, required: Account creation timestamp.
  - `created_at_datetime` string, nullable: Account creation date in ISO 8601 format.
  - `protected` boolean, nullable: Whether the user's tweets are protected (private).
  - `possibly_sensitive` boolean, nullable: Whether the user's content may be sensitive.
  - `followed_by` boolean, nullable: Whether this user follows the authenticated user.
  - `following` boolean, nullable: Whether the authenticated user follows this user.
  - `can_dm` boolean, nullable: Whether the authenticated user can send a DM to this user.
  - `professional_type` string, nullable: Professional account type, if applicable.
  - `pinned_tweet_ids` string[], nullable: IDs of the user's pinned tweets.

## Other responses

- `401`: Authentication failed. The API key is missing, invalid, or expired.
- `402`: Insufficient credits. Your account balance has been exhausted. Purchase more credits at https://scrapebadger.com/dashboard/billing.
- `429`: Rate limit exceeded. Too many requests in a given time period. Implement exponential backoff and retry.

---

[API](https://skmtc.dev/scrapebadger/apis/scrapebadger-account-api.md) - [All operations](https://skmtc.dev/scrapebadger/apis/scrapebadger-account-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scrapebadger/apis/scrapebadger-account-api/revisions/4a1ef8777baf?raw)
