| title | About the X API | |||||||
|---|---|---|---|---|---|---|---|---|
| sidebarTitle | About X API | |||||||
| description | The X API provides programmatic access to X's public conversation. Retrieve posts, analyze trends, build integrations, and create new platform experiences. | |||||||
| keywords |
|
The X API provides programmatic access to X's public conversation. Retrieve posts, analyze trends, build integrations, and create new experiences on the platform.
| Capability | Description |
|---|---|
| Read posts | Search, look up, and stream posts in real-time |
| Publish content | Create posts, replies, and threads |
| Manage users | Look up users, manage follows, blocks, and mutes |
| Analyze data | Access metrics, trends, and engagement analytics |
| Build integrations | Send DMs, manage lists, and interact with Spaces |
The current version of the X API with modern features and flexible pricing.
**Why use v2:**
- Pay-per-usage pricing
- Modern JSON response format
- Flexible [fields](/x-api/fundamentals/fields) and [expansions](/x-api/fundamentals/expansions)
- Advanced features: annotations, conversation tracking, edit history
- All new endpoints and features
**Getting started:**
1. Sign up at [console.x.com](https://console.x.com)
2. Create an app and get credentials
3. [Make your first request](/x-api/getting-started/make-your-first-request)
**Still available:**
- Some media upload endpoints
- Legacy streaming (deprecated)
- Some specialized endpoints
**Migrating to v2:**
See the [migration guide](/x-api/migrate/overview) for endpoint mapping and data format changes.
The X API provides access to these resource types:
Search, retrieve, create, and delete posts. Access timelines, threads, and quote posts. Look up profiles, manage relationships, and access follower data. Discover live audio conversations and participants. Send and receive private messages between users. Create and manage curated lists of accounts. Access trending topics by location.Request only the data you need. Use `fields` parameters to select specific attributes and `expansions` to include related objects.
curl "https://api.x.com/2/tweets/123?tweet.fields=created_at,public_metrics&expansions=author_id&user.fields=username" \
-H "Authorization: Bearer $TOKEN"Learn more about annotations →
Access public metrics (likes, reposts, replies) and private metrics (impressions, clicks) for your own posts. Reconstruct entire conversation threads using `conversation_id`. Track replies across the full thread.Learn more about conversation tracking →
Access the edit history of posts, including all previous versions and edit metadata.X API v2 uses pay-per-usage pricing:
| Benefit | Description |
|---|---|
| No subscriptions | Pay only for what you use |
| Credit-based | Purchase credits, deducted per request |
| Real-time tracking | Monitor usage in the Developer Console |
| Deduplication | Same resource requested twice in 24 hours is only charged once |
Sign up and create your first app. Call the API in minutes.