x_search
Search X posts and profiles by keyword, handles, and date range.
Instructions
Query X posts and profiles using xAI's real-time X search tool.
Args:
prompt: The search question or instruction.
allowed_x_handles: Restrict search to posts from these X handles.
from_date: Earliest post date, ISO format (e.g. "2026-06-01").
to_date: Latest post date, ISO format (e.g. "2026-07-01").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| to_date | No | ||
| from_date | No | ||
| allowed_x_handles | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Structured payload for web_search / x_search / code_execution. | |
| text | No | Human-formatted output (includes footers, citations, cost summary). | |
| model | Yes | Actual executing model ID (e.g. 'grok-4.5'). | |
| plane | No | API | |
| route | Yes | High-level route (fast/agentic/research/etc.). | |
| tokens | No | Total tokens consumed. | |
| profile | No | Internal routing profile. | |
| cost_usd | No | Exact USD cost from xAI billing metadata. | |
| response | Yes | Raw model output or primary content. | |
| citations | No | Native xAI/X citations with URL + snippet. | |
| latency_sec | No | ||
| finish_reason | No | unknown | |
| reasoning_effort | No | Grok 4.5+ native reasoning level. |