Reply Ledger calls GET /twitter/user/posts and GET /twitter/replies for an account, then GET /twitter/post for selected parent posts. Give it a public X handle and it pulls the account's recent posts and replies, then writes a ledger: how replies compare with original posts, who the account replies to most, reply volume by day and its best replies.
The problem
Replies are a big part of how brands and creators grow on X, but the built-in views mix them with everything else. Social and community teams want to see how much an account replies, to whom, and which replies actually got attention, for their own account or a peer.
What the app does
- Takes a public X handle and a look-back window.
- Pulls the timeline and the account's replies in that window.
- Compares replies, original posts, thread replies and reposts (median likes, views, bookmarks).
- Lists who the account replies to most and reply volume by day.
- Shows the top 10 replies by engagement with the post they answered.
- Lists busy own posts with no reply from the account in the sample.
How it works
- Timeline.
GET /twitter/user/postswith paging, newest first, until the window is covered. - Replies.
GET /twitter/replieswithuser,count=100andquery=since:<date>. - Parents.
GET /twitter/postfor the posts that the top replies answered. - Write the ledger and a snapshot with every call and its cost.
API details
Verified against the live OpenAPI specification on 2026-11-25. These are schema fields, not a captured run.
Timeline requests send username=handle and, after the first page, the previous body's next_cursor as cursor. The separate reply search sends user=handle, count=100 and query=since:<date>. Parent lookups send id=pid. The date window, post classification and deduplication run in the script.
This projection of XUserPostsResponse retains the timeline list and its pagination field. The tweet identifier and text are required inside each list item:
The timeline cursor belongs to the same username and expires after 24 hours; an invalid, expired or other-user cursor returns 422 without charge. On the last page next_cursor is null. Account replies have a separate header cursor, which this script does not follow. The code's old inline comment about charging on empty replies is historical: today's reference says an empty reply search returns 200 and is not charged.
API reference: GET /twitter/user/posts, GET /twitter/replies, GET /twitter/post. Related walkthrough: Read an account timeline in Python.
The code
The folder has one script, replyledger.py, offline tests in test_replyledger.py and a real ledger in sample-output.md.
Endpoints
GET /twitter/user/postsGET /twitter/repliesGET /twitter/post
Example output
From runs on 2026-10-07: 30 days of a space agency's account took 11 calls and 121 billed units ($0.018). 14 days of a brand support account took 7 calls ($0.007). The ledger shows counts per post type, top reply targets, replies per day and the top replies by engagement.
Run it yourself
The public examples folder linked above includes the script and a README. Install its requirements, set DESEARCH_API_KEY from console.desearch.ai, and use the run command in that README.
Useful flags: --days (default 30), --pages (timeline pages, default 5), --parents (parent posts to look up, default 5), --max-spend (default $0.25).
What it costs
On 2026-10-07, 30 days for one account cost $0.018 (11 calls, 121 billed units) and 14 days for another cost $0.007, from the X-Desearch-Cost-Usd headers. See pricing.
Ideas to extend it
- Compare your reply habits with two peers.
- Run it monthly and track reply share over time.
- Flag your busy posts that still have no reply from you.