InsightSocial API
Twitter/X

Ai Search

GET
/v1/twitter/ai-search

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. A thin answer means thin retrieval, not an empty corpus, so confirm coverage with search/tweets.

100 credits per call.

Re-running the exact same call within 1h is free.

x-api-key<token>

Your key from the dashboard. It starts with isk_.

In: header

Query Parameters

query*string

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?string

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

exclude_handles?string

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

from_date?string

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

to_date?string

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

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/twitter/ai-search?query=string"
{  "success": true,  "platform": "instagram",  "endpoint": "/v1/instagram/profile/posts",  "data": {    "items": [      "…"    ],    "dropped": 0  },  "pagination": {    "next_cursor": "is2.eyJwIjoyfQ",    "has_more": true,    "page_size": 12  },  "credits_used": 20,  "credits_remaining": 9980,  "request_id": "req_1a2b3c4d5e6f",  "cached": false,  "idempotent_replay": false,  "charge_reason": "miss",  "free_call": false}