Insight Social
GET /v1/twitter/ai-searchbeta

Twitter/X AI Search API

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.

50 credits a call · single call · failed calls free · 10 free calls to start

curl "https://api.insightsocial.app/v1/twitter/ai-search?query=What+is+%40elonmusk+saying+about+xAI+this+week%3F" \
-H "x-api-key: $INSIGHTSOCIAL_API_KEY"
200 OKJSON
{
"success": true,
"platform": "twitter",
"endpoint": "/v1/twitter/ai-search",
"schema_version": "2",
"data": {
"<field>": "<value>"
},
"unavailable": [],
"credits_used": "<integer>"
}

When to use it

Use it for open questions such as what an account has said about a topic this week. A thin answer means thin retrieval, not an empty corpus, so confirm coverage with search/tweets.

Parameters

Query parameters for GET /v1/twitter/ai-search. Send your key in the x-api-key header.

NameRequiredDescription
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.

Response

This endpoint returns the platform's own fields in data, in snake_case, rather than a unified post or profile. The reference page lists them.

Every field, error and example is in the Twitter/X AI Search API reference.

How much does the Twitter/X AI Search API cost?

50 credits per successful call.

  • Failed calls are free

    A call that errors or finds nothing costs 0 credits.

  • Know the price first

    Add dry_run=1 and the response quotes the call without making it. Nothing is charged.

  • One balance

    API calls and Chrome extension exports share the same credits, on the free plan too.

Twitter/X AI Search API: frequently asked questions

Send GET /v1/twitter/ai-search with the query parameter and your key in the x-api-key header. 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.