Skip to main content
The X API gives you programmatic access to X’s public conversation. Read posts, publish content, manage users, and analyze trends—all through modern REST endpoints with flexible pay-per-usage pricing.

What you can build


Pricing

The X API uses pay-per-usage pricing. No subscriptions, no monthly caps—pay only for what you use.

Flexible scaling

Start small and grow. Costs scale with your actual usage.

No commitments

No contracts or minimum spend. Stop anytime.

Real-time tracking

Monitor usage and costs live in the Developer Console.

Credit-based

Purchase credits upfront. Deducted as you use the API.

Key features

Rich data objects

Access detailed, structured data for posts, users, media, and more:
  • Posts: Full text, metrics, entities, annotations, conversation threads
  • Users: Profiles, follower counts, verification status
  • Media: Images, videos, GIFs with metadata
  • Polls: Options and vote counts
Customize responses with fields and expansions to get exactly the data you need.

API versions

VersionStatusDescription
v2CurrentModern endpoints, flexible pricing, all new features
v1.1LegacyLimited support, some endpoints still available
EnterpriseAvailableHigh-volume access with dedicated support
Use X API v2 for all new projects. It’s where all new features and improvements are released.

Quick start

1

Create a developer account

Sign up at console.x.com and create an app.
2

Get your credentials

Generate your Bearer Token for app-only requests.
3

Make a request

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

Tools & libraries

Browse all libraries →

Support