Unif API Docs

Get X users by usernames

Batch-resolve up to 100 X accounts from a comma-separated list of @handles in a single call, returning one profile object per username. Useful for converting a list of handles into user IDs and profile data in one request.

Pricing — $ · min $0.001

Billed per record at 1 credit ($0.001) each, with a 1-credit ($0.001) minimum per call.

GET
/x/users/by

Authorization

bearerAuth
AuthorizationBearer <token>

UnifAPI API key. Provider credentials are managed by UnifAPI.

In: header

Query Parameters

expansions?string
tweet.fields?string
user.fields?string
media.fields?string
place.fields?string
poll.fields?string
usernames*string

Comma-separated usernames.

Header Parameters

Unifapi-Version?string

Pin the API version an integration was built against (date-based, e.g. 2026-07-01). Omit to use the current version. Public URL paths stay stable and unversioned; breaking changes ship under a new dated version and are announced with Deprecation and Sunset response headers. The served version is echoed in every response's Unifapi-Version header. Policy: https://unifapi.com/versioning.md

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/x/users/by?usernames=string"
{  "request_id": "string",  "data": [    {      "id": "string",      "name": "string",      "username": "string",      "created_at": "string",      "description": "string",      "location": "string",      "url": "string",      "profile_image_url": "string",      "profile_banner_url": "string",      "protected": true,      "verified": true,      "verified_type": "string",      "pinned_tweet_id": "string",      "public_metrics": {        "followers_count": 0,        "following_count": 0,        "tweet_count": 0,        "listed_count": 0,        "like_count": 0,        "retweet_count": 0,        "reply_count": 0,        "quote_count": 0,        "bookmark_count": 0,        "impression_count": 0      }    }  ],  "billing": {    "credits_charged": 0,    "records_charged": 0,    "balance_remaining": 0,    "truncated_due_to_balance": true  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}
{  "error": {    "type": "validation_error",    "message": "string",    "request_id": "string",    "issues": [      null    ],    "billing": {      "credits_required": 0,      "credits_charged": 0,      "records_charged": 0,      "balance_remaining": 0,      "truncated_due_to_balance": true    }  }}