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

Ai Search Data API

Scrape X Ai Search data with one API call. Natural-language search over X (Twitter) powered by xAI's Grok 4.20 Reasoning 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 1 credit 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.

Try the X Ai Search API

See real data before writing a single line

GET/v1/twitter/ai-search

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.

4 optional parameters

Comma-separated X handles (max 10). Restricts the search to posts from these accounts only. Mutually exclusive with exclude_handles.

Comma-separated X handles (max 10) to exclude from search results. Mutually exclusive with from_handles.

ISO 8601 start date (YYYY-MM-DD). Limits the search window to posts on or after this date.

ISO 8601 end date (YYYY-MM-DD). Limits the search window to posts on or before this date.

Searching 27 platforms in parallel

·TikTok·Instagram·YouTube·Facebook·X·LinkedIn·Reddit·Threads·Pinterest·Twitch·Truth Social·Snapchat·Kick·TikTok Shop·Amazon Shop·Linktree·Komi·Pillar·lnk.bio·Facebook Ads·Google Ads·LinkedIn Ads·Google Search·Polymarket·Tavily·Hacker News·GitHub·Perplexity·UUtility·Universal Search
·TikTok·Instagram·YouTube·Facebook·X·LinkedIn·Reddit·Threads·Pinterest·Twitch·Truth Social·Snapchat·Kick·TikTok Shop·Amazon Shop·Linktree·Komi·Pillar·lnk.bio·Facebook Ads·Google Ads·LinkedIn Ads·Google Search·Polymarket·Tavily·Hacker News·GitHub·Perplexity·UUtility·Universal Search
·TikTok·Instagram·YouTube·Facebook·X·LinkedIn·Reddit·Threads·Pinterest·Twitch·Truth Social·Snapchat·Kick·TikTok Shop·Amazon Shop·Linktree·Komi·Pillar·lnk.bio·Facebook Ads·Google Ads·LinkedIn Ads·Google Search·Polymarket·Tavily·Hacker News·GitHub·Perplexity·UUtility·Universal Search
·TikTok·Instagram·YouTube·Facebook·X·LinkedIn·Reddit·Threads·Pinterest·Twitch·Truth Social·Snapchat·Kick·TikTok Shop·Amazon Shop·Linktree·Komi·Pillar·lnk.bio·Facebook Ads·Google Ads·LinkedIn Ads·Google Search·Polymarket·Tavily·Hacker News·GitHub·Perplexity·UUtility·Universal 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

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

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.
API Details

How does the X Ai Search API work?

Send a GET request with your API key and get back clean, structured JSON. Every response follows our unified schema with computed fields.

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 27 platforms covering 10B+ monthly active users.

One schema, every platform

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

Computed fields, not just scraped

Every response includes engagement_rate, estimated_reach, content_category, and language — ready to use.

No code required

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": 124000 },
    "engagement": { "likes": 5200, "engagement_rate": 0.045 },
    "metadata": { "language": "en", "content_category": "food" }
  }
}
and many more

Ready to scrape X Ai Search data?

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

Start for free