Access the Twitter API
There are two ways to access the Twitter API, now called the X API. You can apply for a developer account and pick a paid tier, or you can use a hosted API that reads public X data with one key. The right one depends on whether you need to read, post, or both.

The job
Official route. Apply for a developer account, create a project and use its keys. Your tier decides what you can call, and the tiers have changed several times. Does Twitter have an API, the X API key guide and Twitter API v2 cover the details and dates.
Hosted route. One key from a hosted API reads public posts, profiles and followers, and runs actions from X accounts you connect. You don't file a developer application. See the comparison with the official API.
How it works
Decide what you need
Reading public data, or acting as an account (posting, DMs, follows).
Pick a route
Official access if you need its full write scope. A hosted key if you mostly read.
Make a first call
Look up a profile with your key. The sample below shows the request in curl, Python and JavaScript.
Endpoints that do it
| Endpoint | What it's for | Credits |
|---|---|---|
| Get a userGET /v1/x/users/{handle} | Your first call: a profile by handle. | 2 credits |
| Search tweetsGET /v1/x/tweets/search | Posts by keyword. | 2 credits |
| List user tweetsGET /v1/x/users/{handle}/tweets | An account's recent posts. | 2 credits |
Free tools for the same job
Try the job in a browser first. These tools call the same endpoints, and you don't need a key or any code.
A first call
A profile lookup. Switch the tabs for curl, Python or JavaScript.
curl "https://api.chatterapi.com/v1/x/users/levelsio" \
-H "Authorization: Bearer $CHATTERAPI_KEY"{
"data": {
"id": "1577241403",
"handle": "levelsio",
"name": "@levelsio",
"bio": "馃捀http://levels.vc\n馃摳http://PhotoAI.com $86K/m\n馃幃http://VibeJam.com $44K/m\n馃彙http://InteriorAI.com $23K/m\n馃憴@X $13K/m\n馃實http://Nomads.com $7K/m\n馃彥http://Hotelist.com $5K/m",
"followers": 974707,
"following": 3276,
"tweets": 181450,
"verified": false,
"blueVerified": true,
"canDm": false,
"protected": false,
"location": "馃摃My book $5K/m 馃憠",
"url": "https://readMAKE.com",
"avatarUrl": "https://pbs.twimg.com/profile_images/2077111020305162240/PwddgOau_400x400.jpg",
"createdAt": "2013-07-08T09:31:59.000Z",
"profileUrl": "https://x.com/levelsio",
"bannerUrl": "https://pbs.twimg.com/profile_banners/1577241403/1665964220",
"likesGiven": 185852,
"mediaCount": 19829,
"pinnedTweetIds": [
"2109949585737052316"
]
}
}Recorded from a live call on . Long text is shortened and the cursor is cut. A live key is charged 2 credits for this call. A test key returns this same sample for 0 credits.
What it won't do
- This is independent of X and is not an official X product.
- Actions run only from accounts you connect, within safe daily limits.
- Deleted posts and protected accounts are not returned.
Questions
How do I get Twitter API access?
Is the Twitter API free?
Do I need a developer account for this one?
Guides
More ways to use the API
- Claude Reddit bot
- Live Twitter monitor
- Reddit API application
- Reddit brand monitoring
- Reddit data export
- Reddit post API
- Reddit scraper API
- Social listening API
- Post with the Twitter API
- Twitter API statuses
- Twitter exporter
- Twitter scraper API
- Twitter webhook
- Reddit comments API
- Reddit user API
- Subreddit API
- Twitter followers API
- Twitter user API
- Twitter search API
- Social media scraping API
- Reddit listening tool
- Twitter feed API
- Twitter hashtag API
- Social media analytics API
- Twitter image API