Ask Grok
curl --request GET \
--url https://scrapebadger.com/v1/grok/ask \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/grok/ask"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/grok/ask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/grok/ask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/grok/ask"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/grok/ask")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/grok/ask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"answer_markdown": "<string>",
"conversation_id": "<string>",
"response_id": {},
"model": "<string>",
"mode": "<string>",
"citations": [
{}
],
"search_results": [
{}
],
"x_search_results": [
{}
],
"source_domains": [
"<string>"
],
"follow_up_suggestions": [
"<string>"
],
"tool_usages": [
{}
],
"web_search_triggered": true,
"x_search_triggered": true,
"truncated": true,
"elapsed_ms": 123
}Ask
Ask Grok
Ask the real Grok assistant and get the answer, web citations, X post references, tool usage, and follow-up suggestions.
GET
/
v1
/
grok
/
ask
Ask Grok
curl --request GET \
--url https://scrapebadger.com/v1/grok/ask \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/grok/ask"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/grok/ask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/grok/ask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/grok/ask"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/grok/ask")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/grok/ask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"answer_markdown": "<string>",
"conversation_id": "<string>",
"response_id": {},
"model": "<string>",
"mode": "<string>",
"citations": [
{}
],
"search_results": [
{}
],
"x_search_results": [
{}
],
"source_domains": [
"<string>"
],
"follow_up_suggestions": [
"<string>"
],
"tool_usages": [
{}
],
"web_search_triggered": true,
"x_search_triggered": true,
"truncated": true,
"elapsed_ms": 123
}Ask the real Grok assistant and receive structured JSON with web and X grounding. Accepts
GET query parameters or a POST JSON body with the same fields.
Credits: 20
Set your client timeout to at least 90 seconds for grounded answers.
Authorization
Parameters
The complete ID from a previous response. Includes prior-turn context and pins the follow-up to the owning X account.
auto lets Grok decide, force requests web and X research, and off disables those tools.Response
Inline citation cards with
card_id, url, domain, citation_index, start_index, and end_index. X citations can also include post_id and username.Example
curl "https://scrapebadger.com/v1/grok/ask?prompt=What%20is%20the%20capital%20of%20Lithuania%3F&mode=fast&web_search=off" \
-H "X-API-Key: YOUR_API_KEY" \
--max-time 90
const res = await fetch("https://scrapebadger.com/v1/grok/ask", {
method: "POST",
headers: {
"X-API-Key": process.env.SCRAPEBADGER_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ prompt: "Best web scraping APIs", web_search: "force" }),
signal: AbortSignal.timeout(90_000),
});
const data = await res.json();
console.log(data.answer);
import requests
res = requests.post(
"https://scrapebadger.com/v1/grok/ask",
headers={"X-API-Key": "YOUR_API_KEY"},
json={"prompt": "Best web scraping APIs", "web_search": "force"},
timeout=90,
)
print(res.json()["answer"])
Response
{
"answer": "The capital of Lithuania is Vilnius.",
"answer_markdown": "The capital of Lithuania is Vilnius.",
"conversation_id": "187055:2121372254449864788",
"response_id": "2121372258530926593",
"model": "grok-3-latest",
"mode": "fast",
"citations": [],
"search_results": [],
"x_search_results": [],
"source_domains": [],
"follow_up_suggestions": ["Explore Vilnius history", "Baltic states capitals"],
"tool_usages": [],
"web_search_triggered": false,
"x_search_triggered": false,
"truncated": false,
"elapsed_ms": 6845
}

