Platforms · X (Twitter)

X (Twitter) AI Search Scraper API

Pin results to specific authors via from_handles (or exclude with exclude_handles), and narrow to a time window with from_date / to_date. Read a thin answer as thin retrieval, never as an empty corpus. This is a discovery surface: the model runs a handful of internal searches and answers from what they returned, so a reply such as 'limited posts appear on this topic' is a statement about that retrieval, not about X. Keyword search over the same window routinely finds substantially more. A call usually takes 10 to 30 seconds.

GET /api/v1/data/x/ai-search · 5 credits per call · The same call repeated within 30 minutes may get the same answer, so data can be up to 30 minutes old.

Inputs

  • query (required): Natural-language prompt describing what you want to learn from X. The model autonomously searches X using the x_search tool with any handle / date filters you provide.
  • from_handles: Comma-separated X handles (max 10). Restricts the search to posts from these accounts only. Mutually exclusive with exclude_handles.
  • exclude_handles: Comma-separated X handles (max 10) to exclude from search results. Mutually exclusive with from_handles.
  • from_date: ISO 8601 start date (YYYY-MM-DD). Limits the search window to posts on or after this date.
  • to_date: ISO 8601 end date (YYYY-MM-DD). Limits the search window to posts on or before this date.

What comes back

  • result_status (string): success, or not_available when the item does not exist, was removed or is not public.
  • source_data.answer (string): The model's written answer, summarising the posts it found on X.
  • source_data.sources (array): The X posts the answer cites. Empty when the model cited none.
  • source_data.sources.title (string): The cited page's title.
  • source_data.sources.url (string): The link to the X post or page the answer cites.
  • source_data.tool_calls_count (integer): How many X searches the model ran to build the answer. A higher number means it dug deeper.
  • source_data (object): Everything the platform sent for this call, as it came.

Good to know

  • Each call costs 5 credits. A call that finds nothing, or fails, is free.
  • The same call repeated within 30 minutes may get the same answer, so data can be up to 30 minutes old.

Example call

GET /api/v1/data/x/ai-search?query=What+is+%40elonmusk+saying+about+xAI+this+week%3F

Questions

How much does the X (Twitter) AI Search API cost?

Each call costs 5 credits. A call that finds nothing, or fails, costs nothing.

What do I send?

You must send query. 4 more inputs are optional: from_handles, exclude_handles, from_date and to_date. Inputs go in the query string of a GET, or as JSON in a POST, along with your API key.

How fresh is the data?

The same call repeated within 30 minutes may get the same answer, so data can be up to 30 minutes old.

Do I need an X (Twitter) account or developer app?

No. You call SocialHz with your SocialHz API key, and the same key works for every platform.

Can I try it before paying?

Yes. Signing up gives you 10 free credits, with no card needed.

More X (Twitter) scraper APIs