Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.scrapellm.com/llms.txt

Use this file to discover all available pages before exploring further.

The Grok endpoint sends any prompt to xAI’s Grok and returns the response as structured JSON. Grok is the only major AI assistant with native X (Twitter) integration — the x_results field exposes real X posts that Grok surfaces alongside its web answer.
X (Twitter) posts includedEvery response includes x_results — real posts from X that Grok pulled in to inform its answer. No other AI scraper surfaces this data.

Overview

Use Grok to track brand sentiment on X, monitor real-time reactions to news, and understand what the X community is saying about any topic — all grounded in Grok’s AI-synthesised answer. The three reasoning modes let you trade off speed versus depth depending on your use case.

Unique features

  • X posts: Real posts from X (Twitter) that Grok cited — includes post text, author, view count, and timestamp
  • Web sources: Standard web citations alongside the X posts
  • Three reasoning modes: AUTO, FAST, and EXPERT for different speed/depth trade-offs
  • Related questions: Grok’s suggested follow-up questions

Request parameters

prompt
string
required
The prompt to send to Grok. Maximum 4,000 characters.
country
string
default:"US"
ISO 3166-1 alpha-2 country code. JP and TW are not supported.
mode
string
default:"MODEL_MODE_AUTO"
Grok reasoning mode. See modes table below.
bypass_cache
boolean
default:"false"
Skip the response cache and always fetch a fresh result.
timeout
float
default:"300"
Maximum seconds to wait for Grok to respond (10–600).

Modes

ModeDescription
MODEL_MODE_AUTOGrok selects the model automatically (default)
MODEL_MODE_FASTQuick responses using Grok mini
MODEL_MODE_EXPERTDeeper reasoning using the full Grok model
3 credits per request

Example request

curl "https://api.scrapellm.com/scrapers/grok" \
  -H "X-API-Key: YOUR_API_KEY" \
  -G \
  --data-urlencode "prompt=What are people on X saying about email marketing tools?" \
  --data-urlencode "country=US" \
  --data-urlencode "mode=MODEL_MODE_AUTO"

Response schema

Includes common response fields plus:
FieldTypeDescription
resultstringPlain-text response from Grok
result_markdownstringMarkdown-formatted response
web_sourcesarrayWeb citations — each has title, url, and preview
web_sources[].titlestringArticle title
web_sources[].urlstringSource URL
web_sources[].previewstringText excerpt from the source
x_resultsarrayReal X posts Grok surfaced
x_results[].post_idstringX post ID
x_results[].user_namestringX handle (without @)
x_results[].namestringDisplay name of the X user
x_results[].textstringFull text of the post
x_results[].view_countintegerNumber of views
x_results[].create_timestringISO 8601 timestamp of the post
related_questionsarrayGrok’s suggested follow-up questions
modestringThe reasoning mode used
llm_modelstringGrok model used (e.g. grok-3)
credits_usedintegerCredits consumed — always 3 for Grok
elapsed_msfloatEnd-to-end request duration in milliseconds
cachedbooleantrue if served from cache

Common questions

Which countries are not supported?

JP (Japan) and TW (Taiwan) are not currently supported. Requests with these country codes will return an error.

When should I use MODEL_MODE_EXPERT?

For complex research questions where depth matters more than speed — competitor analysis, in-depth market research, or multi-faceted topics. Expert mode takes longer but produces more thorough answers.

Are X posts always present in the response?

No. X posts only appear when Grok determines they’re relevant to the query. Social-focused questions like “What are people saying about X?” are more likely to surface posts than technical or factual queries.