Grok scraper API
Grok's answer with its cited sources, including X posts, and the searches it ran.
Price
$2.18 per 1,000 requests on every plan, deducted from your prepaid USD balance.
Endpoint
POST /v1/monitor/grok
Countries
Any country.
Request
curl -X POST "https://api.answerline.dev/v1/monitor/grok" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"Which electric car brands do people recommend?","country":"US"}'
import { Client } from "@answerline/sdk";
const client = new Client({ apiKey: process.env.API_KEY! });
const answer = await client.monitor.grok({
"prompt": "Which electric car brands do people recommend?",
"country": "US"
});
import os
from answerline import Client
with Client(os.environ["API_KEY"]) as client:
answer = client.monitor.grok(
prompt="Which electric car brands do people recommend?",
country="US",
)
What you get back
Field in result | Type | Description |
|---|---|---|
text | string | Text of the answer from Grok |
markdown | string | Grok's answer rendered as Markdown (returned if include.markdown is set to true) |
links | object[] | The links in the answer's text, in the order a reader meets them: one entry per web (http or https) link the answer shows, images and code aside, with the words it shows (text), where it goes (url), its domain and its 1-based position. Sources cited by pills are in citationPills; links to the same page appear in both when the answer does both. Empty when the text links nowhere. |
sources | object[] | Sources the response cites, with extra metadata |
searchQueries | string[] | Searches Grok ran to collect material for the response |
relatedQueries | string[] | Follow-up questions Grok suggests under its answer, in its order. Absent when it suggests none. |
model | string | Identifier of the model that produced the response |
The Grok app answer versus xAI’s API
This endpoint returns the answer a user gets from the consumer Grok app, with the sources it cited (web pages and X posts), the searches it ran and the model identifier.
xAI’s developer documentation (checked 2026-09-17, docs.x.ai) describes search tools for API calls: a web search tool that lets Grok search the web in real time and browse pages, an X search tool, and domain filters (allowed_domains, excluded_domains). With the API you choose the model, the instructions and which tools and domains are allowed.
Those settings shape what your call cites, so an API run tells you what Grok cites under your configuration. The app answer shows what it cites for the public.
Grok also cites X posts alongside web pages. Brands whose reputation lives in posts and threads need to know which posts and authors the public answer draws on, and sources[].creator makes that attributable. Run the same prompt set through ChatGPT or Gemini and you get each consumer product’s answer in one schema family, so share-of-voice numbers compare directly.
An annotated response
The excerpt follows the result schema for POST /v1/monitor/grok. Values are illustrative; the request set include.markdown to true.
{
"success": true,
"result": {
"text": "Recommendations vary by budget. Owners frequently mention...",
"markdown": "Recommendations vary by budget.\n\n- **Range:** owners frequently mention...",
// Web pages first, then X posts.
"sources": [
{
"position": 1,
"url": "https://www.example-ev-review.com/long-range-evs-2026",
"label": "Longest-range EVs of 2026",
"description": "Range test results for...",
"preview": "We drove twelve EVs until empty..."
},
{
"position": 2,
"url": "https://x.com/example_owner/status/1900000000000000000",
"label": "Example Owner", // the author's display name
"preview": "Six months in, charging on the road has been...", // the post text
"creator": "example_owner" // the handle
}
],
// The searches Grok ran on the web and on X. Absent when there are none.
"searchQueries": ["electric car owner recommendations 2026"],
// Nullable model identifier.
"model": "grok-example"
}
}
result.provenance reads searchMode engine-default (all fields).
Notes for this engine
- Grok shows no citation chips, so
citationPillsis always empty. Count citations fromsources. - A US
stateis accepted and answered for the whole US; only ChatGPT and Gemini answer from inside a state (states). sources[].positionis a number. Every other source field buturlis optional.siteName,metadataTitle,searchEngineText,imageandfaviconare in the contract but empty on the answers served today.- Citation chips are removed from
textandmarkdown. modelis nullable. Record it with each run so you can segment results when the served model changes.- To split web pages from X posts, check for
creatoror classify eachsources[].urlby host (x.com).
When answers cite posts, the set of sources can change within hours. Compare runs from the same time window, and keep the period in the idempotency key so each window is a separate sample. Within a window, run each prompt several times and report how often a source or claim appears; see sampling vs census.
description, preview, creator and the other enrichment fields are optional. Don’t make them required columns.
Substring checks flag negations (“no recall”) as hits. Use them to route answers to review, not as the final classification.
Related: the best Grok scrapers compared, every request field, brand protection, monitoring Grok, brand crisis AI monitoring, news monitoring, threat intelligence, AI visibility tracking.
Questions
How much does a Grok request cost?
A request costs $0.00218. No include flag changes that: markdown, rawResponse and rawWire are free. include.html links a copy of the answer's public page on grok.com and include.screenshot a picture of it, also free.
Does the Grok endpoint return X posts as sources?
Yes. X posts come back in result.sources beside web pages. A post carries url (https://x.com/{handle}/status/{id}), label (the author's display name), preview (the post text) and creator (the handle). A web page carries url, label, description and preview.
How is this different from xAI's API?
xAI's API gives developers search tools for their own Grok calls. This endpoint returns the answer the consumer Grok app shows, with its cited sources, the searches it ran and the model identifier as fields.
Does Grok return citation pills like the other engines?
No. Grok shows no citation pills, so citationPills is always empty. The result also has text, markdown, links, sources, searchQueries, relatedQueries, model and rawResponse. Count citations from sources.
Can I target a US state with Grok?
No. Grok accepts a US state, which implies country US, and answers for the whole US, the same as without it. See /docs/coverage#states.
Is a failed Grok request charged?
No. A failed request is charged nothing and its reservation is released. A completed request is charged its base price; rawResponse costs nothing extra.
From the blog
Best Grok scraper APIs for 2027: answers and X post sources
Track brand mentions in Grok answers
Brand crisis monitoring: catch it in AI answers first
Docs
- Quickstart
- API reference
- Engine features
- Async tasks and batches
- Webhooks
- Coverage
- Pricing and failures
- Rate limits