100 free credits — no credit card required.Start building
Logo
100 free credits — no credit card required

X Ai Search API

Scrape X Ai Search data with one API call. Natural-language search over X (Twitter) powered by xAI's Grok 4.3 model with the built-in x_search tool. Returns a synthesised answer plus X source citations. Pin results to specific authors via from_handles (or exclude with exclude_handles), and narrow to a time window with from_date / to_date. Costs 5 credits per call regardless of how many internal x_search invocations the model performs (see tool_calls_count in the response for visibility). Auto-refunds on upstream failure. Best for freeform questions like 'what is @elonmusk saying about xAI this week' that would otherwise require multiple structured calls to /v1/twitter/profile, /v1/twitter/user/tweets, etc.

Last updated August 2026Maintained by the SocialCrawl team

Returns a written answer to a plain-English question about X (Twitter), the X posts cited as sources, and how many searches the model ran.

Use it for open questions such as what an account has said about a topic this week, which profile and user/tweets would take several calls to answer.

Searching 48 platforms in parallel

·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Google Finance logoGoogle Finance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility·Universal Search logoUniversal Search
·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Google Finance logoGoogle Finance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility·Universal Search logoUniversal Search
·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Google Finance logoGoogle Finance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility·Universal Search logoUniversal Search
·TikTok logoTikTok·Instagram logoInstagram·YouTube logoYouTube·Facebook logoFacebook·X logoX·LinkedIn logoLinkedIn·Reddit logoReddit·Threads logoThreads·Pinterest logoPinterest·Twitch logoTwitch·Truth Social logoTruth Social·Snapchat logoSnapchat·Kick logoKick·Bluesky logoBluesky·Kwai logoKwai·Rumble logoRumble·Spotify logoSpotify·TikTok Shop logoTikTok Shop·Amazon Shop logoAmazon Shop·Google Shopping logoGoogle Shopping·Trustpilot logoTrustpilot·TripAdvisor logoTripAdvisor·Linktree logoLinktree·Komi logoKomi·Pillar logoPillar·lnk.bio logolnk.bio·Facebook Ads logoFacebook Ads·Google Ads logoGoogle Ads·LinkedIn Ads logoLinkedIn Ads·Google Search logoGoogle Search·Google News logoGoogle News·Google Finance logoGoogle Finance·Polymarket logoPolymarket·Tavily logoTavily·Hacker News logoHacker News·GitHub logoGitHub·Perplexity logoPerplexity·Naver logoNaver·Utility·Universal Search logoUniversal Search
X API

What can you do with the Ai Search API?

The Ai Search endpoint gives you structured X data with computed fields in a single request. No scraping infrastructure to build or maintain.

Example Request

curl -H "x-api-key: YOUR_API_KEY" \
  "https://www.socialcrawl.dev/v1/twitter/ai-search?query=What+is+%40elonmusk+saying+about+xAI+this+week%3F"
import requests

response = requests.get(
    "https://www.socialcrawl.dev/v1/twitter/ai-search",
    params={
    'query': 'What is @elonmusk saying about xAI this week?',
    },
    headers={"x-api-key": "YOUR_API_KEY"},
)

data = response.json()
const response = await fetch(
  "https://www.socialcrawl.dev/v1/twitter/ai-search?query=What+is+%40elonmusk+saying+about+xAI+this+week%3F",
  {
    headers: { "x-api-key": "YOUR_API_KEY" },
  },
);

const data = await response.json();

Parameters

ParameterRequiredDescription
queryYesNatural-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_handlesNoComma-separated X handles (max 10). Restricts the search to posts from these accounts only. Mutually exclusive with exclude_handles.
exclude_handlesNoComma-separated X handles (max 10) to exclude from search results. Mutually exclusive with from_handles.
from_dateNoISO 8601 start date (YYYY-MM-DD). Limits the search window to posts on or after this date.
to_dateNoISO 8601 end date (YYYY-MM-DD). Limits the search window to posts on or before this date.
Example Response

What does the X Ai Search API return?

This example shows the endpoint's response shape and fields. Values are illustrative; this is not a live capture.

Example response
{
  "success": true,
  "platform": "twitter",
  "endpoint": "/v1/twitter/ai-search",
  "data": {
    "answer": "Elon Musk recently posted about xAI's new reasoning model, highlighting its real-time X search capability...",
    "sources": [
      {
        "url": "https://x.com/elonmusk/status/1234567890",
        "title": "elonmusk on X"
      }
    ],
    "tool_calls_count": 1
  },
  "credits_used": 5,
  "credits_remaining": 95,
  "request_id": "req-a1b2c3d4e5f6",
  "cached": false
}

Illustrative fixture for the documented response shape. Values are examples, not a production capture.

API Details

How does the X Ai Search API work?

Send a GET request with your API key and get back clean, structured JSON in our unified schema. Supported computed fields are populated when the source provides the required inputs.

Method

GET

Response

JSON

Why SocialCrawl

Why use SocialCrawl for X Ai Search data?

We handle the complexity of X data extraction so you can focus on building. Unified schema, AI enrichment, and zero platform logic in your code.

Developer First

How do you scrape social media data in seconds?

The fastest social media scraping API for developers. Scrape profiles, posts, comments, and analytics from 48 platforms covering 10B+ monthly active users.

One schema, every platform

Query 48 platforms with identical response structures. Write your integration once.

Computed fields, not just scraped

When an endpoint supports these metrics and the source provides the required inputs, the normalized record includes engagement_rate, estimated_reach, content_category, and language — ready to use.

See your data before you code

Visual Data Explorer — paste any URL, get rich result cards, sortable tables, CSV export.

import requests

response = requests.get(
    'https://www.socialcrawl.dev/v1/tiktok/profile',
    params={'handle': 'charlidamelio'},
    headers={'x-api-key': 'sc_YOUR_API_KEY'}
)
data = response.json()
[ .JSON ]
{
  "success": true,
  "platform": "tiktok",
  "data": {
    "author": {
      "username": "charlidamelio",
      "followers": 152400000
    },
    "engagement": {
      "likes": 12400000000,
      "engagement_rate": 0.087
    },
    "metadata": {
      "language": "en",
      "content_category": "lifestyle"
    }
  }
}
+ 48 platforms
FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
What is the Twitter AI Search API?
The Twitter AI Search API runs a natural-language query against live X (Twitter) posts using xAI's Grok model and returns a written answer grounded in the posts it read. Send a GET request to /v1/twitter/ai-search with your query, no X developer account needed.
How is AI search different from regular tweet search?
Regular search returns raw matching tweets; AI search reads across live X posts and returns a synthesized answer to your question. Use it when you want a take on what X is saying about a topic instead of a list of tweets to parse yourself.
Can I scope the Twitter AI search to specific accounts or dates?
Yes. Use from_handles to limit the search to certain accounts, exclude_handles to drop accounts, and from_date and to_date to bound the time window. Combine them to focus on a campaign, an event window, or a single creator's posts.
Which model powers Twitter AI search?
It runs on xAI's Grok, which has live access to X (Twitter). SocialCrawl routes the call for you, so you authenticate with one x-api-key instead of managing an xAI account, X API access, and billing separately.
How much does the Twitter AI Search API cost?
Each AI search costs 5 credits on the advanced tier, no matter how many posts Grok reads. New accounts get 100 free credits with no credit card, so you can try a range of questions before paying anything.

Ask AI about SocialCrawl

Ready to scrape X Ai Search data?

Get your API key and start pulling X data in under 60 seconds.

Start for free

🤖 AI agent or LLM? Read this page as markdown