InsightSocial API
Twitter/X

Twitter/X AI Search API reference

Your first 10 calls are free, no card needed. Pricing and FAQ

Get a free API key
Example request
curl "https://api.insightsocial.app/v1/twitter/ai-search?query=What%20is%20%40elonmusk%20saying%20about%20xAI%20this%20week%3F" \
  -H "x-api-key: $INSIGHTSOCIAL_API_KEY"
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.

Beta. The source's own structure under our naming rules (snake_case keys, string ids, ISO times where the source gives a timestamp), not one of the schema-2 entities. Fields may change. See Schema 2.

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.

50 credits per call.

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.

dry_run?"1"

Set to 1 to get the price of this call without making it: data.dry_run carries credits_min and credits_max. Nothing is charged.

Value in

  • "1"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.insightsocial.app/v1/twitter/ai-search?query=string"
{  "success": true,  "platform": "string",  "endpoint": "string",  "schema_version": "2",  "pagination": {    "next_cursor": "string",    "has_more": true,    "page_size": 0,    "stopped_at": "since"  },  "unavailable": [    "string"  ],  "credits_used": 0,  "credits_remaining": 0,  "request_id": "string",  "cached": true,  "idempotent_replay": true,  "charge_reason": "string",  "free_call": true,  "data": {    "property1": null,    "property2": null  }}