Followers
Accounts that follow a user, newest first.
/user/{userId}/followersParameters
userIdpath · string · requiredNumeric user ID (digits only, up to 30). To pass a handle instead, use -1 here and set username.
usernamequery · string · optionalHandle, 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 20Number of items to ask X for. Sent to X as is; X treats it as a hint and decides how many it returns (follower and following pages often hold 50 to 70 users for count=20). A value that is not a number falls back to 20.
cursorquery · string · optionalBottom cursor from the previous page. Leave it out for the first page. See Pagination.
Paginated: pass the bottom cursor of one page as cursor to get the next. Each page is one billed call. See Pagination.
Example request
curl 'https://api.twittrapi.com/user/12/followers?count=20' \
--header 'X-API-KEY: YOUR_API_KEY'from twittrapi import TwittrAPI
client = TwittrAPI(api_key="YOUR_API_KEY")
data = client.users.followers("12", count=20)import { TwittrAPI } from "twittrapi";
const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
const data = await client.users.followers({ userId: "12", count: 20 });curl 'https://twitter-aio.p.rapidapi.com/user/12/followers?count=20' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
--header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'Base URL https://api.twittrapi.com, key in the X-API-KEY header. Python and Node.js use the official SDKs.
Response
Raw JSON of X's Followers query.
Simple format (?format=simple or X-Response-Format: simple): Collection of User objects: {data: [User], nextCursor, previousCursor, hasNextPage}. Schema.
{
"data": {
"user": {
"result": {
"__typename": "User",
"timeline": {
"timeline": {
"instructions": [
{
"type": "TimelineClearCache"
},
{
"direction": "Top",
"type": "TimelineTerminateTimeline"
},
{
"direction": "Bottom",
"type": "TimelineTerminateTimeline"
},
{
"entries": [
{
"content": {
"__typename": "TimelineTimelineItem",
"clientEventInfo": {
"component": "FollowersSgs",
"element": "user"
},
"entryType": "TimelineTimelineItem",
"itemContent": {
"__typename": "TimelineUser",
"itemType": "TimelineUser",
"userDisplayType": "User",
"user_results": {
"result": {
"__typename": "User",
"affiliates_highlighted_label": {},
"has_graduated_access": true,
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAx",
"is_blue_verified": true,
"legacy": {
"blocked_by": false,
"blocking": false,
"can_dm": false,
"can_media_tag": true,
"created_at": "Mon Jan 10 02:06:34 +0000 2011",
"default_profile": false,
"default_profile_image": false,
"description": "Example",
"entities": {
"description": {}
},
"fast_followers_count": 0,
"favourites_count": 15964,
"follow_request_sent": false,
"followed_by": false,
"followers_count": 129088,
"following": false,
"friends_count": 3807,
"has_custom_timelines": true,
"is_translator": false,
"listed_count": 890,
"location": "",
"media_count": 1217,
"muting": false,
"name": "Example User 1",
"needs_phone_verification": false,
"normal_followers_count": 129088,
"notifications": false,
"possibly_sensitive": false,
"profile_banner_url": "https://pbs.twimg.com/profile_banners/1000000000000000000/1700000000",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg",
"profile_interstitial_type": "",
"protected": false,
"screen_name": "example_user_1",
"statuses_count": 11761,
"time_zone": "",
"translator_type": "regular",
"url": "",
"utc_offset": 0,
"verified": false,
"want_retweets": false,
"withheld_description": "",
"withheld_scope": ""
},
"parody_commentary_fan_label": "None",
"profile_image_shape": "Circle",
"rest_id": "1000000000000000001",
"super_follow_eligible": false,
"super_followed_by": false,
"super_following": false,
"tipjar_settings": {
"is_enabled": true,
"venmo_handle": "lesliebe"
}
}
}
}
},
"entryId": "user-1000000000000000001",
"sortIndex": "2109014666083565568"
},
{
"content": {
"__typename": "TimelineTimelineItem",
"clientEventInfo": {
"component": "FollowersSgs",
"element": "user"
},
"entryType": "TimelineTimelineItem",
"itemContent": {
"__typename": "TimelineUser",
"itemType": "TimelineUser",
"userDisplayType": "User",
"user_results": {
"result": {
"__typename": "User",
"affiliates_highlighted_label": {},
"has_graduated_access": true,
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAy",
"is_blue_verified": false,
"legacy": {
"blocked_by": false,
"blocking": false,
"can_dm": true,
"can_media_tag": false,
"created_at": "Fri Aug 08 02:16:23 +0000 2008",
"default_profile": false,
"default_profile_image": false,
"description": "Example",
"entities": {
"description": {}
},
"fast_followers_count": 0,
"favourites_count": 21556,
"follow_request_sent": false,
"followed_by": false,
"followers_count": 7599,
"following": false,
"friends_count": 2712,
"has_custom_timelines": true,
"is_translator": false,
"listed_count": 158,
"location": "Example",
"media_count": 682,
"muting": false,
"name": "Example User 2",
"needs_phone_verification": false,
"normal_followers_count": 7599,
"notifications": false,
"possibly_sensitive": false,
"profile_banner_url": "https://pbs.twimg.com/profile_banners/1000000000000000000/1700000000",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg",
"profile_interstitial_type": "",
"protected": false,
"screen_name": "example_user_2",
"statuses_count": 7955,
"time_zone": "",
"translator_type": "none",
"url": "",
"utc_offset": 0,
"verified": false,
"want_retweets": false,
"withheld_description": "",
"withheld_scope": ""
},
"parody_commentary_fan_label": "None",
"profile_image_shape": "Circle",
"rest_id": "1000000000000000002",
"super_follow_eligible": false,
"super_followed_by": false,
"super_following": false,
"tipjar_settings": {}
}
}
}
},
"entryId": "user-1000000000000000002",
"sortIndex": "2109014666083565565"
},
{
"content": {
"__typename": "TimelineTimelineCursor",
"cursorType": "Bottom",
"entryType": "TimelineTimelineCursor",
"value": "1000000000000000000|2109014666083565496"
},
"entryId": "cursor-bottom-2109014666083565498",
"sortIndex": "2109014666083565498"
},
{
"content": {
"__typename": "TimelineTimelineCursor",
"cursorType": "Top",
"entryType": "TimelineTimelineCursor",
"value": "-1|2109014666083565569"
},
"entryId": "cursor-top-2109014666083565569",
"sortIndex": "2109014666083565569"
}
],
"type": "TimelineAddEntries"
}
]
}
}
}
}
}
}{
"data": [
{
"id": "1000000000000000001",
"username": "example_user_1",
"name": "Example User 1",
"description": "Example",
"location": "",
"url": null,
"createdAt": "2011-01-10T02:06:34Z",
"avatarUrl": "https://pbs.twimg.com/profile_images/1000000000000000000/example.jpg",
"bannerUrl": "https://pbs.twimg.com/profile_banners/1000000000000000000/1700000000",
"verified": true,
"verifiedType": null,
"protected": false,
"counts": {
"followers": 129088,
"following": 3807,
"tweets": 11761,
"likes": 15964,
"media": 1217,
"listed": 890
},
"pinnedTweetIds": [],
"isAutomated": false
},
{
"id": "1000000000000000002",
"username": "example_user_2",
"name": "Example User 2",
"description": "Example",
"location": "Example",
"url": null,
"createdAt": "2008-08-08T02:16:23Z",
"avatarUrl": "https://pbs.twimg.com/profile_images/1000000000000000000/example.jpg",
"bannerUrl": "https://pbs.twimg.com/profile_banners/1000000000000000000/1700000000",
"verified": false,
"verifiedType": null,
"protected": false,
"counts": {
"followers": 7599,
"following": 2712,
"tweets": 7955,
"likes": 21556,
"media": 682,
"listed": 158
},
"pinnedTweetIds": [],
"isAutomated": false
}
],
"nextCursor": "1000000000000000000|2109014666083565496",
"previousCursor": null,
"hasNextPage": true
}In the raw format, field names and nesting come from X and can change without notice. See Response format; the simple format keeps a fixed schema.
Errors
- 422userId is not numeric, or the username lookup failed.
- 400userId is -1 and username is missing, the username contains characters X blocks, or the user could not be found.
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, 408, 409 or a 5xx error are refunded.