Search X accounts

POST /v1/x/users/search

Finds accounts by name, username, or bio, ranked by X's people search. Use it to turn a person or brand name into a username before calling the other account endpoints. Paginate with meta.nextCursor. Billed per account returned.

Price: 1 credit per call, plus 1 credit per X user result returned. Failed and refused calls cost nothing.

Rate limit: Counts as 2 requests against your per-minute rate limit.

MCP tool: search_x_users, on every MCP connection.

Requires an API key, sent as Authorization: Bearer <key>.

Request

curl --request POST \
  --url https://api.weirapp.io/v1/x/users/search \
  --header "Authorization: Bearer $WEIR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"query":"payment failures"}'

Body

Field Type Required Notes
query string yes Free text matched against names, usernames, and bios, as X's people search does. · 1–100 chars
limit integer no Most accounts to return. X may return fewer. · 1–20, default 20
cursor string no Opaque cursor from the previous page's meta.nextCursor. Pass it back unchanged, with the same path and query parameters; a cursor from another request is rejected with 400. · 1–4096 chars

Response

Matching accounts.

200

Field Type Required Notes
data array of object yes
data[].id string yes
data[].username string yes Handle without the @ prefix.
data[].name string yes Display name.
data[].description string or null yes
data[].url string yes
data[].profileImageUrl string or null yes
data[].profileBannerUrl string or null yes
data[].location string or null yes
data[].verified boolean yes
data[].followersCount integer yes min 0
data[].followingCount integer yes min 0
data[].statusesCount integer yes Posts published. · min 0
data[].likeCount integer yes min 0
data[].createdAt string (date-time) yes
data[].pinnedPostIds array of string yes Ids of the posts pinned to the top of the profile, usually zero or one.
data[].protected boolean yes True when only approved followers can see this account's posts. Its posts, replies, media, and relationship lists are then not available through this API.
meta object yes
meta.requestId string yes
meta.nextCursor string or null no

Errors

Status Meaning What to do
400 The request failed validation. The request was malformed. The details object names the field.
401 The API key is missing, malformed, expired, or revoked. The key is missing, malformed, revoked, or expired.
402 The account is out of credit. Not retryable: this cannot clear until the billing period resets or the plan changes. Out of credits. Never retry. Only a person can clear it, by adding credits at https://weirapp.io/dashboard/billing. Retrying never will.
403 The API key does not carry the scope this route requires. The key is valid but lacks the scope this operation needs.
404 The requested resource does not exist. No such resource, or it is not public.
429 The per-minute rate limit is exhausted. Retryable: wait for Retry-After and try again. Rate limited. Retryable: wait for Retry-After, then try again.
500 An unexpected error occurred. Something failed on our side. Retryable with backoff.
503 The source is temporarily unavailable. The request is safe to retry. A source was unreachable. Retryable with backoff.

View this page as Markdown