> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitter following API, profile export & cursors

> Retrieve the accounts one X user follows by username or numeric user ID with cursor pagination for CRM, warehouse, and agent workflows. 1 credit per result.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-following-200">
      ```json theme={null}
      {
        "users": [],
        "has_next_page": false,
        "next_cursor": ""
      }
      ```
    </Tab>

    <Tab title="400" id="response-x-following-400">
      ```json theme={null}
      {
        "error": "invalid_input",
        "message": "Invalid input. Check the request body."
      }
      ```
    </Tab>

    <Tab title="401" id="response-x-following-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required."
      }
      ```
    </Tab>

    <Tab title="402" id="response-x-following-402">
      ```json theme={null}
      {
        "error": "insufficient_credits",
        "message": "Insufficient credits. Top up or subscribe to continue."
      }
      ```
    </Tab>

    <Tab title="403" id="response-x-following-403">
      ```json theme={null}
      {
        "error": "x_account_protected",
        "message": "This account's following list is private. Try a public account."
      }
      ```
    </Tab>

    <Tab title="404" id="response-x-following-404">
      ```json theme={null}
      {
        "error": "user_not_found",
        "message": "X user not found. Check the username."
      }
      ```
    </Tab>

    <Tab title="409" id="response-x-following-409">
      ```json theme={null}
      {
        "error": "coverage_cursor_unavailable",
        "message": "Cursor busy. Retry after the indicated delay."
      }
      ```
    </Tab>

    <Tab title="410" id="response-x-following-410">
      ```json theme={null}
      {
        "error": "coverage_cursor_gone",
        "message": "Cursor finished, expired, or superseded. Restart pagination without cursor."
      }
      ```
    </Tab>

    <Tab title="424" id="response-x-following-424">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-following-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>

    <Tab title="502" id="response-x-following-502">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="503" id="response-x-following-503">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "Maximum coverage is busy. Retry shortly."
      }
      ```
    </Tab>
  </Tabs>
</Panel>

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

## When to read outbound relationships

Use this route for accounts the selected user follows. Use followers for inbound relationships. Use verified followers when you need only verified inbound followers.

<Callout icon="coins" color="#5c3327">
  **1 credit per result returned** · [All plans](https://xquik.com/#pricing) from \$0.00012/credit
</Callout>

Get following returns the accounts one X profile follows by username or
numeric user ID. The endpoint is
`GET /api/v1/x/users/{id}/following`.

<Info>
  Omit `mode` for automatic maximum coverage. Xquik combines available views
  within a short request window. It keeps the existing response shape.
  Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target,
  query, and filters.
</Info>

Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and
`pageSize` aliases also keep working. Billing still counts only returned rows.
Use `mode=standard` only to force legacy single-view pagination.

A page can be empty or underfilled. Continue while `has_next_page` is `true`.
Stop only after the response reports `has_next_page=false`.

First-page requests do not support `Idempotency-Key` retries.
Repeating a cursorless request starts a separate extraction.
Results returned by that extraction incur their normal charges.
Save each response before requesting its next page.
You cannot replay earlier or terminal responses after their cursors become unavailable.

If automatic coverage is busy, an initial request returns a standard data page.
Live coverage cursors remain atomic. Concurrent use returns
`409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then
retry the same cursor once.
Repeated busy responses never authorize restarting with another cursor.

Finished, expired, superseded, or identity-mismatched cursors return
`410 coverage_cursor_gone`. The response omits `Retry-After`. Restart without
a cursor. Keep received results. Deduplicate restarted results by `id`.
Malformed cursors return `400 invalid_coverage_cursor`. Restart without them.

<CodeGroup>
  ```bash Username theme={null}
  curl "https://xquik.com/api/v1/x/users/username/following?pageSize=100" \
    -H "x-api-key: xq_your_api_key_here" | jq
  ```

  ```bash Numeric user ID theme={null}
  curl "https://xquik.com/api/v1/x/users/44196397/following" \
    -H "x-api-key: xq_your_api_key_here" | jq
  ```

  ```bash Resume page theme={null}
  curl -G "https://xquik.com/api/v1/x/users/username/following" \
    --data-urlencode "cursor=DAACCgACGE..." \
    --data-urlencode "pageSize=200" \
    -H "x-api-key: xq_your_api_key_here" | jq
  ```

  ```javascript Node.js theme={null}
  const userIdOrUsername = "44196397";
  let pageCursor = "";
  const seenCursors = new Set();

  for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) {
    const params = new URLSearchParams({ pageSize: "200" });
    if (pageCursor !== "") params.set("cursor", pageCursor);

    const response = await fetch(
      `https://xquik.com/api/v1/x/users/${userIdOrUsername}/following?${params}`,
      { headers: { "x-api-key": "xq_your_api_key_here" } },
    );
    const page = await response.json();
    if (!response.ok) throw new Error(JSON.stringify(page));

    const audienceRows = page.users.map((user) => ({
      source_user_id_or_username: userIdOrUsername,
      x_user_id: user.id,
      x_username: user.username,
      display_name: user.name,
      bio: user.description ?? null,
      follower_count: user.followers ?? null,
      following_count: user.following ?? null,
      verified: user.verified ?? false,
      profile_image_url: user.profilePicture ?? null,
      page_index: pageIndex,
      page_cursor: pageCursor,
      next_cursor: page.next_cursor,
      has_next_page: page.has_next_page,
    }));
    for (const row of audienceRows) process.stdout.write(`${JSON.stringify(row)}\n`);

    if (!page.has_next_page || page.next_cursor === "") break;
    if (page.next_cursor === pageCursor || seenCursors.has(page.next_cursor)) {
      throw new Error("pagination cursor repeated");
    }
    seenCursors.add(page.next_cursor);
    pageCursor = page.next_cursor;
  }
  ```

  ```python Python theme={null}
  import json
  import requests

  user_id_or_username = "44196397"
  page_cursor = ""
  seen_cursors = set()

  for page_index in range(3):
      params = {"pageSize": "200"}
      if page_cursor:
          params["cursor"] = page_cursor

      response = requests.get(
          f"https://xquik.com/api/v1/x/users/{user_id_or_username}/following",
          params=params,
          headers={"x-api-key": "xq_your_api_key_here"},
      )
      page = response.json()
      if not response.ok:
          raise RuntimeError(page)

      for user in page["users"]:
          audience_row = {
              "source_user_id_or_username": user_id_or_username,
              "x_user_id": user["id"],
              "x_username": user["username"],
              "display_name": user["name"],
              "bio": user.get("description"),
              "follower_count": user.get("followers"),
              "following_count": user.get("following"),
              "verified": user.get("verified", False),
              "profile_image_url": user.get("profilePicture"),
              "page_index": page_index,
              "page_cursor": page_cursor,
              "next_cursor": page["next_cursor"],
              "has_next_page": page["has_next_page"],
          }
          print(json.dumps(audience_row, separators=(",", ":")))

      if not page["has_next_page"] or not page["next_cursor"]:
          break
      if page["next_cursor"] == page_cursor or page["next_cursor"] in seen_cursors:
          raise RuntimeError("pagination cursor repeated")
      seen_cursors.add(page["next_cursor"])
      page_cursor = page["next_cursor"]
  ```
</CodeGroup>

The Node.js and Python snippets write JSON Lines audience rows, not raw
following pages. Store each mapped row and the latest `next_cursor` in your
sync job. It can then resume from the last completed page.

For high-volume following pulls, deduplicate profiles by `id`. Continue through empty pages while the cursor advances. Stop with a partial-result status when `next_cursor` is missing or repeats.

## Direct following handoff

Use `GET /x/users/{id}/following` when a CRM, warehouse, audience, or agent workflow needs one paginated JSON page of accounts followed by a user now. The endpoint accepts a username or numeric user ID. It returns followed account profile rows with cursor fields. Use [`following_explorer`](/api-reference/extractions/create) when you need an estimated job, saved extraction, or CSV, JSON, or XLSX file export.

<CardGroup cols={2}>
  <Card title="Following rows" icon="list-tree">
    Store `users[]` as the followed account profile rows returned on this page.
  </Card>

  <Card title="Stable upserts" icon="key-round">
    Store `users[].id` as `x_user_id` for CRM, warehouse, audience, and agent deduplication.
  </Card>

  <Card title="Readable labels" icon="badge">
    Store `users[].username` and `users[].name` for handles, labels, segments, and review queues.
  </Card>

  <Card title="Profile enrichment" icon="file-text">
    Store `users[].description`, `location`, `url`, `profilePicture`, and `coverPicture` when returned.
  </Card>

  <Card title="Next page" icon="arrow-right">
    Store `has_next_page` and `next_cursor`, then pass `next_cursor` back as `cursor` only when `has_next_page` is true.
  </Card>

  <Card title="Page size" icon="rows-3">
    Automatic pages accept 20 to 300. Standard pages accept 20 to 200.
  </Card>
</CardGroup>

Direct following calls cost 1 credit per user returned. Low credit balances can return fewer users than a full page. Zero affordable results return `402 insufficient_credits`.

## Track Twitter following changes

Create complete following snapshots for the selected profile. Keep its numeric
user ID and collection time with every row.

Compare snapshots by followed user ID. New IDs represent newly observed
outbound follows. Missing IDs represent removals only when both snapshots
completed.

Keep the current username, profile name, biography, verification state, and
follower counts for review. Do not use usernames as the comparison key.

Store every cursor page before advancing. Mark interrupted, repeated-cursor,
or credit-limited runs as partial. Never calculate following changes from a
partial snapshot.

## Path parameters

<ParamField path="id" type="string" required>
  User ID, username with or without `@`, or URL-encoded profile URL, such as
  `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids).
</ParamField>

## Query parameters

<ParamField query="cursor" type="string">
  Pass `next_cursor` back unchanged. New Xquik cursors resume automatic
  coverage. Existing unprefixed cursors keep legacy behavior.
</ParamField>

<ParamField query="mode" type="string">
  Optional compatibility override. Omit it for automatic maximum coverage.
  Use `standard` for legacy single-view pagination. Use `coverage` for a
  one-shot diagnostic response without cursor pagination.
</ParamField>

<ParamField query="after" type="string">
  Legacy cursor alias. Use `cursor`. When both are present, `cursor` wins.
</ParamField>

<ParamField query="pageSize" type="number">
  Automatic pages accept `20` through `300`. Standard pages accept `20` through
  `200`. The default is `200`. Credits can reduce the returned row count.
</ParamField>

<ParamField query="limit" type="number">
  With `mode=coverage`, set a one-shot cap from `1` through `10000`.
  Otherwise, this is a legacy page size alias. `pageSize` wins.
</ParamField>

<ParamField query="enrichProfiles" type="boolean" default="false">
  Set `true` to add each row's full profile, as `GET /x/users/{id}` returns it.
  Pages take several seconds longer. The price per row stays the same. Later
  pages can leave it out, & `next_cursor` still works.
</ParamField>

## Which following endpoint?

<CardGroup cols={2}>
  <Card title="One user's following" icon="user-plus">
    Use `GET /x/users/{id}/following` for the accounts one profile follows.
  </Card>

  <Card title="One user's followers" icon="users-round">
    Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) for the
    accounts that follow that profile.
  </Card>

  <Card title="Verified followers" icon="badge-check">
    Use [`GET /x/users/{id}/verified-followers`](/api-reference/x/verified-followers)
    when you only need verified followers of the profile.
  </Card>

  <Card title="Saved exports" icon="file-spreadsheet">
    Use [`following_explorer`](/api-reference/extractions/create) for a saved
    following extraction with CSV, JSON, or XLSX download handoff.
  </Card>
</CardGroup>

### User result filters

These filters apply before billing. Selective filters can return fewer rows.

<ParamField query="minFollowers" type="integer">
  Require this minimum follower count. Filtering happens before billing.
</ParamField>

<ParamField query="maxFollowers" type="integer">
  Allow this maximum follower count. Missing counts pass this filter.
</ParamField>

<ParamField query="minFollowing" type="integer">
  Require this minimum following count.
</ParamField>

<ParamField query="maxFollowing" type="integer">
  Allow this maximum following count. Missing counts pass this filter.
</ParamField>

<ParamField query="minStatuses" type="integer">
  Require this minimum post count.
</ParamField>

<ParamField query="maxStatuses" type="integer">
  Allow this maximum post count. Missing counts pass this filter.
</ParamField>

<ParamField query="minAccountAgeDays" type="integer">
  Require this minimum account age in days.
</ParamField>

<ParamField query="verifiedOnly" type="boolean">
  When `true`, only return verified profiles.
</ParamField>

<ParamField query="verifiedType" type="string">
  Match the exact verification type.
</ParamField>

<ParamField query="hasWebsite" type="boolean">
  When `true`, require a profile website.
</ParamField>

<ParamField query="hasLocation" type="boolean">
  When `true`, require a profile location.
</ParamField>

<ParamField query="bioContains" type="string">
  Require every comma-separated or line-separated bio term.
</ParamField>

<ParamField query="locationContains" type="string">
  Require this text in the profile location.
</ParamField>

<ParamField query="usernameContains" type="string">
  Require this text in the username.
</ParamField>

## Headers

<ParamField header="x-api-key" type="string">
  Full account key. Sessions and OAuth also work.
</ParamField>

<ParamField header="Authorization" type="string">
  `Bearer xq_your_guest_key_here` for `paid_reads`.
</ParamField>

## Response

### 200 OK

With `enrichProfiles=true`, each row carries the full profile. The
`x-xquik-profile-enrichment` header then counts the rows that have it, as in
`enriched=180; requested=200`. A row without it keeps its list fields.

<ResponseField name="users" type="object[]">
  Array of user profiles being followed.
  **User object fields.**

  <ResponseField name="id" type="string">
    X user ID.
  </ResponseField>

  <ResponseField name="username" type="string">
    X username.
  </ResponseField>

  <ResponseField name="name" type="string">
    Display name.
  </ResponseField>

  <ResponseField name="description" type="string">
    Profile bio. Omitted if empty.
  </ResponseField>

  <ResponseField name="followers" type="number">
    Follower count.
  </ResponseField>

  <ResponseField name="following" type="number">
    Following count.
  </ResponseField>

  <ResponseField name="verified" type="boolean">
    Whether the user is verified.
  </ResponseField>

  <ResponseField name="profilePicture" type="string">
    Profile picture URL.
  </ResponseField>

  <ResponseField name="location" type="string">
    Profile location. Omitted if empty.
  </ResponseField>

  <ResponseField name="accountBasedIn" type="object | null">
    Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from
    account access. It states no nationality or exact location. `null` when X shows none. Present with
    `enrichProfiles=true`, unless X withholds it.
  </ResponseField>

  <ResponseField name="accountBasedInUnavailable" type="boolean">
    `true` when X withheld `accountBasedIn` from this row. Retry later to get it. Omitted otherwise.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    ISO 8601 account creation timestamp.
  </ResponseField>

  <ResponseField name="statusesCount" type="number">
    Total number of tweets posted. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="coverPicture" type="string">
    Cover or banner image URL. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="mediaCount" type="number">
    Total number of media tweets posted. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="url" type="string">
    Website URL from profile. Omitted if empty.
  </ResponseField>

  <ResponseField name="favouritesCount" type="number">
    Total number of tweets liked. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="hasCustomTimelines" type="boolean">
    Whether the user has custom timelines. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="isTranslator" type="boolean">
    Whether the user is an X translator. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="withheldInCountries" type="string[]">
    Country codes where the account is withheld. Omitted if empty.
  </ResponseField>

  <ResponseField name="possiblySensitive" type="boolean">
    Whether X flags the account as possibly sensitive. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="pinnedTweetIds" type="string[]">
    IDs of pinned tweets. Omitted if none.
  </ResponseField>

  <ResponseField name="isAutomated" type="boolean">
    Whether X marks the account as automated. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="automatedBy" type="string">
    Username of the account operator if automated. Omitted if not automated.
  </ResponseField>

  <ResponseField name="unavailable" type="boolean">
    Whether the account is unavailable. Omitted if available.
  </ResponseField>

  <ResponseField name="unavailableReason" type="string">
    Reason the account is unavailable. Omitted if available.
  </ResponseField>

  <ResponseField name="verifiedType" type="string">
    Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue
    check.
  </ResponseField>

  <ResponseField name="profile_bio" type="object">
    Structured profile bio with entity annotations. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="isBlueVerified" type="boolean">
    Whether the account has X Premium verification. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="isVerified" type="boolean">
    Normalized verification status. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="profileBannerUrl" type="string">
    Profile banner URL. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="protected" type="boolean">
    Whether the account protects its posts. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="communityRole" type="string">
    Role within the requested community context. Omitted outside community results.
  </ResponseField>
</ResponseField>

<ResponseField name="has_next_page" type="boolean">Whether more results are available.</ResponseField>
<ResponseField name="next_cursor" type="string">Cursor for the next page.</ResponseField>

```json theme={null}
{
  "users": [
    {
      "id": "987654321",
      "username": "username",
      "name": "Xquik",
      "followers": 10000,
      "verified": true
    }
  ],
  "has_next_page": true,
  "next_cursor": "DAACCgACGE..."
}
```

### 400 Invalid user ID

```json theme={null}
{
  "error": "invalid_user_id",
  "message": "Send a user ID, @username or profile URL, such as x.com/nasa."
}
```

### 404 User not found

```json theme={null}
{ "error": "user_not_found", "message": "X user not found. Check the username." }
```

### 401 Unauthenticated

Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge.

```json theme={null}
{ "error": "unauthenticated" }
```

### 402 Payment required

Account keys get account options. Guest keys get guest top-up only.
No checkout starts automatically. Confirm any payment action.

### 502 X API unavailable

```json theme={null}
{ "error": "x_api_unavailable" }
```

The read service returned an error. Retry after a short delay.

### 429 Rate limit exceeded

```json theme={null}
{ "error": "rate_limit_exceeded", "retryAfter": 60 }
```

You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying.

### 424 Dependency failed

```json theme={null}
{ "error": "x_api_unavailable" }
```

The normalized v1 response contract can return 424 when the read service is unavailable.

<Note>
  **Related.** [Get followers](/api-reference/x/followers) · [Get verified followers](/api-reference/x/verified-followers) · [Get followers you know](/api-reference/x/followers-you-know)
</Note>

<div className="related-api-links">
  <Accordion title="Related follower, list & community APIs" icon="link">
    * Profiles: [Search users](/api-reference/x/search-users) · [Search autocomplete](/api-reference/x/search-autocomplete) · [Get user](/api-reference/x/twitter-profile-lookup) · [Batch users](/api-reference/x/batch-users)
    * Followers: [Followers](/api-reference/x/followers) · [Following](/api-reference/x/following) · [Follower IDs](/api-reference/x/follower-ids) · [Following IDs](/api-reference/x/following-ids) · [Creator subscriptions](/api-reference/x/user-subscriptions) · [Affiliates](/api-reference/x/user-affiliates) · [Similar accounts](/api-reference/x/user-similar) · [Verified followers](/api-reference/x/verified-followers) · [Followers you know](/api-reference/x/followers-you-know) · [Check follower](/api-reference/x/check-follower)
    * Lists: [Search lists](/api-reference/x/search-lists) · [User lists](/api-reference/x/user-lists) · [List memberships](/api-reference/x/user-list-memberships) · [List members](/api-reference/x/list-members) · [List followers](/api-reference/x/list-followers)
    * Communities: [Find](/api-reference/x/community-find) · [Popular](/api-reference/x/community-popular) · [Topics](/api-reference/x/community-topics) · [Suggested](/api-reference/x/community-suggested) · [Details](/api-reference/x/community-info) · [Members](/api-reference/x/community-members) · [Moderators](/api-reference/x/community-moderators) · [Timeline](/api-reference/x/community-tweets) · [Media](/api-reference/x/community-media) · [Keyword search](/api-reference/x/community-search)
  </Accordion>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.