Posts, profiles, and trends

X API

Search posts the way the X search page does, open an account's profile and timeline, and read a post with its replies. Trending topics come back for any location that has a WOEID. The API reads public data; it does not post, like, or follow.

Capabilities

What you can do with the X API

Accounts start from a username. Timeline endpoints take the numeric account ID, which the profile returns as rest_id, and a post is identified by the number after /status/ in its URL.

Post search

Post search passes your query to X unchanged, so operators such as from:, since:, and lang: work as they do on X. Choose the Top, Latest, People, or Media tab, and page through results with a cursor. See examples

The account

A username returns the account's rest_id, name, bio, follower, following, and post counts, profile and banner images, verification, and creation date. Its posts, replies, and highlights are separate calls on that rest_id. See examples

Trends

Pass a WOEID to get the trending topics for that place, each with its name, search query, and URL, plus a post volume when X reports one. The WOEID endpoint lists the locations, and the default is the United States. See examples

One post

A post ID returns the post along with the replies that load under it. For more replies, the replies endpoint pages through them sorted by relevance, recency, or likes. See examples

Lists

List search finds public lists by keyword, and a separate endpoint returns the public lists an account owns. List members and list timelines are not offered. See examples

Media posts

The media endpoint returns an account's posts that contain photos or videos, one page at a time, by rest_id. Use it for a gallery that should skip text-only posts. See examples

Shortened examples

Sample responses

A post, a profile, a trend, and a reply, each trimmed from a response body. Live responses also include a meta object, and the counts are the ones in the samples. Post and user objects arrive largely as X sends them.

{
    "rest_id": "1349129669258448897",
    "full_text": "Hey you …\nYeah you Queen …\nYou’re gonna make it!",
    "favorite_count": 522731,
    "lang": "en",
    "user": {
        "rest_id": "44196397",
        "screen_name": "elonmusk",
        "name": "Elon Musk"
    }
}
{
    "name": "Lisa",
    "query": "Lisa",
    "tweet_volume": 300324,
    "url": "http://twitter.com/search?q=Lisa"
}
{
    "rest_id": "44196397",
    "name": "Elon Musk",
    "screen_name": "elonmusk",
    "followers_count": 227669486,
    "friends_count": 1220,
    "is_blue_verified": true,
    "created_at": "Tue Jun 02 20:12:29 +0000 2009"
}
{
    "rest_id": "1349129814628773888",
    "full_text": "@elonmusk Dear Elon, I'm a game dev. and I am making a game about colonizing Mars.",
    "favorite_count": 22394,
    "in_reply_to": "elonmusk",
    "user": {
        "screen_name": "lvladimirovBG"
    }
}

Documentation

The X docs cover post search, post details and replies, profiles, followers and following, user timelines and media, lists, relationships, trends, and batch lookups. Each paginated endpoint names the cursor key it returns.

Code samples

Every endpoint in the documentation includes a sample request in Shell, JavaScript, PHP, and Python.

ShellShellJavaScriptJavaScriptPHPPHPPythonPython

View documentation

Pricing

One plan covers every API

Your plan's monthly requests work on this API and every other SteadyAPI API. Plan details, overage rates, and the Free plan's daily cap are on the pricing page. Need more volume than the largest plan? Email [email protected].

Free
$0.00
$9.99
per month
Starter
$14.99
$19.99
per month
Developer
$39.99
$59.99
per month
Business Popular
$89.99
$99.99
per month
Enterprise
$299.99
$499.99
per month
SubscribeSubscribeSubscribeSubscribeSubscribe
Requests per month50010,00050,0002,500,000
Stock Market API
Options Data API
Crypto Data API
AliExpress API
Reddit API
Booking.com API
Real Estate API
Baseball (MLB) API
Hockey API
Football API
Amazon API
eBay API
Walmart API
Instagram API
Twitter / X API
TikTok API
YouTube API
AutoHub API
ScrapeFlow
Commercial Use
Optional overage rate*$1.50 per 1,000 requests$1.05 per 1,000 requests$0.09 per 1,000 requests
Overage capup to 50,000 extraup to 250,000 extraup to 12,500,000 extra
Free
$0.00
$94.99
per year
Starter
$11.96
$14.35
per month$143.52 billed yearly
Developer
$32.50
$40.00
per month$389.99 billed yearly
Business Popular
$72.50
$90.00
per month$869.99 billed yearly
Enterprise
$320.83
$400.00
per month$3,849.99 billed yearly
SubscribeSubscribeSubscribeSubscribeSubscribe
Requests per month50010,00050,0002,500,000
Stock Market API
Options Data API
Crypto Data API
AliExpress API
Reddit API
Booking.com API
Real Estate API
Baseball (MLB) API
Hockey API
Football API
Amazon API
eBay API
Walmart API
Instagram API
Twitter / X API
TikTok API
YouTube API
AutoHub API
ScrapeFlow
Commercial Use
Optional overage rate*$1.50 per 1,000 requests$1.05 per 1,000 requests$0.09 per 1,000 requests
Overage capup to 50,000 extraup to 250,000 extraup to 12,500,000 extra

* Overage is optional and stays off until you turn it on in Billing. It is available on paid plans billed by card through Stripe, and not during a trial. Usage is counted in monthly periods that start on your billing day, yearly plans included. Requests past the included limit are charged at the plan's rate for each started block of 1,000, up to the overage cap, on one invoice after the period ends. Amounts under $0.50 carry over to the next invoice. If you change plans during a period, the limit and overage rate of the plan you are on when the period ends apply to the whole period.

The Free plan is also capped at 20 requests per day (New York time). Requests count by endpoint weight, and only responses with HTTP status 200 count.

Commercial use is included only on the plans that list it. If you are not sure whether your project counts as commercial use, email [email protected] before you launch.

Why SteadyAPI

Ids, cursors, and batches

These details decide how you chain calls, and the docs list them for each endpoint.

Username in, rest_id out

The profile endpoint takes a username and returns rest_id. User posts, replies, highlights, and media all take that numeric ID.

Cursors in meta

Paginated endpoints put the next-page cursor in meta. Most use next_cursor; followers, user replies, highlights, and list search use cursor.

Batch lookups

The batch endpoints take up to 20 post IDs or 20 usernames in one request, which suits refreshing a saved watchlist.

Who follows whom

The relationship endpoint takes two usernames and says whether they follow each other, without paging through either follower list.

Also on the blog

From the blog

Guides for this API.