Skip to content

Latest commit

 

History

History
147 lines (111 loc) · 4.8 KB

File metadata and controls

147 lines (111 loc) · 4.8 KB
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
X API
API overview
API features
API versions
API pricing
v2 API
API resources

The X API provides programmatic access to X's public conversation. Retrieve posts, analyze trends, build integrations, and create new experiences on the platform.


What you can do

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

API versions

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)
The previous version of the X API. Limited support; use v2 for new projects.
**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.

Available resources

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.

v2 highlights

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 fields →

Posts include semantic annotations identifying people, places, products, and topics. Filter streams and searches by topic.

Learn more about annotations →

Access public metrics (likes, reposts, replies) and private metrics (impressions, clicks) for your own posts.

Learn more about metrics →

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.

Learn more about edit posts →


Pricing

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

View pricing details →


Next steps

Sign up and create your first app. Call the API in minutes.