Export Twitter Comments to Excel in 2026 (Nested Replies)
Free tools stop at 25 or 100 replies. Export Twitter comments to Excel with a Python script that keeps replies to replies, at 1 credit per reply.
Tarun Khatri
Published · Updated · 7 min read
To export Twitter comments to Excel, pull the post's replies through an API and save them as a CSV or XLSX file.
This guide is for you if you need every reply to an X (Twitter) post in a spreadsheet, replies to replies included. You get the no-code options and their limits, then a short Python script. We run Weir, the API in the script.
This prints the newest replies to a post:
import os, requests
post_id = "2111172163776708859" # the digits after /status/ in the post URL
r = requests.get(
f"https://api.weirapp.io/v1/x/posts/{post_id}/replies",
headers={"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"},
timeout=60,
)
for reply in r.json()["data"]:
print(reply["createdAt"][:10], reply["likeCount"], reply["text"][:60])
You need Python 3, a free Weir key and the post's URL. The whole job in four steps:
- Get a keySign up with no card and set WEIR_API_KEY.
- Fetch the repliesGET /v1/x/posts/{id}/replies, following the cursor.
- Go one level deeperAsk again for replies that have their own.
- Save for ExcelA UTF-8 CSV and an XLSX, ids as text.
Which Twitter comment exporter should you use?
A free web tool is fine for one small post. For every reply, or the threads under each comment, you need an API.
| Tool | Free | Replies to replies | Beyond free |
|---|---|---|---|
| Comment Picker | 25 per export | No, top-level only | $9.99/month for 2,500 |
| ExportComments | 100 per post | Not stated | Plans up to 250,000 per post |
| Official X API | Bonus after a purchase | Yes, with conversation_id: |
$0.005 per reply |
| Weir API (ours) | 5,000 credits a month | Yes, one call per branch | $0.10 to $0.20 per 1,000 |
Each limit comes from the vendor's own page, checked on 22 October 2026.
Browser extensions read what X loads in your browser. One, TwCommentExport, says X typically shows only about 200 comments per post.
Step 1: Get a key and set up
Sign up with no card and create a key under API keys. Then install requests, plus openpyxl, which lets you write real Excel files:
pip install requests openpyxl
export WEIR_API_KEY="weir_live_..."
A shared session keeps your key in one place:
import os, time, requests
API = "https://api.weirapp.io"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['WEIR_API_KEY']}"
New to this? Start with how to get tweets with Python.
Step 2: Fetch the replies to a post
You call GET /v1/x/posts/{id}/replies. It returns public replies, newest first, and sort also takes relevance or likes, which are X's own rankings.
There is no limit. X decides how many replies you get per page, so this generator follows meta.nextCursor until it is null:
def reply_pages(post_id, sort="latest", max_pages=50):
params = {"sort": sort}
for _ in range(max_pages):
r = session.get(f"{API}/v1/x/posts/{post_id}/replies", 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 means out of credits: stop
page = r.json()
yield from page["data"]
if not page["meta"]["nextCursor"]:
return
params["cursor"] = page["meta"]["nextCursor"]
We ran this endpoint on 22 October 2026 through Weir's MCP tool. The example is @XDevelopers' post about the X Chat API, whose counter showed 8 replies. We hide the repliers, who are private people:
→ get_x_replies {"id": "2111172163776708859"}
← 6 replies · 7 credits · meta.nextCursor set
createdAt inReplyToId likeCount
2026-10-19T13:55:35Z 2111172163776708859 0
2026-10-17T01:47:03Z 2111172163776708859 0
2026-10-16T21:33:11Z 2111172163776708859 0
2026-10-16T19:27:38Z 2111172163776708859 0
2026-10-16T19:13:31Z 2111172163776708859 0
2026-10-16T19:10:05Z 2111172163776708859 0
→ the same call with that cursor
← 0 replies · 1 credit · meta.nextCursor null
The counter said 8 and X served 6, so treat counts as a guide.
Both of our walks ended with an empty page that still cost 1 credit.
Step 3: Get the replies to replies
A reply is a post too, so you can pass its id to the same endpoint and get the replies under it.
One call may not get you every level. We tested an @XDevelopers reply with 2 replies of its own. Its call returned one, and the reply under that one came only on a second call:
@XDevelopers reply 2107254805043507337 · replyCount 2
└── reply …5898 · inReplyToId …7337 · replyCount 1
└── reply …9370 · inReplyToId …5898 · replyCount 0
→ get_x_replies on …7337 → 1 reply (…5898) · 2 credits
→ get_x_replies on …5898 → 1 reply (…9370) · 2 credits
So this walk asks again whenever a reply's replyCount is higher than the replies you found under it:
from collections import Counter
def all_replies(post_id, max_branches=100):
found, todo, done = {}, [post_id], set()
while todo and len(done) < max_branches:
parent = todo.pop()
done.add(parent)
for reply in reply_pages(parent):
found[reply["id"]] = reply
kids = Counter(r["inReplyToId"] for r in found.values())
todo = [i for i, r in found.items()
if i not in done and (r["replyCount"] or 0) > kids[i]]
return list(found.values())
What the walk gets right:
inReplyToIdnames the parent.conversationIdnames the first post, at every depth.max_branchescaps the bill. Each branch is asked once and adds 1 credit per page.
Step 4: Export Twitter comments to Excel
Sort by id and you get each parent before its replies, because X ids grow with time. Then each reply gets its depth and its thread:
post_id = "2111172163776708859"
rows = sorted(all_replies(post_id), key=lambda r: int(r["id"])) # parents first
level, top = {}, {}
for r in rows:
parent = r["inReplyToId"]
r["level"] = level[r["id"]] = level.get(parent, 0) + 1
r["thread"] = top[r["id"]] = top.get(parent, r["id"])
r["username"] = r["author"]["username"]
level is 1 for a comment and 2 for a reply to it. thread is the id of the top comment a reply belongs to.
Now write a CSV and an XLSX:
import csv
from openpyxl import Workbook
FIELDS = ["thread", "id", "inReplyToId", "level", "createdAt",
"username", "text", "likeCount", "replyCount", "url"]
with open(f"replies-{post_id}.csv", "w", newline="", encoding="utf-8-sig") as f:
writer = csv.DictWriter(f, fieldnames=FIELDS, extrasaction="ignore")
writer.writeheader()
writer.writerows(rows)
book = Workbook()
sheet = book.active
sheet.append(FIELDS)
for r in rows:
sheet.append([r.get(field) for field in FIELDS])
book.save(f"replies-{post_id}.xlsx")
We tested this code on 22 October 2026 by replaying the real replies above.
In Excel, sort by thread, then id, and you see each comment above its replies, in order. Filter level to 1 to keep top-level comments only.
It's the same file pattern as our guide to exporting Twitter followers to CSV. To pick a giveaway winner from the repliers, paste their usernames into our free Twitter giveaway picker.
If the export looks wrong
- Ids end in zeros. Microsoft says Excel keeps only 15 significant digits, and X ids have 19. Open the XLSX, where openpyxl stored them as text.
- Emoji turn into odd symbols. Keep
encoding="utf-8-sig", which adds a byte order mark. Microsoft's Excel help says a UTF-8 CSV with one opens normally. - A
400on page two. A cursor only works with the same post andsort. Change either, and start again. - A
402. You're out of credits, and retrying won't help. Buy a pack, or wait for next month's free credits.
What does it cost to export Twitter replies?
On Weir, you pay 1 credit per reply and 1 per page. Failed calls cost you nothing.
Your free 5,000 credits a month cover a little under that many replies. The free tier allows 30 requests a minute, and this endpoint counts as two, so a walk makes about 15 calls a minute.
TwitterAPI.io is cheaper per reply than our two smallest packs. Its price list shows $0.15 per 1,000 tweets. X's own API charges $0.005 per post read, as of October 2026.
When not to use Weir
- You export one small post, once. Comment Picker's free export covers 25 replies with no code.
- You only care about price per reply. TwitterAPI.io charges less per reply than our two smallest packs.
- You need to answer or hide replies. Weir only reads; acting on replies needs X's own API.
- Your company needs a contract with X. Weir isn't licensed by X, so access can change.
FAQ
How do I download Twitter comments for free?
Comment Picker exports 25 replies free, enough if you have one small post. For more, Weir's 5,000 free monthly credits cover nearly as many replies with the script above. No tool we checked is free with no limit.
Is there a Twitter reply API?
Yes: X's own API finds every reply with the conversation_id: search operator, at $0.005 per post read. Recent search covers the last week, and full-archive search goes back to 2006. Weir's replies endpoint returns them directly, at 1 credit each.
Can a Twitter reply extractor get replies to replies?
Only if it walks each branch. Comment Picker exports top-level comments only. With Weir, you pass a reply's id to the replies endpoint, as the script above does for every reply with replies of its own.
Is it OK to export someone's replies?
The replies are public, but they are about people. Keep only what you need, never use the file for spam, and follow X's terms and the privacy law that applies to you. This isn't legal advice.
Sources
All pages checked 22 October 2026 unless noted.
- Comment Picker, X export: https://commentpicker.com/twitter-export.php
- ExportComments, Twitter comments: https://exportcomments.com/export-twitter-comments
- TwCommentExport, Chrome Web Store (updated 27 July 2026): https://chromewebstore.google.com/detail/lcckooiphipnhinacpmhddhdcpiaadgb
- X API, conversation ID: https://docs.x.com/x-api/fundamentals/conversation-id
- X API, search: https://docs.x.com/x-api/posts/search/introduction
- X API pricing: https://docs.x.com/x-api/getting-started/pricing
- X API free credits: https://docs.x.com/x-api/getting-started/free-credits
- TwitterAPI.io pricing: https://twitterapi.io/pricing
- Microsoft, large numbers in Excel: https://support.microsoft.com/topic/1bf7b935-36e1-4985-842f-5dfa51f85fe7
- Microsoft, CSV UTF-8 files in Excel: https://support.microsoft.com/en-us/excel/opening-csv-utf-8-files-correctly-in-excel
- Python codecs, utf-8-sig: https://docs.python.org/3/library/codecs.html
- Weir getXReplies: https://docs.weirapp.io/reference/x/getXReplies
- Weir billing: https://docs.weirapp.io/billing
- Weir calls, 22 October 2026: get_x_replies (requests 2b7689bc, c806f7c0, 8299e954, 4c6b6843, 6971bcc8)