Loading...
Loading...
Access real-time external data via the xapi CLI — Twitter/X, Douyin/TikTok, Reddit, Weibo, crypto prices, web/news/image/video/scholar search, AI text processing, and SMS verification. Use when the user mentions xapi, wants to call a third-party API, or asks what external services are available.
npx skill4agent add xapi-labs/xapi-cli xapixapinpx xapi-to <command># Register a new account (apiKey is saved automatically)
npx xapi-to register
# Register with an inviter's referral code (establishes the referrer relationship, unlocks +$1 bonus on Twitter claim, and the inviter earns 5% of your future top-ups)
# please replace xapito to your actual referral code
npx xapi-to register --referral-code xapito
npx xapi-to register xapito # positional shorthand
# Or set an existing key
npx xapi-to config set apiKey=<your-key>
# Verify connectivity
npx xapi-to config health~/.xapi/config.jsonXAPI_KEYa3b8c2referralCode--format json|pretty|tablejsonprettytable--help--source capability--source apilistsearchservices--source capability--source apiget# Search by keyword
npx xapi-to search "twitter"
npx xapi-to search "token price" --source api
# List all APIs (supports --source, --category, --page, --page-size)
npx xapi-to list
npx xapi-to list --source capability
npx xapi-to list --category Social --page-size 10
# Browse categories and services
npx xapi-to categories
npx xapi-to services --category Social
# Get API schema (shows required parameters)
npx xapi-to get crypto.token.price# Always get the schema first, then call
npx xapi-to get twitter.tweet_detail
npx xapi-to call twitter.tweet_detail --input '{"tweet_id":"1234567890"}'/2/tweets--method# get returns an array when multiple methods exist
npx xapi-to get x-official.2_tweets
npx xapi-to get x-official.2_tweets --method POST
# Use --method flag to call a specific method (defaults to GET)
npx xapi-to call x-official.2_tweets --method POST --input '{"body":{"text":"Hello!"}}'--input# Get user profile
npx xapi-to call twitter.user_by_screen_name --input '{"screen_name":"elonmusk"}'
# Get user's tweets
npx xapi-to call twitter.user_tweets --input '{"user_id":"44196397","count":10}'
# Get user's tweets and replies (timeline includes replies)
npx xapi-to call twitter.user_tweets_and_replies --input '{"user_id":"44196397","count":10}'
# Get tweet details and replies
npx xapi-to call twitter.tweet_detail --input '{"tweet_id":"1234567890"}'
# Get user's media posts
npx xapi-to call twitter.user_media --input '{"user_id":"44196397"}'
# Get followers / following
npx xapi-to call twitter.followers --input '{"user_id":"44196397"}'
npx xapi-to call twitter.following --input '{"user_id":"44196397"}'
# Search tweets
npx xapi-to call twitter.search_timeline --input '{"raw_query":"bitcoin","count":20}'
# Get retweeters of a tweet
npx xapi-to call twitter.retweeters --input '{"tweet_id":"1234567890"}'twitter.user_by_screen_namerest_id# Get token price and 24h change
npx xapi-to call crypto.token.price --input '{"token":"BTC","chain":"bsc"}'
# Get token metadata
npx xapi-to call crypto.token.metadata --input '{"token":"ETH","chain":"eth"}'# General web search
npx xapi-to call web.search --input '{"q":"latest AI news"}'
# Realtime web search with time filter
npx xapi-to call web.search.realtime --input '{"q":"breaking news","timeRange":"day"}'
# News search
npx xapi-to call web.search.news --input '{"q":"crypto regulation"}'
# Image search
npx xapi-to call web.search.image --input '{"q":"aurora borealis"}'
# Video search
npx xapi-to call web.search.video --input '{"q":"machine learning tutorial"}'
# Academic / scholar search
npx xapi-to call web.search.scholar --input '{"q":"transformer architecture"}'
# Maps search
npx xapi-to call web.search.maps --input '{"q":"coffee shop near Times Square"}'
# Places search (businesses with details)
npx xapi-to call web.search.places --input '{"q":"best ramen in Tokyo"}'
# Shopping search
npx xapi-to call web.search.shopping --input '{"q":"mechanical keyboard"}'# Fast chat completion
npx xapi-to call ai.text.chat.fast --input '{"messages":[{"role":"user","content":"Explain quantum computing in one sentence"}]}'
# Reasoning chat (more thorough)
npx xapi-to call ai.text.chat.reasoning --input '{"messages":[{"role":"user","content":"Analyze the pros and cons of microservices"}]}'
# Summarize text
npx xapi-to call ai.text.summarize --input '{"text":"<long text here>"}'
# Rewrite text
npx xapi-to call ai.text.rewrite --input '{"text":"<text>","mode":"formalize"}'
# Generate embeddings
npx xapi-to call ai.embedding.generate --input '{"input":"hello world"}'--input# Simple parameters (built-in capabilities)
npx xapi-to call web.search --input '{"q":"hello world"}'
# Nested objects (third-party APIs with pathParams/params/body)
npx xapi-to call serper.search --input '{"body":{"q":"hello world"}}'--code--code <target>getcall| Target | Aliases | Default library | Variants |
|---|---|---|---|
| — | curl | — |
| | requests | |
| | fetch | |
| | fetch | |
| — | net/http | — |
# Generate a curl command from API schema (template with empty values)
npx xapi-to get crypto.token.price --code curl
# Generate a Python snippet with your input pre-filled
npx xapi-to call crypto.token.price --input '{"token":"BTC","chain":"bsc"}' --code python
# Use a specific library variant
npx xapi-to call crypto.token.price --input '{"token":"BTC","chain":"bsc"}' --code python.httpx
# Generate TypeScript code
npx xapi-to get web.search --code tsget --codecall --code--input--format prettyx-official.2_tweetsoauth# List available OAuth providers
npx xapi-to oauth providers
# Bind Twitter OAuth to your API key (opens browser for authorization)
npx xapi-to oauth bind --provider twitter
# Check current OAuth bindings
npx xapi-to oauth status
# Remove an OAuth binding (get binding-id from oauth status)
npx xapi-to oauth unbind <binding-id>calloauth statusoauth bind# Show current config (masked API key, host, source)
npx xapi-to config show
# Check balance
npx xapi-to balance
# Top up account
npx xapi-to topup --method stripe --amount 10
npx xapi-to topup --method x402x-officialdouyintwitterredditweibo-app5sim-smsaveserperopenrouternpx xapi-to services --format tablenpx xapi-to registerconfig set apiKey=<key>npx xapi-to oauth bind --provider twitternpx xapi-to topup --method stripe --amount 10searchlistget--page--page-sizelistsearchservicesguides/twitter.mdguides/reddit.mdguides/tiktok.mdguides/douyin.mdguides/xiaohongshu.mdguides/weibo.mdguides/google_search.mdguides/sms.md*.xapi.toxapi.towww.xapi.toaction.xapi.toapi.xapi.to~/.xapi/config.jsontopup