How to list the accounts an X account follows
Get a paginated list of the public accounts an X username follows, with profile stats and a cursor for the next page
On this page
You have three public X handles on a partnerships shortlist and need the accounts each one follows before you decide who to contact. Pull the first page for each handle, read the profile stats on the returned accounts, and follow the cursor deeper only where the first page earns it
The deliverable is one table with a row per followed account. No run has been executed for this guide, so the table below is a design. Values here are placeholders showing the shape
The worksheet you are filling
A wide sheet beats a terminal here, because a single record carries eleven columns and the bio text wraps. Note the source handle on each row so the three lists stay separable
| source | username | name | bio | followers | following | posts | location | avatarUrl | createdUtc | id |
|---|---|---|---|---|---|---|---|---|---|---|
| (handle) | (handle) | (display name) | (text) | 0 | 0 | 0 | (text or empty) | (url) | 0 | (id string) |
Example handles below
| source |
|---|
| openai |
| example_brand |
| example_shop |
What the tool takes
anyapi.twitter.following runs on POST /v1/runs with toolId anyapi.twitter.following. The one required field is username, the public X handle without the @ prefix. cursor is optional and opaque: omit it for the first page, then pass a previous response's nextCursor to continue exactly where that response ended
limit is optional too, default 200, minimum 1, maximum 100000, and it does not do what the name suggests. The contract says it is accepted but does not change the page: each call returns one full native page of followed accounts, about 50, never trimmed. Set it to 200 and you still get roughly 50 rows. A bigger number buys nothing; nextCursor is the only way forward
requireFields is optional. Name location in it and the request is served only by a source that returns that field, which 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. 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. Naming a combination that no single source returns together is refused as invalid input, with no charge
Reading the output fields
found is the first thing to check. When it is false, reason says not_found: the source states the target does not exist, or returned nothing for it. That is a successful call, not an error, and costUsd is what it actually cost. Log the row and move on to the next handle
When found is true, data.items holds the followed-account records and data.nextCursor holds a cursor string or null. Null means no further page, so you can stop the walk for that handle
Six fields are required on each record: username, name, bio, followers, following and avatarUrl. posts, location, createdUtc and id are described as populated when the provider has data, so treat those four as optional and expect empty cells. createdUtc is a UTC epoch timestamp in seconds; multiply by 1000 for a JS Date in milliseconds
The counts are what move a row into outreach. A followed account whose following count is low and whose followers count is high is a different kind of contact from one that follows thousands back. Pair followers with bio and location when you set the priority column, and keep id as the stable key, since handles change
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list the accounts
that each of the three public X handles below follows. Check the current
inputs and price of anyapi.twitter.following before running anything.
Call it once per handle with username set, without the @ prefix, and
cursor omitted for the first page. Do not pass a limit expecting more
rows; each call returns one native page of about 50 accounts. Read
data.nextCursor from each response and report it, but do not chase
further pages unless I ask. Return a table with the columns source,
username, name, bio, followers, following, posts, location, avatarUrl,
createdUtc and id. If a handle returns found false with reason
not_found, keep the row with an empty table body and say so. Do not
invent accounts.
openai
example_brand
example_shopSwap the three example handles for yours before the run, and keep the first pass to one page each. Three pages of about 50 rows is enough to compare the lists and see whether a second page is worth the calls
Estimated tool cost
Prices from the Purrkey catalog, read on November 13, 2026, price revision anyapi-catalog-2026-11-05. The unit is max_call, which the catalog defines as "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings, not settled charges
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| Single page lookup | calls x max price | $0.0036 per call | 1 | $0.0036 |
| First page, three handles | calls x max price | $0.0036 per call | 3 | $0.0108 |
| Two pages per handle | calls x max price | $0.0036 per call | 6 | $0.0216 |
The six call scenario assumes two pages each, which is about 100 followed accounts per handle before the cursor runs out or you stop. Model fees for the agent are not counted
Next step
Open https://purrkey.app/tools/twitter?q=following, copy the three handles you are vetting into the prompt above, and run the first page for each one. For the reverse direction, the follower side of the same account is covered in the guide to exporting an account's followers list
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).FAQ
How do I list the accounts an X username follows?
Call anyapi.twitter.following with the username, without the @ prefix, to get one native page of followed accounts. Each record carries the handle, display name, bio, follower and following counts and an avatar URL, and the response's nextCursor takes you to the next page.
What inputs does anyapi.twitter.following take?
username is required and is the public X handle without the @ prefix. cursor, limit and requireFields are optional, and handle is accepted as an alias for username.
Why does a higher limit not return more followed accounts?
The limit input is accepted but does not change the page. Each call returns one full native page of followed accounts, about 50, never trimmed, so nextCursor is the way to get more.
How do I get the next page of a following list?
Take the nextCursor value from a response and pass it back as cursor. A null nextCursor means there is no next page.
What does found false mean for a following lookup?
It means reason is 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.
Does naming location in requireFields change the price?
It can. When the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A combination that no single source returns together is refused as invalid input, with no charge.
How much does it cost to pull following lists for three X accounts?
At the catalog ceiling of $0.0036 per call, one page for each of three handles is at most $0.0108. Two pages per handle is six calls, at most $0.0216.
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.