Social media5 min readBy Purrkey teamUpdated

How to search X (Twitter) accounts by keyword

Search X (Twitter) accounts by keyword, read the normalized profile records with follower, following and post counts, then walk the cursor to fill a shortlist table

On this page

You need 40 X accounts that match the keyword ai agents, with follower, following, post and verification data on each one, and a way to cut the list to 10 accounts to invite to a private beta. anyapi.twitter.search_users is the People tab of X search: it matches handles, display names and profile bios, and returns account records rather than posts

The deliverable is a worksheet with one row per account plus a shortlist rank you add yourself. No run has been executed for this guide, so the rows below are a design, not a result

Design the shortlist table

Nine columns come from the tool and one is yours

ColumnWhere it comes from
usernamethe @ handle, without the @ prefix
namedisplay name
bioprofile bio, may be empty
followersfollower count
followingaccounts this account follows
postspost count
verifiedblue verification check, true or false
locationself-reported, may be empty or null
profileUrlcanonical X profile URL
shortlist rankadded by you after the numbers arrive

Example rows. Values here are placeholders showing the shape, and the handles are invented

usernamefollowersfollowingpostsverifiedlocationshortlist rank
example_handle_one1234210480false(empty)1
example_handle_two8400952100true(null)2

Rank after you compare counts and read bio for fit. Two accounts with the same follower count look different when one has 400 posts and the other has 20,000

The input the tool takes

The contract documents three properties on this call. query is required and takes a topic such as ai agents, a name, or a handle; handles, display names and bios are the text it matches against

cursor is optional. Omit it on the first call and pass the nextCursor string from a previous response to fetch the next page of accounts

requireFields is optional and takes an array drawn from canDm, listedCount and location. Reach for it only when the table needs one of those three fields. Naming a field routes the request to a source that returns it, and when the cheapest source cannot, a dearer source serves at its quoted price

A combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk, requireFields applies to the first page only; later pages stay with the source that page chose, at the price it was quoted. Decide about location before the first call rather than on page three

Example values, invented:

FieldExample value
queryopen source maintainers
requireFields["location"]

Read the output fields that fill the table

found is the first field to check. True means at least one account matched. False means nothing matched and data is null

Inside data, users holds the page of profile records and nextCursor holds the pointer to the next page, or null when this lane has no more accounts. Pass that string back as cursor

The ranking numbers sit at the top level of each user record. followers, following and posts are integers, verified is a boolean, and location is a string that may be empty, plus null when the serving source does not return locations. canDm and listedCount behave the same way when you name them. createdUtc is a UTC epoch timestamp in seconds, so multiply by 1000 for a JS Date

A found: false answer is a successful call, not an error, and it is settled at the actual AnyAPI charge. Do not retry it as though the request had failed. Check query for a typo, then move to the next keyword

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search X
(Twitter) accounts by keyword and return a table with username, name,
bio, followers, following, posts, verified, location and profileUrl.
Check the current inputs and price of anyapi.twitter.search_users
before running anything. Call it once for the first page, then pass the
nextCursor value from each response back as cursor until nextCursor is
null or the table holds 40 rows. Leave location empty when the field is
empty or null. Do not invent accounts.

Example keyword: open source maintainers

Swap the example keyword for yours, such as ai agents

Estimated tool cost

Prices from the Purrkey catalog, read November 13, 2026, revision anyapi-catalog-2026-11-05. The unit is max_call: "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings. Agents call it through POST /v1/runs with toolId anyapi.twitter.search_users

StepFormulaUnit pricePlanned quantityTotal
First page1 call x max price$0.0021 per call1$0.0021
Four-page walk4 calls x max price$0.0021 per call4$0.0084

The $0.0021 figure is the cheapest source. A named field the cheapest source cannot return sends the request to a dearer source, which is quoted and charged at its own price. Model fees for the agent are not counted here

Run one page before the walk

Call the tool with the example keyword once and read found and nextCursor before you plan a longer walk. The tool page is https://purrkey.app/tools/twitter?q=search_users

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with X (Twitter).
Explore X (Twitter) tools and pricing

FAQ

How do I search X accounts by keyword?

Call anyapi.twitter.search_users with a query. It matches handles, display names and profile bios and returns account records rather than posts. Use twitter.search for posts.

What inputs does anyapi.twitter.search_users take?

The contract documents query, which is required, cursor, which is optional and comes from a previous response's nextCursor, and requireFields, which is optional and takes canDm, listedCount or location.

Does a search that finds no accounts still cost anything?

Yes. A found: false result is a successful call, not an error, and it is settled at the actual AnyAPI charge.

How do I get more accounts after the first page?

Pass the nextCursor string from the response as cursor. A null nextCursor means this lane has no more accounts.

How much does a four-page walk of X account search cost?

At most $0.0084 at the listed $0.0021 per call for four calls. Naming a field in requireFields that the cheapest source cannot return can move the quote to a dearer source.

When should I use requireFields?

Only when the table needs canDm, listedCount or location. It applies to the first page of a paginated walk, and a combination no single source returns together is refused as invalid input, with no charge.

Which output fields drive the shortlist?

followers, following and posts are counts, verified is a boolean, and location is null when the serving source does not return locations. The shortlist rank is added by you, not returned by the tool.

Next step

Try this with X (Twitter)

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See X (Twitter) tools

Share this article