The X API (formerly Twitter API v2) provides programmatic access to tweets, users, trends, and DMs. Look up tweets and users by ID, search recent or full-archive posts, stream real-time tweets matching filters, post and reply, and manage likes and bookmarks.
https://api.twitter.com/2
Auth type
OAuth 2.0
Auth header
Authorization: Bearer AAAA...
Rate limit
300 requests/15min (Basic)
Pricing
Free tier available
Free quota
500k tweet reads/mo
Documentation
https://developer.twitter.com/en/docs/twitter-api
Endpoint status
Server online — HTTP 404 — server is online but path returned an error (may require auth)558ms
(checked Mar 29, 2026)
Builder score
B
70%
builder-friendly
Supports OAuth 2.0 Bearer Token (app-only) for read-only, and OAuth 2.0 PKCE for user-context actions.
Authorization: Bearer AAAA...
| Plan | Price/mo | Included |
|---|---|---|
| Free | Free | 1,500 writes/mo, 500k reads/mo |
| Basic | $100 | 3M reads/mo, 50k writes/mo |
| Pro | $5000 | 1M posts/mo, full-archive search |
| Enterprise | $42000 | Unlimited, historical access |
Free: 1,500 writes/mo, 500k reads/mo. Basic: $100/mo (3M reads). Pro: $5,000/mo (1M posts). Enterprise: $42,000/mo.
| Method | Path | Description |
|---|---|---|
| GET | /tweets/{id} |
Look up a specific tweet |
| POST | /tweets |
Create a tweet |
| GET | /tweets/search/recent |
Search tweets from the past 7 days |
| GET | /tweets/search/all |
Full-archive search (Academic/Pro) |
| GET | /users/{id}/tweets |
Get a user's timeline |
| GET | /tweets/sample/stream |
Stream 1% sample of all tweets |
curl "https://api.twitter.com/2/tweets/search/recent?query=from:nasa&tweet.fields=created_at,public_metrics&max_results=5" \ -H "Authorization: Bearer $TWITTER_BEARER_TOKEN"
{
"data": [{
"id": "1234567890",
"text": "🚀 Artemis update: our lunar gateway...",
"created_at": "2024-01-18T14:00:00.000Z",
"public_metrics": {"retweet_count": 823, "like_count": 4521}
}],
"meta": {"newest_id": "1234567890", "result_count": 5}
}
Data sourced from API Map. Always verify pricing and rate limits against the official X Corp documentation.