Docs
Following IDs

Following IDs

IDs of the accounts a user follows, up to 5,000 per call.

GET/user/{userId}/followings/ids

Parameters

  • userIdpath · string · required

    Numeric user ID (digits only, up to 30). To pass a handle instead, use -1 here and set username.

  • usernamequery · string · optional

    Handle, with or without @. When set, it is used instead of userId: the API looks up the ID first, which makes the call a little slower. Still one billed call.

  • countquery · integer · optional · default 5000

    IDs per page, 1 to 5,000. Values outside that range use 5,000.

  • cursorquery · string · optional

    nextCursor from the previous page. Leave it out for the first page. 0 means there are no more pages.

Paginated: pass the bottom cursor of one page as cursor to get the next. Each page is one billed call. See Pagination.

Notes

  • One call returns up to 5,000 IDs, so a list of 1 million followers takes about 200 calls.
  • Pages can occasionally be smaller (about 100 IDs) when X serves the list in smaller pages; keep following nextCursor.
  • No simple format: with format=simple the response is the same as without it.

Example request

curl 'https://api.twittrapi.com/user/44196397/followings/ids?count=5000' \
  --header 'X-API-KEY: YOUR_API_KEY'

Base URL https://api.twittrapi.com, key in the X-API-KEY header. Python and Node.js use the official SDKs.

Response

Built by the API: {"ids": ["123", ...], "nextCursor": "...", "previousCursor": "..."}. IDs are strings, newest first. nextCursor "0" means the list is complete.

Example response coming soon.

In the raw format, field names and nesting come from X and can change without notice. See Response format.

Errors

  • 422userId is not numeric, or the username lookup failed.
  • 400userId is -1 and username is missing, or the username contains characters X blocks.
  • 404The user could not be found.
  • 400cursor is 0 (the end of the list was already reached).

Errors every endpoint can return (401, 402, 403, 404, 408, 409, 429, 5xx), and which of them are charged, are on the Errors page. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded.