X / Twitter API

X / Twitter Search users API

Search X (Twitter) accounts by keyword - the People tab of X search. Matches handles, display names, and profile bios, and returns normalized profile records with follower, following, and post counts plus cursor pagination. Use twitter.search for posts.

$0.49/1k req, pay per request, no subscription.

ai agents / X
x.com/search?q=ai%20agents&src=typed_query&f=user

ai agents

TopLatestPeopleMediaLists
M

Marcus Feld | AI Agents

@marcus_builds_ai

Building autonomous AI agents for support and sales. Ex-Stripe. Writing about agent orchestration weekly.

48.2K Followers

Follow
What the API returnedusers[0]
{
"id": "1893004471820193024",
"username": "marcus_builds_ai",
"name": "Marcus Feld | AI Agents",
"profileUrl": "https://x.com/marcus_builds_ai",
"bio": "Building autonomous AI agents for support and sales. Ex-Stripe. Writing about agent orchestration weekly.",
"followers": 48200,
"following": 612,
"posts": 3840,
... 7 more fields
}
Uptime
98.37%
30d · 113,624 calls
Requests
114,980
30d · weekly, last 12 wks
Response
1.2s
median · 30d

Pricing and providers

X / Twitter Search users API pricing: one API, 3 interchangeable providers

The cheapest provider serves first. If it fails, the next one takes over in the same call.

You pay
$4.90
$0.49/1k req, only for what you use. No monthly plan.
Your first 204 requests are free with the $0.10 starting balance.

Try it

Get X / Twitter search users in one request

requireFieldsarray
Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `location`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a profile that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted.
Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.

This sample shows 19 of 20 fields. See every field

{
  "found": true,
  "data": {
    "users": [
      {
        "id": "1893004471820193024",
        "username": "marcus_builds_ai",
        "name": "Marcus Feld | AI Agents",
        "profileUrl": "https://x.com/marcus_builds_ai",
        "bio": "Building autonomous AI agents for support and sales. Ex-Stripe. Writing about agent orchestration weekly.",
        "followers": 48200,
        "following": 612,
        "posts": 3840,
        "verified": true,
        "location": "Austin, TX",
        "avatarUrl": "https://pbs.twimg.com/profile_images/1893004471820193024/marcus_400x400.jpg",
        "createdUtc": 1517443200,
        "coverUrl": "https://pbs.twimg.com/profile_banners/1893004471820193024/1700000000",
        "listedCount": 214,
        "canDm": true
      },
      {
        "id": "1560093221004840960",
        "username": "agentstacknews",
        "name": "Agent Stack",
        "profileUrl": "https://x.com/agentstacknews",
        "bio": "Daily news on AI agents, tool use, and multi-agent frameworks.",
        "followers": 22900,
        "following": 88,
        "posts": 9120,
        "verified": false,
        "location": "",
        "avatarUrl": "https://pbs.twimg.com/profile_images/1560093221004840960/stack_400x400.jpg",
        "createdUtc": 1651363200,
        "listedCount": 61,
        "canDm": false
      },
      {
        "id": "1401882093771280384",
        "username": "priya_agentlabs",
        "name": "Priya Raman",
        "profileUrl": "https://x.com/priya_agentlabs",
        "bio": "Founder @AgentLabsHQ. Previously ML eng at a11y startup. She/her.",
        "followers": 15300,
        "following": 940,
        "posts": 2205,
        "verified": true,
        "location": "San Francisco, CA",
        "avatarUrl": "https://pbs.twimg.com/profile_images/1401882093771280384/priya_400x400.jpg",
        "createdUtc": 1622505600,
        "coverUrl": "https://pbs.twimg.com/profile_banners/1401882093771280384/1690000000",
        "listedCount": 47,
        "canDm": true
      }
    ],
    "nextCursor": "DAABCgABGZ3xw5A2xVIKAAIY__users_page2"
  }
}

Full parameter and response reference - every field, type, and example for this endpoint.

Reference

One request, one response shape.

Every field you send and every field you get back, each with a real example.

Last verified 2026-11-20 · uptime and latency measured over 30d

Request body

JSON, posted to this endpoint.

  • querystring

    ai agents

    Keyword to match against X (Twitter) handles, display names, and profile bios. This is the People tab of X search: pass a topic ('ai agents'), a name ('Elon Musk'), or a handle ('openai') and get back accounts, not posts. Use twitter.search for posts.

  • cursorstring

    Opaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of accounts.

  • requireFieldsarray

    Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `location`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a profile that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted.

You send. A small JSON body. The values shown are examples to replace with your own.

Response

JSON, one example value per field.

datadata

The page of matching accounts, or null when nothing was found.

  • nextCursorstring

    DAABCgABGZ3xw5A2xVIKAAIY__users_page2

    Opaque cursor for the next page of accounts, or null when this lane has no more. Pass it back as cursor to continue.

each userdata.users[]

Matching X (Twitter) accounts, normalized to a compact profile record. Populated whenever the provider has data for the entity.

  • avatarUrlstring

    https://pbs.twimg.com/profile_images/1893004471820193024/marcus_400x400.jpg

    URL of the account's profile image. Populated whenever the provider has data for the entity.

  • biostring

    Building autonomous AI agents for support and sales. Ex-Stripe. Writing about agent orchestration weekly.

    The account's profile bio/description (may be empty).

  • canDmbooleancan require

    true

    Whether the account accepts direct messages; null when the serving source does not return it. Name it in requireFields to be served by a source that does.

  • coverUrlstring

    https://pbs.twimg.com/profile_banners/1893004471820193024/1700000000

    Profile banner image URL of the account.

  • createdUtcnumber

    1517443200

    UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.

  • followersinteger

    48200

    How many followers this account has.

  • followinginteger

    612

    How many accounts this account follows.

  • idstring

    1893004471820193024

    The account's numeric X user id. Populated whenever the provider has data for the entity.

  • listedCountintegercan require

    214

    Number of public lists the account appears on; null when the serving source does not return it. Name it in requireFields to be served by a source that does.

  • locationstringcan require

    Austin, TX

    The account's self-reported location (may be empty); null when the serving source does not return locations. Name it in requireFields to be served by a source that does.

  • namestring

    Marcus Feld | AI Agents

    The account's display name. Populated whenever the provider has data for the entity.

  • postsinteger

    3840

    How many posts this account has published.

  • profileUrlstring

    https://x.com/marcus_builds_ai

    Canonical URL of the account's X profile. Populated whenever the provider has data for the entity.

  • usernamestring

    marcus_builds_ai

    The account's @ handle, without the @ prefix. Populated whenever the provider has data for the entity.

  • verifiedboolean

    true

    Whether the account carries the blue verification check.

top level
  • foundboolean

    true

    True when the search returned at least one account; false when nothing matched.

  • reason"not_found"

    Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.

You get back. Named, typed fields in the same shape whichever source answers.

FAQ

About the X / Twitter Search users API

The AnyAPI X / Twitter Search users API returns X / Twitter search users data as normalized JSON from one POST call to /v1/run/twitter.search_users. Search X (Twitter) accounts by keyword - the People tab of X search. Matches handles, display names, and profile bios, and returns normalized profile records with follower, following, and post counts plus cursor pagination. Use twitter.search for posts. AnyAPI routes each request across 3 sources and falls back automatically when one fails. It costs from $0.49 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 98.4% of X / Twitter search users calls through AnyAPI succeeded, with a median response time of 1.2 seconds across 113,624 measured calls.

It costs from $0.49 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet and each call draws it down. Some failed wallet-funded requests incur processing charges that we pass through at cost, with no markup; the error response shows the amount charged.

Search X (Twitter) accounts by keyword - the People tab of X search. Matches handles, display names, and profile bios, and returns normalized profile records with follower, following, and post counts plus cursor pagination. Use twitter.search for posts. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.

Over the last 30 days, 98.4% of X / Twitter search users calls through AnyAPI succeeded, with a median response time of 1.2 seconds across 113,624 measured calls. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.

Yes. A new AnyAPI account starts with $0.10 of free balance and no card required, which covers 204 X / Twitter Search users calls at $0.00049 each.

AnyAPI asks the next of its 3 sources in the same request, cheapest first, so one source going down does not fail your call.

Send a POST request to https://api.getanyapi.com/v1/run/twitter.search_users with your AnyAPI key in an "Authorization: Bearer" header and the input as a JSON body. The same key and the same wallet work on every AnyAPI endpoint.

No. You add US dollars to one prepaid AnyAPI balance and each request draws it down. There is no monthly plan and no minimum, and the same balance pays for every AnyAPI endpoint.

Yes. Install @getanyapi/sdk from npm for TypeScript or getanyapi from pip for Python. Both call every AnyAPI endpoint with the same key, and any HTTP client works too.

Yes. An agent can connect to the AnyAPI MCP server at https://api.getanyapi.com/mcp, or create its own free-trial key with one unauthenticated POST to https://api.getanyapi.com/agent/signup and call this endpoint over HTTP.