Skip to main content
The X API gives you programmatic access to X’s public conversation. All endpoints below are available on pay-per-use plans. Endpoints marked as Enterprise-only require an Enterprise plan.

Endpoints

Posts

Search, retrieve, and publish posts. Access timelines, threads, and quote posts.

Users

Look up profiles, manage follows, blocks, and mutes.

Direct Messages

Send and receive private messages.

Spaces

Find live audio conversations and participants.

Lists

Create and manage curated lists of accounts.

Likes

Like and unlike posts. Look up who liked a post.

Trends

Trending topics by location and personalized trends.

Media

Upload images, videos, and GIFs. Manage subtitles and metadata.

Communities

Look up and search communities.

Community Notes

Create, evaluate, and search community notes.

News

Search and retrieve news stories.

Compliance

Batch compliance jobs and compliance streams.

Streaming & real-time

Filtered Stream

Get posts delivered in real-time matching your filter rules.

X Activity

Subscribe to real-time activity events like follows, likes, and profile updates.

Webhooks

Receive event data via HTTP callbacks.

Enterprise-only

These endpoints require an Enterprise plan.

Volume Streams

Full firehose and language-specific streams.

Likes Streams

Stream all or sampled likes in real-time.

Powerstream

High-performance filtered streaming with advanced operators.

Analytics

Post and media engagement metrics at scale.

Account Activity

Real-time user event subscriptions.

Stream Webhooks

Filtered stream delivery via webhooks.

Quick start

curl "https://api.x.com/2/users/by/username/xdevelopers" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Make your first request

Get your credentials and call the API in minutes.

SDKs

Official Python and TypeScript libraries.