Overview
GetXAPI API documentation. The cheapest Twitter/X API — 27 endpoints from $0.001/call, ~20 results per call. Get started in minutes with code examples.
GetXAPI API Reference
The cheapest Twitter/X API with 27 endpoints starting at $0.001 per call. No rate limits, no OAuth complexity — just a simple REST API with your API key.
Quick Start
Base URL
https://api.getxapi.comAuthentication
All requests require an API key passed as a Bearer token in the Authorization header.
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.getxapi.com/twitter/user/info?userName=elonmusk"Example: Get a User Profile
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.getxapi.com/twitter/user/info?userName=elonmusk"const response = await fetch(
"https://api.getxapi.com/twitter/user/info?userName=elonmusk",
{
headers: { Authorization: "Bearer YOUR_API_KEY" },
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
"https://api.getxapi.com/twitter/user/info",
params={"userName": "elonmusk"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(response.json())Example: Search Tweets
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.getxapi.com/twitter/tweet/advanced_search?q=from:elonmusk&product=Latest"const response = await fetch(
"https://api.getxapi.com/twitter/tweet/advanced_search?q=from:elonmusk&product=Latest",
{
headers: { Authorization: "Bearer YOUR_API_KEY" },
}
);
const data = await response.json();
console.log(data.tweets);import requests
response = requests.get(
"https://api.getxapi.com/twitter/tweet/advanced_search",
params={"q": "from:elonmusk", "product": "Latest"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(response.json()["tweets"])Endpoint Index
Tweets
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Advanced Search | GET | /twitter/tweet/advanced_search | $0.001 |
| Tweet Detail | GET | /twitter/tweet/detail | $0.001 |
| Tweet Replies | GET | /twitter/tweet/replies | $0.001 |
| Create Tweet | POST | /twitter/tweet/create | $0.002 |
| Like Tweet | POST | /twitter/tweet/favorite | $0.001 |
| Retweet | POST | /twitter/tweet/retweet | $0.001 |
Users
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Search Users | GET | /twitter/user/search | $0.001 |
| User Info | GET | /twitter/user/info | $0.001 |
| User Info by ID | GET | /twitter/user/info_by_id | $0.001 |
| User About | GET | /twitter/user/user_about | $0.001 |
| User Tweets | GET | /twitter/user/tweets | $0.001 |
| User Tweets & Replies | GET | /twitter/user/tweets_and_replies | $0.001 |
| User Media | GET | /twitter/user/media | $0.001 |
| User Likes | POST | /twitter/user/likes | $0.001 |
| Followers | GET | /twitter/user/followers | $0.001 |
| Followers v2 | GET | /twitter/user/followers_v2 | $0.001 |
| Following | GET | /twitter/user/following | $0.001 |
| Following v2 | GET | /twitter/user/following_v2 | $0.001 |
| Verified Followers | GET | /twitter/user/verified_followers | $0.001 |
| Followers You Know | POST | /twitter/user/followers_you_know | $0.001 |
| Check Relationship | GET | /twitter/user/check_follow_relationship | $0.001 |
| Home Timeline | POST | /twitter/user/home_timeline | $0.001 |
| Bookmark Search | POST | /twitter/user/bookmark_search | $0.001 |
| User Login | POST | /twitter/user_login | $0.001 |
Lists
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| List Members | GET | /twitter/list/members | $0.001 |
Direct Messages
Pagination
All list endpoints support cursor-based pagination:
- Omit
cursorfor the first page - Pass
next_cursorfrom the response for subsequent pages - Each page typically returns ~20 items
- Some endpoints (followers/following v1) return up to 200 per page
- The v2 variants (followers_v2/following_v2) return ~70 per page
- Keep paginating until
has_moreisfalse
Error Codes
| Status | Meaning | Common Cause |
|---|---|---|
400 | Bad Request | Missing required parameter |
401 | Unauthorized | Invalid or missing API key / auth token |
404 | Not Found | User or tweet does not exist |
429 | Rate Limited | Too many requests (rare — GetXAPI has generous limits) |
502 | Bad Gateway | Twitter rejected the mutation (write endpoints) |
All errors return a JSON body with an error field:
{
"error": "Missing required query param: userName"
}Pricing
All read endpoints cost $0.001 per call. DM endpoints cost $0.002 per call. No monthly fees, no rate limits — pay only for what you use.