CLI for the twitterapi.io Twitter/X data API — bulk reads
without the official API's pricing. Read-only by design: write endpoints require
handing twitterapi.io your X session cookie; use xcli (official API) for posting.
cargo install --path .
Key resolution: TWITTERAPI_KEY env var, else ~/.config/twitterapi/config.json:
{"api_key": "..."}xio [--json]
user <handle> Full profile
tweets <handle> Recent tweets [--replies] [--pages N] [--cursor C]
search <query> Advanced search, full Twitter syntax [--top]
e.g. xio search "from:sama since:2026-01-01 min_faves:1000"
tweet <id>... Tweets by id
replies <id> Replies to a tweet
quotes <id> Quote tweets
retweeters <id> Who retweeted
thread <id> Full thread context around a tweet
mentions <handle> Tweets mentioning a user
followers <handle> Followers, newest first [--ids for bulk id-only mode]
[--page-size 20-200]
following <handle> Accounts a user follows
users <keyword> Search users
trends [--woeid 1] Trending topics (1 = worldwide, 23424977 = US)
relationship <src> <tgt> Follow relationship between two users
call <path> [key=value ...] Raw GET escape hatch
e.g. xio call /twitter/community/tweets community_id=...
All paged commands take --pages N (default 1 — each page is a billed request)
and --cursor to resume; when more pages remain, the continuation cursor prints
to stderr. --json prints raw responses everywhere.
100,000 credits = $1. Roughly: tweets $0.15/1k, profiles $0.18/1k, follower
profiles $0.01/1k (at --page-size 200), follower IDs $0.0045/1k (--ids,
5000/page). Minimum charge $0.00015 per request. Free tier is limited to one
request per 5 seconds; the client retries 429s automatically (3 attempts, 5s
apart).
- The API mixes response shapes: some endpoints wrap in
data, some don't; user-search returns legacy field names (screen_name,followers_count). The client normalizes both — check both shapes before adding an endpoint. searchuses Twitter's advanced-search syntax verbatim (from:,since:,until:,min_faves:,filter:, ...). Default ranking is Latest;--topfor Top.followers --idsuses the bulk endpoint (followers_ids, 5000 ids/page, ~30x cheaper than profile pages) — join ids against your own data.- Handles are case-insensitive but must be exact (
AnthropicAI, notAnthropic— that's a guy in Ohio).