The twitter scraper API for recent X posts as JSON

Get recent posts from an X (Twitter) account as JSON, with engagement counts on each post. Set limit to pick the number of posts returned.

X Posts API at a glance

This API returns recent posts from one X (Twitter) account. Send a POST request with a username and read each post from the tweets array. Run the example below to see the exact shape.

Endpoint
POST /v1/data/twitter/tweets
Authentication
API key as Authorization: Bearer wh_…
Stage
Stable
Output
A tweets array with text, post time, likes, reposts, replies, quotes, bookmarks, views, media, hashtags, urls and mentions
Input
username is required and runs from 1 to 50 characters. limit is optional.
Posts per request
1 to 3200 with limit. The default is 20.
Delivery
Up to 40 posts return immediately. Above 40 the request runs as a queued job and returns HTTP 202.
Coverage fields
The sample response carries coverage, stop_reason, pages_fetched, oldest_tweet_at and newest_tweet_at
Credit weight
1. See the pricing page for current rates.

One request, structured JSON.

This request pulls 3 recent posts from the NASA account. The response below shows two of the three posts returned. Copy the request to try it yourself.

POST /v1/data/twitter/tweets
curl -X POST "https://api.datablue.dev/v1/data/twitter/tweets" \
  -H "Authorization: Bearer wh_..." \
  -H "Content-Type: application/json" \
  -d '{
    "username": "nasa",
    "limit": 3
  }'
Response (trimmed to 2 of 3 posts)
{
  "success": true,
  "username": "nasa",
  "source": "graphql",
  "count": 3,
  "tweets": [
    {
      "id": "2123907405339582769",
      "text": "RT @NASASpox: Another week of exploration, partnership, and discovery at @NASA!\n\n📡 Voyager 1 reaches one light-day from Earth\n🇯🇵 @NASAAdmin…",
      "created_at": "Fri Nov 20 22:32:40 +0000 2026",
      "likes": 0,
      "retweets": 51,
      "replies": 0,
      "views": 46744,
      "lang": "en",
      "url": "https://x.com/NASA/status/2123907405339582769",
      "author": {
        "id": "11348282",
        "username": "NASA",
        "name": "NASA",
        "blue_verified": true
      },
      "media": [],
      "hashtags": [],
      "urls": [],
      "mentions": ["NASASpox", "NASA", "NASAAdmin"],
      "is_reply": false,
      "is_retweet": true,
      "retweeted_tweet_id": "2123892108893295099",
      "is_quote": false
    },
    {
      "id": "2123820070803542306",
      "text": "LIVE: Watch as an uncrewed SpaceX Dragon spacecraft undocks from the @space_station and begins its journey to bring research samples and hardware back to Earth. https://t.co/RQEa5gYSk3",
      "created_at": "Fri Nov 20 16:45:38 +0000 2026",
      "likes": 1988,
      "retweets": 304,
      "replies": 102,
      "views": 715692,
      "lang": "en",
      "url": "https://x.com/NASA/status/2123820070803542306",
      "author": {
        "id": "11348282",
        "username": "NASA",
        "name": "NASA",
        "blue_verified": true
      },
      "media": [],
      "hashtags": [],
      "urls": [
        {
          "url": "https://t.co/RQEa5gYSk3",
          "display_url": "x.com/i/broadcasts/2…",
          "expanded_url": "https://x.com/i/broadcasts/2evOEzWEYBkWyn"
        }
      ],
      "mentions": ["Space_Station"],
      "is_reply": false,
      "is_retweet": false,
      "is_quote": false
    }
  ],
  "stop_reason": "guest_page_limit",
  "coverage": "ranked_public_sample",
  "pages_fetched": 1,
  "oldest_tweet_at": "Fri Nov 20 16:45:38 +0000 2026",
  "newest_tweet_at": "Fri Nov 20 22:32:40 +0000 2026",
  "reached_days_ago": 0.68
}

What an X post returns.

Each post arrives as one object inside the tweets array.

Post identity

Every post has an id and a text field, and the created_at field holds the post time as text. The url field links to the post on x.com. Open it to check a result by eye.

Engagement

Each post carries the likes and retweets fields. The replies and quotes fields sit beside them, and the bookmarks and views fields complete the set. Each metric has a status field, and ours read present. Check the status before you sum any metric.

Reposts and quotes

The is_retweet and is_quote flags mark reposts and quotes. A repost carries the original in a retweeted_tweet object, and the retweeted_tweet_id field holds the original post id. Both reposts in our sample showed zero likes on their own row, while the nested original carried the real counts. Filter on is_retweet to keep original posts only.

Media, links and mentions

The media array holds each attachment type and url. The urls array holds each link with its expanded_url, and the mentions array lists handles named in the post. Our sample posts carried an empty hashtags array. Read expanded_url to see where each link leads.

Author

Each post embeds an author object with an id, and the object also holds the name and a blue_verified flag. Group posts by author id when you merge timelines.

Coverage

Every response reports a coverage field and a stop_reason. In our sample the values were ranked_public_sample and guest_page_limit. Treat each run as a ranked public sample, and read reached_days_ago to see how far back the run reached. Use oldest_tweet_at and newest_tweet_at to see the span covered.

Options that shape your pull.

Only username is required for a request. Add limit when you want more or fewer posts.

Username

Set username to the handle without the @ sign, and keep the value between 1 and 50 characters. Our example request sends nasa as the username.

Post limit

Set limit from 1 to 3200 posts, and expect 20 posts when you send nothing. Our example sends 3 to keep the response short.

Immediate responses

A limit of 40 or less returns immediately, and the posts come from the public timeline page. Our example of 3 posts fetched one page.

Queued jobs

Above 40 the request runs as a queued job, and you get HTTP 202 with a job_id and a status_url. Poll the status_url until the job finishes. Then read the posts from the finished job.

No other filters

This API takes no date filter and no keyword filter. Use X Search when you start from a query.

What teams build with it.

Recent posts show what an account says right now.

Brand monitoring

Pull the latest posts from your brand account each morning, then store likes and views to see which posts landed.

Competitor tracking

Read a competitor brand account on a schedule. Count posts and sum views per week to compare reach.

Content research

Sort posts by views to find the topics that land. Read the text field of each top post.

Link and media audits

Read urls to list each link an account posts. Check media types to see how often video is used.

Why call an API instead of scraping X timelines yourself.

This API reads a timeline for you and returns a run of posts for one username. X Profile returns the account only, while X Post returns a single post by ID.

Reposts need extra care in any ranking. Both reposts in our sample showed zero likes on their own row, and the original sat inside retweeted_tweet with its own counts. Read the nested object when you rank by engagement.

Our sample reported guest_page_limit as its stop_reason, and that tells you what one call covered. Read both fields before you assume a full timeline.

Your first X posts pull in a minute.

Sign up, grab a key and pull a few posts.

  1. Create an account

    Sign up to get your API key.

  2. Send a request

    POST a username and limit to /v1/data/twitter/tweets with your key. Start with a limit of 3 while you test.

  3. Read the posts

    Loop over the tweets array in the response. Check coverage and stop_reason after each run.

Responsible use of X data.

This API covers public X data only. X publishes its own terms of service. Read them before you use the data commercially.

You are responsible for how you use the data, including privacy law in your region. This page gives general information, not legal advice. Review the DataBlue terms of service before you build.

Twitter scraper API questions.

Short answers about data and billing before you start.

It turns recent X (Twitter) posts into structured JSON. Each post is one object in the tweets array.

Send a POST request to /v1/data/twitter/tweets with a Bearer token. Put the username and a limit in the JSON body.

Each post has text and a post time, and engagement counts and media arrive with every post. Compare the fields with the sample response above.

Set limit from 1 to 3200 posts. The default is 20 when you send no value. Above 40 the request runs as a queued job. Check the count field for the number returned.

Each response reports a coverage field and a stop_reason field. In our sample the values were ranked_public_sample and guest_page_limit. Read both fields on every run to judge the span.

Reposts appear as posts with is_retweet set to true. The is_quote flag marks quote posts in the same way. A repost carries the original in retweeted_tweet.

Use X Post when you already hold the post ID. This API starts from a username instead.

This API covers public X posts only. Send the handle of a public account.

This API is marked stable in our catalogue today. Build against the documented fields, then check the changelog before each upgrade you ship to production.

This API has a credit weight of 1. Check the pricing page for current rates.

Pull recent X posts in a minute.

Create an account and copy your key. Then run the request with a brand handle you follow.

Start free