GetXAPI Documentation
GetXAPI documentation: quickstart for the Twitter/X API, authentication, and all 69 endpoints from $0.001 per call with curl, JavaScript and Python examples.
GetXAPI is a REST API for Twitter/X data with 69 endpoints: 58 usage-priced read and write endpoints from $0.001 per call, 2 free account endpoints, and 9 real-time monitoring endpoints included with a Monitoring plan. Authentication is a single Bearer key, with no OAuth flow and no X developer account required.
New here? Jump straight to the Quickstart for the base URL, authentication, and a working request in curl, JavaScript, or Python.
There are no endpoint-specific request quotas on paid data endpoints; general service throttling still applies, and monitoring management and free polling endpoints use abuse-prevention limits.
Try it without code
Three ways to explore every endpoint interactively, pick whichever you already use:
- Hosted Postman docs → documenter.getpostman.com/view/54999474/2sBXqRkd7E, searchable, with example responses for every endpoint
- Fern docs → getxapi.docs.buildwithfern.com, same collection rendered in Fern's clean reference layout
Use it in Claude, Cursor & any MCP client
GetXAPI ships an official Model Context Protocol server, point your AI assistant at it and the full Twitter/X API becomes native tools (search tweets, look up users, read followers, post tweets, send DMs, publish articles).
Add it to your MCP client config (Claude Desktop, Cursor, Windsurf, etc.):
{
"mcpServers": {
"getxapi": {
"command": "npx",
"args": ["-y", "@getxapi/mcp@latest"],
"env": { "GETXAPI_KEY": "YOUR_API_KEY" }
}
}
}Read tools need only your GETXAPI_KEY; write tools (post, like, DM, etc.) additionally use your X account auth.
- npm → npmjs.com/package/@getxapi/mcp
- GitHub → github.com/getxapi/getxapi-mcp
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 Thread | GET | /twitter/tweet/thread | $0.005 |
| Tweet Replies | GET | /twitter/tweet/replies | $0.001 |
| Tweet Retweeters | GET | /twitter/tweet/retweeters | $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 |
Articles
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Get Article | GET | /twitter/article/get | $0.001 |
| Create Article | POST | /twitter/article/create | $0.01 |
| Update Article | POST | /twitter/article/update | $0.005 |
| List Articles | POST | /twitter/article/list | $0.005 |
| Publish Article | POST | /twitter/article/publish | $0.005 |
| Unpublish Article | POST | /twitter/article/unpublish | $0.005 |
| Delete Article | POST | /twitter/article/delete | $0.005 |
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 Tweets Complete | GET | /twitter/user/tweets/complete | $0.003 |
| 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 |
| Follow User | POST | /twitter/user/follow | $0.001 |
| Unfollow User | POST | /twitter/user/unfollow | $0.001 |
| Home Timeline | POST | /twitter/user/home_timeline | $0.001 |
| Bookmark Search | POST | /twitter/user/bookmark_search | $0.001 |
| User Affiliates | GET | /twitter/user/affiliates | $0.001 |
| User Login | POST | /twitter/user_login | $0.01 |
| User Login V2 (Recovery) | POST | /twitter/user_login_v2 | $0.005 |
| Reset Password, Send Code | POST | /twitter/reset-password/send-code | $0.005 |
| Reset Password, Confirm | POST | /twitter/reset-password/confirm | $0.005 |
Lists
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| List Members | GET | /twitter/list/members | $0.001 |
Direct Messages
Media
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Upload Media | POST | /twitter/media/upload | $0.001 |
Community
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Join Community | POST | /twitter/community/join | $0.002 |
Spaces
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Space Info | GET | /twitter/spaces/info | $0.001 |
| Download Space | POST | /twitter/spaces/download | $0.05 + $0.015/min |
Trends
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Get Trends | GET | /twitter/trends | $0.001 |
| Trend Locations | GET | /twitter/trends/locations | $0.001 |
Account
| Endpoint | Method | Path | Cost |
|---|---|---|---|
| Account Info | GET | /account/me | Free |
| Payment History | GET | /account/payments | Free |
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 on paid data endpoints, which have no endpoint-specific quota, though general service throttling applies under sustained concurrency; the monitoring management endpoints do have per-minute 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
Most read endpoints cost $0.001 per call. User Tweets Complete costs $0.003 per call, Tweet Thread costs $0.005 per call, and DM endpoints cost $0.002 per call. No subscription is required for pay-per-call access; optional plans are available. There are no endpoint-specific request quotas on these paid data endpoints, so you pay only for what you use. General service throttling still applies. (The monitoring management endpoints are not billed per call and carry abuse-prevention limits instead.)