How to Get a Twitter API Key in 2026 (Step-by-Step Guide)
The X developer portal changed completely in 2026. Here's exactly how to get your API key — the official way and the 30-second alternative.

Getting a Twitter API key isn't what it used to be. The developer portal moved from developer.twitter.com to console.x.com, the free tier is gone, and every request now costs money under the new pay-per-use model.
This guide covers two paths:
- The official way — through the X Developer Console
- The fast way — through a third-party API (no approval, no credit card required)
Method 1: Official X Developer Portal
Step 1 — Sign in to the Developer Console
Go to console.x.com and sign in with your X (Twitter) account.
If you don't have an X account, you'll need to create one first. The developer console requires a standard X account with a verified email address and phone number.
Step 2 — Accept the Developer Agreement
You'll be asked to review and accept the X Developer Agreement and Policy. Read it carefully — your use case description is binding, and any deviation can result in your access being revoked.
Step 3 — Describe Your Use Case
X requires a description of how you plan to use the API. This needs to be at least 250 characters and should cover:
- What you're building (app, bot, analytics tool, research project)
- How you'll use the data (display tweets, analyze sentiment, automate posting)
- Whether you'll display Twitter content to end users
- Whether your app will tweet, retweet, like, or follow on behalf of users
Be specific and honest. Vague descriptions like "I want to use the API for a project" get flagged.
Step 4 — Create a Project and App
Once approved, create a Project in the console:
- Give it a name and description
- Select your use case category
- Create an App within the project
Step 5 — Generate Your API Keys
The console generates four sets of credentials:
| Credential | What It's For |
|---|---|
| API Key & Secret | Identifies your app (OAuth 1.0a) |
| Bearer Token | App-only authentication (read endpoints) |
| Access Token & Secret | Acts on behalf of your account (write endpoints) |
| Client ID & Secret | OAuth 2.0 PKCE flow for user authentication |
Save these immediately. They're shown only once. If you lose them, you'll need to regenerate.
Step 6 — Add a Payment Method
Since the free tier is effectively gone for new signups (as of February 2026), you need to purchase credits before making API calls:
- Go to the Billing section in the Developer Console
- Add a credit card or payment method
- Purchase credits — these are deducted per request
- Optionally set a monthly spending cap to avoid surprise bills
- Enable auto-recharge if you don't want your app to stop when credits run out
Credits never expire, so you only pay for what you use.
Step 7 — Make Your First API Call
Test your setup with a simple user lookup:
curl -X GET "https://api.x.com/2/users/by/username/elonmusk" \
-H "Authorization: Bearer YOUR_BEARER_TOKEN"
If you get a JSON response with user data, you're set. If you get a 401 or 403, double-check your Bearer Token.
What Does the Official API Cost?
Every API call deducts credits at these rates:
| Operation | Cost Per Request |
|---|---|
| Post read (fetch a tweet) | $0.005 |
| User profile lookup | $0.010 |
| Post create (write a tweet) | $0.010 |
| DM event read | $0.010 |
| DM send | $0.015 |
| Follow / like / retweet | $0.015 |
There's a 24-hour deduplication window — fetching the same resource twice in one UTC day counts as one charge.
The pay-per-use model caps at 2 million post reads/month. Beyond that, you need Enterprise pricing ($42,000+/month).
For a detailed cost breakdown with real monthly estimates, see our Twitter API Cost in 2026 guide.
Common Reasons Applications Get Rejected
X rejects developer applications for these use cases:
- Surveillance — tracking users, monitoring protests, investigating groups
- Scraping for AI training — fine-tuning models on X content (except Grok)
- Competitive analysis — benchmarking X's performance or user metrics
- Spam automation — bulk following, identical cross-account posting
- Sensitive data inference — deriving health, financial, political, or demographic information about users
- Off-platform matching — linking X identities to external databases without consent
There's currently no appeal process for rejected applications. If your use case falls into any of these categories, you won't get access through the official portal.
Method 2: Get an API Key in 30 Seconds (GetXAPI)
If you don't want to deal with developer account approval, credit purchases, or use case restrictions, third-party APIs like GetXAPI offer the same Twitter data through a simpler process.
How It Works
- Sign up at getxapi.com/signup — email and password, no developer application
- Get your API key — shown immediately on your dashboard
- Start making requests — no credit card required, you get $0.10 in free credits to test
That's it. No approval wait, no use case description, no payment method required upfront.
Make Your First Request
const response = await fetch(
"https://api.getxapi.com/v1/user/by/username?username=elonmusk",
{
headers: {
"X-API-Key": "your-api-key-here",
},
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.get(
"https://api.getxapi.com/v1/user/by/username",
params={"username": "elonmusk"},
headers={"X-API-Key": "your-api-key-here"}
)
print(response.json())
Pricing Comparison
| Official X API | GetXAPI | |
|---|---|---|
| Signup time | 5-10 minutes + approval | 30 seconds |
| Free credits | None (free tier removed) | $0.10 at signup |
| Post read | $0.005 | $0.001 |
| User lookup | $0.010 | $0.001 |
| Tweet create | $0.010 | $0.002 |
| DM send | $0.015 | $0.002 |
| Monthly cap | 2M post reads | None |
| Credit card required | Yes | No (to start) |
Which Should You Choose?
Use the official X API if:
- You need OAuth user authentication flows (login with Twitter)
- You're building a Twitter-integrated platform app
- You need Enterprise-level streaming (filtered stream, firehose)
- Compliance or legal requirements demand direct platform access
Use GetXAPI if:
- You want to start making requests immediately
- You're building a bot, scraper, analytics tool, or research project
- You want lower per-request costs
- You don't want to deal with developer account applications
- You need DM, search, or user data endpoints without the overhead
Quick Reference
| Task | Official API | GetXAPI |
|---|---|---|
| Get API key | console.x.com | getxapi.com/signup |
| View pricing | X API pricing | GetXAPI pricing |
| API docs | docs.x.com | docs.getxapi.com |
| Cost calculator | — | Cost Calculator |
Developer portal information based on X Developer Docs and X Developer Community as of March 2026. Pricing verified against the X API pricing page.