Skip to content
ScrapeField

Search X

Search X as its own search box does, newest first, about 20 a page; X's search operators work inside query (from:nasa, since:2026-09-01, lang:en). type=user finds accounts instead. Use this to follow a topic, a brand or a campaign.

13credits
GEThttps://api.scrapefield.com/v1/x/search
Try itno key needed13 credits on a real call · 0 here
https://api.scrapefield.com/v1/x/search?query=ferrari

In your code

const params = new URLSearchParams({
  "query": "nasa artemis"
});

const res = await fetch(`https://api.scrapefield.com/v1/x/search?${params}`, {
  headers: { Authorization: `Bearer ${process.env.SCRAPEFIELD_KEY}` },
});

const { data, meta } = await res.json();
console.log(data, meta.credits_charged);

Parameters

ParameterWhat it does
query
string · required
Words, a phrase, or X's search operators.
type
string
Posts, or accounts.
post · user, default post
cursor
string
The meta.next_cursor from the previous page. Omit for the first page.
fresh
boolean
Skip the cache and fetch now. Charged normally. Not available on trial credits — buy any pack to unlock it.
default false

Response

Returns an array of x_post — or, with type, x_user for user. This is the demo’s answer, the one the playground above returns, in full rather than abbreviated — including the fields that come back null, because a field is null when the platform does not show it and you should know which ones those are before you build on them. A call with your key returns the account you ask for.

{
  "data": [
    {
      "id": "1910812733210568047",
      "url": "https://x.com/creator0/status/1910812733210568047",
      "text": "We rebuilt the whole thing and it is faster now. #buildinpublic",
      "created_at": "2026-07-06T20:41:07.000Z",
      "lang": "en",
      "author": {
        "id": "212301985261993877",
        "username": "creator0",
        "name": "Creator",
        "profile_url": "https://x.com/creator0",
        "profile_image_url": "https://cdn.example/x/GTQr2LnQCzWb.jpg",
        "verified": false
      },
      "conversation_id": "1910812733210568047",
      "referenced_tweets": [],
      "public_metrics": {
        "retweet_count": 170,
        "reply_count": 77,
        "like_count": 4780,
        "quote_count": 31,
        "bookmark_count": 169,
        "impression_count": 406300
      },
      "media": [],
      "hashtags": [
        "buildinpublic"
      ],
      "mentions": []
    },
    {
      "id": "1962059407799730456",
      "url": "https://x.com/creator1/status/1962059407799730456",
      "text": "Everything I learned about this in one minute. #buildinpublic",
      "created_at": "2026-05-26T11:29:32.000Z",
      "lang": "en",
      "author": {
        "id": "416308131035770950",
        "username": "creator1",
        "name": "Creator",
        "profile_url": "https://x.com/creator1",
        "profile_image_url": "https://cdn.example/x/wBaWKE5OOk78.jpg",
        "verified": false
      },
      "conversation_id": "1962059407799730456",
      "referenced_tweets": [],
      "public_metrics": {
        "retweet_count": 509,
        "reply_count": 26,
        "like_count": 7685,
        "quote_count": 30,
        "bookmark_count": 79,
        "impression_count": 184440
      },
      "media": [
        {
          "type": "photo",
          "url": "https://cdn.example/x/media/pc35lYvCJ7EgWB.jpg"
        }
      ],
      "hashtags": [
        "buildinpublic"
      ],
      "mentions": []
    }
  ],
  "meta": {
    "request_id": "req_7f3ac1e94b2d40f8a1c6e5d2",
    "credits_charged": 13,
    "credits_remaining": 74218,
    "cached": false,
    "fetched_at": "2026-09-20T09:12:03Z",
    "next_cursor": "eyJwIjoxLCJzIjoiYTNmOSJ9"
  }
}

Fields of x_post

A post on X: a post, a reply or a quote. Named after X's API v2.

FieldWhat it is
id
string
X's id for the post.
url
URL
The post on X.
text
string · or null
The whole text. Links stay as X shortens them.
created_at
time, ISO 8601 UTC · or null
When it was posted. null when the source does not say.
lang
string · or null
The language X detected, e.g. en.
author
object
Who posted it.
author.id
string · or null
X's numeric id for the account.
author.username
string
Without the @.
author.name
string · or null
The display name.
author.profile_url
URL
The account on X.
author.profile_image_url
URL · or null
The profile picture, at full size.
author.verified
boolean · or null
Whether the account has a checkmark.
conversation_id
string · or null
The first post of the thread it belongs to.
referenced_tweets
array of objects
The post it replies to, quotes or reposts, as X's API names them.
referenced_tweets[].type
string, one of
How this post refers to it: a reply, a quote or a repost.
replied_to · quoted · retweeted
referenced_tweets[].id
string
X's id for that post.
public_metrics
object
null where the source does not give one.
public_metrics.retweet_count
integer · or null
Reposts.
public_metrics.reply_count
integer · or null
Replies.
public_metrics.like_count
integer · or null
Likes.
public_metrics.quote_count
integer · or null
Quotes.
public_metrics.bookmark_count
integer · or null
Bookmarks.
public_metrics.impression_count
integer · or null
Views.
media
array of objects
Photos and videos, in order.
media[].type
string, one of · or null
null where the source does not say.
photo · video · animated_gif
media[].url
URL
The image, or a video's preview image.
hashtags
array of strings
Without the #.
mentions
array of strings
Usernames, without the @.

Fields of x_user

An X account. Named after X's API v2.

FieldWhat it is
id
string
X's numeric id for the account.
username
string
Without the @.
name
string · or null
The display name.
description
string · or null
The bio.
location
string · or null
As they wrote it.
url
URL · or null
The link in their profile, unshortened, as X's API names it.
profile_url
URL
The account on X.
profile_image_url
URL · or null
The profile picture, at full size.
profile_banner_url
URL · or null
The header image above the profile.
created_at
time, ISO 8601 UTC · or null
When the account was made.
verified
boolean · or null
Whether it has a checkmark, of any kind.
protected
boolean · or null
Whether its posts are private.
public_metrics
object
The counts on the profile. null where the source does not give one.
public_metrics.followers_count
integer · or null
How many accounts follow them.
public_metrics.following_count
integer · or null
How many accounts they follow.
public_metrics.tweet_count
integer · or null
Posts, replies and reposts together, as X counts them.
public_metrics.listed_count
integer · or null
How many lists include them.
public_metrics.like_count
integer · or null
Posts they have liked.
public_metrics.media_count
integer · or null
Posts with photos or videos.
pinned_tweet_id
string · or null
The id of the post pinned to the profile. null where there is none, or the source does not say.

What it costs

13 credits per successful call, whether we fetch it or serve it from cache — you pay for the answer, not for how we produced it. Responses are cached for 30 minutes and a cached one tells you when the data was actually fetched. A call we fail costs 0 and is refunded automatically.

On the smallest pack that is $10.14 per 1,000 calls; on the largest, $5.72. The full table.

What people build with it

Questions

How much does the X (Twitter) search API cost?

13 credits a call: $10.14 per 1,000 calls on the smallest pack and $5.72 on the largest. A call that fails costs nothing, and the refund is automatic. A cached answer costs the same as a fresh one. Credits are bought in packs and never expire; there is no subscription.

Do I need a X account, a login or cookies?

No. You need a key from us and nothing from X. We never take a customer's login, cookies or session, at any price, and no account of yours is ever at risk.

Can I try it without signing up?

Yes. Add demo=true and leave the key out, or press Send request in the playground on this page. The demo answers with a real answer about Ferrari, captured once a week, in exactly the shape a live call returns, whatever you ask, and charges nothing.

How fresh is the data?

An answer is kept for up to 30 minutes, and a cached one says when it was fetched, in meta.fetched_at. Add fresh=true to fetch it again now, at the same price; it needs any purchase, not the trial.

What does it return?

A list of x_post objects. Its fields are named after X's API v2. A field is null when X does not show it, never missing. Every field is described on this page.

How do I get more than one page?

Pass meta.next_cursor back as cursor, and stop when it is null. Each page is a call, priced the same. A cursor lasts as long as the answer it belongs to is cached.

Can an AI agent call it?

Yes: it is the MCP tool search_x on our MCP server, with the same parameters, answer and price. Without a key, the tool answers from the demo.