Export Twitter Followers to CSV with Python (2026)
Export Twitter followers to CSV with Python: the official X API at $0.010 per follower, or a REST endpoint with cursor paging, with real cost math.
To export Twitter followers to CSV, page through a followers endpoint and write each account as one row.
This guide is for anyone who needs a follower list in a spreadsheet. You get code for the official X API and for Weir, plus what each costs. We run Weir, and we show where a rival is cheaper.
This prints the first page of followers:
import os, requests
r = requests.get(
"https://api.weirapp.io/v1/x/users/XDevelopers/followers",
headers={"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"},
timeout=60,
)
for account in r.json()["data"]:
print(account["username"], account["followersCount"])
The tutorial in four steps:
- Get a keySign up, copy a key, set WEIR_API_KEY.
- Look at one pageGET /v1/x/users/{user}/followers.
- Page through all of themSend meta.nextCursor back until it is null.
- Write the CSVOne row per account, flushed after every page.
Can you export any account's followers?
Only public ones. A protected account's followers are visible only to people it approved. Neither X's API nor Weir returns them; Weir answers 404. Our Twitter followers API page lists the fields each follower carries and what a full list costs.
A follower list is a list of people, so treat the file as personal data:
- Follow X's terms. X's Terms of Service restrict scraping, and what you do with the data is your responsibility.
- Have a reason, keep the minimum. Audience research is reasonable. Lists for unsolicited messages are not.
- Check the privacy law that applies to you and to the people in the file. This isn't legal advice.
Export Twitter followers with the official X API
X's endpoint is GET /2/users/{id}/followers. It returns up to 1,000 accounts per request and pages with a pagination_token.
Its rate limit is 300 requests per 15 minutes per app.
As of October 2026, X's pricing page lists follower reads at $0.010 each. Turning a username into an id is another $0.010 user read. Repeats within one UTC day are charged once.
With Tweepy:
import csv, os, tweepy
client = tweepy.Client(bearer_token=os.environ["X_BEARER_TOKEN"])
user = client.get_user(username="XDevelopers").data
with open("followers.csv", "w", newline="", encoding="utf-8") as file:
writer = csv.writer(file)
writer.writerow(["id", "username", "name", "followers_count"])
for f in tweepy.Paginator(
client.get_users_followers, user.id,
max_results=1000, user_fields=["public_metrics"],
).flatten(limit=5000): # a ceiling on the bill
metrics = f.public_metrics or {}
writer.writerow([f.id, f.username, f.name, metrics.get("followers_count")])
Exporting 5,000 followers of someone else's account this way costs about $50.
Step 1: Get a key and set up
Sign up with no card, create a key under API keys, then:
pip install requests
export WEIR_API_KEY="weir_live_..."
A shared session holds the auth header:
import os, time, requests
API = "https://api.weirapp.io"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['WEIR_API_KEY']}"
Step 2: Look at one page of followers
Weir's endpoint is GET /v1/x/users/{user}/followers. {user} takes a username or a numeric id, so you skip the separate lookup.
Followers come back most recent first, as X lists them.
r = session.get(f"{API}/v1/x/users/XDevelopers/followers", timeout=60)
r.raise_for_status()
page = r.json()
print(len(page["data"]), "accounts;", r.headers["x-credits-charged"], "credits")
There is no limit: X picks the page size, about 70. Each account looks like this. It's the illustrative example from the API reference, not a real person:
{
"id": "1593274519387648000",
"username": "example_dev",
"name": "Example Developer",
"description": "Building developer tools. Posts about APIs and data.",
"location": "Lisbon",
"verified": true,
"followersCount": 12840,
"followingCount": 311,
"createdAt": "2022-11-17T15:04:05.000Z",
"protected": false
}
description and location can be null. Keep id as a string.
Step 3: Page through every follower
meta.nextCursor is null after the last page. This generator yields one page at a time:
def follower_pages(user, max_pages=50):
cursor = None
for _ in range(max_pages):
params = {"cursor": cursor} if cursor else {}
r = session.get(f"{API}/v1/x/users/{user}/followers", params=params, timeout=60)
if r.status_code == 429: # too fast: wait, then retry the same page
time.sleep(int(r.headers.get("Retry-After", "10")))
continue
r.raise_for_status() # 402: out of credits; 404: missing or protected
page = r.json()
yield page["data"]
cursor = page["meta"]["nextCursor"]
if not cursor:
return
What this loop gets right:
max_pagescaps the cost. Fifteen pages is roughly 1,050 accounts.- The cursor goes back unchanged. A cursor from another request gets a
400(pagination). 429and402differ. A429clears afterRetry-After, so it retries. A402raises, because only a top-up fixes it.
Step 4: Export Twitter followers to CSV
DictWriter keeps the columns you name. Flushing after each page means a stopped run still leaves a usable file.
import csv
FIELDS = ["id", "username", "name", "description", "location", "verified",
"followersCount", "followingCount", "createdAt", "url"]
seen = set()
with open("followers.csv", "w", newline="", encoding="utf-8") as file:
writer = csv.DictWriter(file, fieldnames=FIELDS, extrasaction="ignore")
writer.writeheader()
for accounts in follower_pages("XDevelopers", max_pages=15):
for account in accounts:
if account["id"] not in seen: # guard against overlap
seen.add(account["id"])
writer.writerow(account)
file.flush()
print(f"wrote {len(seen)} followers")
Excel shows long ids in scientific notation. The CSV keeps every digit, so import id as text. To find followers by name or bio in the file, see how to search Twitter followers.
/v1/x/users/{user}/following works the same way for the accounts a user follows.
What does it cost to export Twitter followers?
Weir charges 1 credit per account plus 1 per call. The first page also pays 2 credits to look up the account.
So a full page is about 71 credits, and N followers cost about N + N/70 + 2.
Here is the same math at three sizes, as of October 2026:
| Followers | Weir credits | Weir ($5 pack) | Official X API | TwitterAPI.io |
|---|---|---|---|---|
| 1,000 | 1,017 | Free | $10 | $0.01 |
| 10,000 | 10,145 | $2.03 | $100 | $0.10 |
| 100,000 | 101,431 | $20.29 | $1,000 | $1.00 |
The 5,000 free monthly credits cover about 4,900 followers.
TwitterAPI.io is ten to twenty times cheaper than us for this job. It charges 1 credit, $0.00001, per follower when a page returns 200. SocialData charges $0.20 per 1,000 results.
Speed differs too:
The followers endpoint counts as 3 requests against your per-minute limit. X's own API is faster: 300 requests of 1,000 accounts per 15 minutes.
When not to use Weir
- Follower graphs are your main job. TwitterAPI.io costs far less per account.
- You export your own followers. X's Owned Reads rate is $0.001 each.
- You need X's own terms or a contract with X.
- The account has millions of followers. We haven't tested a full walk that large, so run a few pages first.
Weir fits when follower exports sit beside search, timelines or Reddit data on one key. More options are in Twitter API alternatives.
FAQ
Can I export followers of a private Twitter account?
No. A protected account's followers are visible only to people it approved. The official X API doesn't return them, and Weir answers 404. Only public accounts can be exported.
How much does it cost to export 10,000 Twitter followers?
About $100 on the official X API, at $0.010 per follower. On Weir it's 10,145 credits, about $2.03 on the $5 pack. TwitterAPI.io's published rate works out to about 10 cents.
How many followers can I get per request?
Up to 1,000 on the official X API and up to 200 on TwitterAPI.io. On Weir, X picks the page size, about 70 accounts, and you follow meta.nextCursor to the next page.
Can I export the accounts someone follows instead?
Yes. Weir's /v1/x/users/{user}/following takes the same cursor and returns the same fields. The script above works if you swap followers for following in the path.
Sources
- X API pay-per-usage pricing and Owned Reads (checked 19 October 2026): https://docs.x.com/x-api/getting-started/pricing
- X API Get followers reference: https://docs.x.com/x-api/users/get-followers
- X API rate limits: https://docs.x.com/x-api/fundamentals/rate-limits
- X Terms of Service: https://x.com/en/tos
- Tweepy on PyPI: https://pypi.org/project/tweepy/
- TwitterAPI.io pricing: https://twitterapi.io/pricing
- SocialData: https://socialdata.tools/
- Weir getXUserFollowers reference: https://docs.weirapp.io/reference/x/getXUserFollowers
- Weir billing and tiers: https://docs.weirapp.io/billing
- Weir pagination: https://docs.weirapp.io/pagination