Extract Grok
Capture a structured snapshot of a Grok answer, complete with the live web sources it cited and the rich per-source metadata that Grok exposes.
Overview
This endpoint returns Grok's reply to a prompt as a parsed object rather than a raw stream. Because Grok's standard interface always consults the web, every request is grounded in real-time results, and the payload carries an unusually detailed source list. Alongside each citation you get preview snippets, publisher and author details, favicons, and image URLs, which makes the response well suited to monitoring how a brand or topic surfaces in Grok answers.
You can scope a request to a specific market with the country parameter and control which optional representations (HTML, Markdown, raw events) are attached through the include object.
Request parameters
This endpoint accepts the shared request parameters used across the AI Mode endpoints. The Grok-specific option is listed below.
| Field | Type | Description |
|---|---|---|
| prompt | string | The question or instruction to send to Grok. |
| country | string | Two-letter country code used to localize the search context (for example, US). |
| include.markdown | boolean | When true, adds a Markdown rendering of the answer. Defaults to false. |
| include.html | boolean | When true, adds an HTML rendering of the answer. Defaults to false. |
| include.rawResponse | boolean | When true, returns the underlying streamed response events emitted by Grok. Defaults to false. |
Response schema
The envelope includes the common response fields plus the Grok result object below.
| Field | Type | Description |
|---|---|---|
| result.text | string | The plain-text body of Grok's answer. |
| result.html | string | HTML rendering of the answer, present only when include.html is true. |
| result.markdown | string | Markdown rendering of the answer, present only when include.markdown is true. |
| result.sources | array | The web sources Grok drew on, each enriched with preview text, publisher, author, image, and favicon fields. |
| result.searchQueries | string[] | The search queries Grok issued while researching the prompt. |
| result.model | string | Identifier of the model that produced the answer (for example, grok-4-auto). |
| result.rawResponse | array | The streamed response events from Grok, present only when include.rawResponse is true. |
Source object fields
| Field | Type | Description |
|---|---|---|
| position | number | Ordinal rank of the source within the citation list. |
| url | string | Canonical link to the cited page. |
| label | string | Short display label for the source. |
| description | string | Brief summary of the linked page. |
| preview | string | Excerpt of the source content shown as a preview. |
| searchEngineText | string | Title text as it appeared in search results. |
| siteName | string | Name of the publishing site. |
| metadataTitle | string | Title drawn from the page's metadata. |
| creator | string | Author or byline associated with the page. |
| image | string | URL of a representative image for the source. |
| favicon | string | URL of the site's favicon. |
Response example
{
"success": true,
"result": {
"text": "Drawing on live web results, here are strong laptop picks for programming...",
"html": "https://storage.cloro.cloud/results/c45a5081-808d-4ed3-9c86-e4baf16c8ab8/page-1.html",
"sources": [
{
"position": 1,
"url": "https://techcrunch.com/programming-laptops",
"label": "TechCrunch",
"description": "Best laptops for coding and development",
"preview": "For a programming laptop, weigh RAM, CPU, and thermals before anything else...",
"searchEngineText": "Top Development Laptops 2025",
"siteName": "TechCrunch",
"metadataTitle": "Ultimate Guide to Programming Laptops",
"creator": "Tech Team",
"image": "https://techcrunch.com/preview.jpg",
"favicon": "https://techcrunch.com/favicon.ico"
}
],
"searchQueries": [
"best laptops for programming 2026",
"top developer laptops 2026"
],
"model": "grok-4-auto",
"markdown": "Drawing on live web results, here are strong laptop picks for programming..."
}
}
Notes
Grok performs a web search on every request, so responses always reflect current information and carry source citations; there is no option to disable grounding. If you need the underlying event stream for debugging or replay, set include.rawResponse to true. For access questions, reach out to [email protected].