X Audience

Beta

Export the followers or following of any X (Twitter) account. The endpoint is cursor-paginated and metered per page — call it repeatedly, passing back the returned user_id and next_cursor, until next_cursor is null.

Note
X audience export is a paid feature — free or lapsed accounts receive a 403. Each page fetched is billed at your plan rate (Starter 5, Growth 3, Pro 2, Scale 1 credits); each page returns roughly 1–2k users.

Export an audience

POST/v1/x/audience

Export followers or following for an account, one metered page at a time.

json
{
  "handle": "@webclaw",
  "direction": "followers",
  "max_pages": 2
}

Parameters

FieldTypeRequiredDescription
handlestringNo@handle, resolved once (unbilled). Provide handle or user_id.
user_idstringNoPre-resolved numeric id. Pass it back on later pages to skip re-resolving.
directionstringNofollowers (default) or following.
cursorstringNoOpaque cursor from a previous response's next_cursor.
max_pagesintegerNoPages to fetch this call (1–10). Default: 2. Each page is roughly 1–2k users.

Response

json
{
  "user_id": "44196397",
  "direction": "followers",
  "count": 2000,
  "users": [
    {
      "id": "1234567890",
      "screen_name": "example_user",
      "name": "Example User",
      "followers": 1523,
      "description": "Builder. Writing about the web.",
      "url": "https://example.com"
    }
  ],
  "next_cursor": "1770000000000000000|-1",
  "pages_fetched": 2,
  "credits_charged": 2
}
FieldTypeDescription
user_idstringThe resolved numeric id of the account. Pass it back on later pages.
directionstringfollowers or following.
countintegerNumber of users returned in this response.
usersobject[]The exported users. See the fields below.
next_cursorstring | nullCursor for the next call. null means the audience is fully walked.
pages_fetchedintegerPages fetched on this call.
credits_chargedintegerCredits billed for this call (your plan rate per page: Starter 5, Growth 3, Pro 2, Scale 1).

User object

FieldTypeDescription
idstringNumeric account id.
screen_namestringThe @handle, without the leading @.
namestringDisplay name.
followersintegerFollower count.
descriptionstringProfile bio.
urlstringProfile website link, if any.

Paging a full audience

Resolve the handle once, then chain calls with the returned user_id and next_cursor until next_cursor comes back null.

bash
# First call — resolve the handle and fetch the first pages
curl -X POST https://api.webclaw.io/v1/x/audience \
  -H "Authorization: Bearer wc_..." \
  -H "Content-Type: application/json" \
  -d '{"handle": "@webclaw", "direction": "followers"}'

# Next call — reuse user_id and pass next_cursor
curl -X POST https://api.webclaw.io/v1/x/audience \
  -H "Authorization: Bearer wc_..." \
  -H "Content-Type: application/json" \
  -d '{"user_id": "44196397", "direction": "followers", "cursor": "1770000000000000000|-1"}'

SDK examples

Python

python
from webclaw import Webclaw

client = Webclaw(api_key="wc_...")

# Walk a full follower list
cursor = None
user_id = None
while True:
    page = client.x.audience(
        handle="@webclaw" if user_id is None else None,
        user_id=user_id,
        direction="followers",
        cursor=cursor,
    )
    user_id = page.user_id
    for user in page.users:
        print(user.screen_name)
    cursor = page.next_cursor
    if cursor is None:
        break

TypeScript

typescript
import Webclaw from "@webclaw/sdk";

const client = new Webclaw({ apiKey: "wc_..." });

// Walk a full follower list
let cursor: string | null = null;
let userId: string | undefined;
do {
  const page = await client.x.audience({
    handle: userId ? undefined : "@webclaw",
    userId,
    direction: "followers",
    cursor: cursor ?? undefined,
  });
  userId = page.userId;
  for (const user of page.users) console.log(user.screenName);
  cursor = page.nextCursor;
} while (cursor !== null);

cURL

bash
curl -X POST https://api.webclaw.io/v1/x/audience \
  -H "Authorization: Bearer wc_..." \
  -H "Content-Type: application/json" \
  -d '{"handle": "@webclaw", "direction": "following", "max_pages": 5}'
Note
To watch an account for new posts instead of exporting its audience, use the X Monitors endpoints.

Ready to build? Start extracting.

Cancel anytime. One key for every format and endpoint.