X API
APIX's v2 API for searching, reading and publishing posts on X (Twitter)
- Erişim
- Bearer token or OAuth 2.0
Hakkında
The X API v2 gives programmatic access to posts, users, DMs, lists, trends and real-time streams on X. It is pay-per-use with prepaid credits and no free tier: a post read costs $0.005 and a new post $0.015, and reads are capped at 3M a month below Enterprise.
Neler yapabilirsin
- Search recent or full-archive posts and stream matching posts live
- Publish posts, replies and DMs on behalf of a user
- Look up users, followers and post engagement metrics
Başlarken
- Sign in at console.x.com and create an app
- Buy credits and set a spending limit
- Copy the app's Bearer token
Örnek kod
# Look up a user with public metrics
curl "https://api.x.com/2/users/by/username/xdevelopers?user.fields=public_metrics" \
-H "Authorization: Bearer $X_BEARER_TOKEN"
# Search posts from the last 7 days
curl "https://api.x.com/2/tweets/search/recent?query=from:xdevelopers" \
-H "Authorization: Bearer $X_BEARER_TOKEN"Ayrıntılar
- Barındırma
- Hazır hizmet (bulut)
- Kullanılabildiği yerler
- Tüm dünya
- Resmi SDK'lar
- Python, JavaScript/TypeScript
- MCP sunucusu
- Uzak sunucu
- Entegrasyonlar
- X