Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xio

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.

Install

cargo install --path .

Key resolution: TWITTERAPI_KEY env var, else ~/.config/twitterapi/config.json:

{"api_key": "..."}

Usage

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.

Cost model

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).

Gotchas

  • 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.
  • search uses Twitter's advanced-search syntax verbatim (from:, since:, until:, min_faves:, filter:, ...). Default ranking is Latest; --top for Top.
  • followers --ids uses 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, not Anthropic — that's a guy in Ohio).

About

CLI for the twitterapi.io Twitter/X data API — bulk reads without official-API pricing

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages