AI answers
What Gemini and ChatGPT answer to a prompt, as a visitor who is not signed in sees it: the text and the sources it cites, in order.
What Gemini and ChatGPT answer to a prompt, as a visitor who is not signed in sees it: the text and the sources it cites, in order.
At a glance
Track whether your brand and pages appear in AI answers. Each call asks one prompt of one assistant and answers { endpoint, url, credits, duration_ms, data } with data in one shape (AiAnswer): prompt, model, text (markdown), citations, refused and search_queries.
Every citation has position (1, 2, 3… in the order the assistant lists its sources), url (the page itself, never a redirect link or tracking parameters), title (null when unknown) and domain. Call-to-action links such as "Visit example.com" are not sources and are left out. A source appears once, however often the answer leans on it. An answer that cites nothing has an empty citations list. refused is true when the assistant declined to answer. search_queries lists what it searched for when it says, and is null when it does not.
An answer we could not read (blocked, or no answer came back) is 502 TARGET_FAILED and costs nothing; you never get an empty answer instead.
Endpoint | Asked from | Typical |
|---|---|---|
|
| about 250,000 answers per credit, 5–10 s |
|
| about 10,000 answers per credit, 8–20 s |
Answers vary from one call to the next, as they do for any visitor: ask the same prompt more than once to measure how often a brand appears. country sets where the visitor appears to be, and zip narrows that to a US area; both change what is searched and cited.
Gemini
Parameter | Type | Default | Description |
|---|---|---|---|
| string | — | What to ask, up to 2,000 characters. |
| string |
| Two-letter country to ask from. |
| string | — | A 5-digit US ZIP code. Results reflect that area (local prices, stock and nearby results). Unknown ZIP codes are a free 400. |
- cURL
- Python
- Node.js
curl -G "https://api.scrapelyserp.com/v1/structured/gemini/answer" \
-H "Authorization: Bearer $SCRAPELY_API_KEY" \
--data-urlencode "prompt=What is the best CRM for a small business?" \
-d country=usimport os
import requests
HEADERS = {"Authorization": f"Bearer {os.environ['SCRAPELY_API_KEY']}"}
r = requests.get(
"https://api.scrapelyserp.com/v1/structured/gemini/answer",
headers=HEADERS,
params={
"prompt": "What is the best CRM for a small business?",
"country": "us",
},
timeout=30,
)
r.raise_for_status()
data = r.json()
a = data["data"]
print(a["text"])
for c in a["citations"]:
print(c["position"], c["domain"], c["url"])const res = await fetch(`https://api.scrapelyserp.com/v1/structured/gemini/answer?${new URLSearchParams({ prompt: 'What is the best CRM for a small business?', country: 'us' })}`, {
headers: { Authorization: `Bearer ${process.env.SCRAPELY_API_KEY}` },
signal: AbortSignal.timeout(30_000),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
const a = data.data;
console.log(a.text);
for (const c of a.citations) console.log(c.position, c.domain, c.url);Full reference → GET /v1/structured/gemini/answer
ChatGPT
ChatGPT answers with web search, as a visitor who is not signed in sees it. text marks where it cites a source with [n], meaning citations[n - 1].
Parameter | Type | Default | Description |
|---|---|---|---|
| string | — | What to ask, up to 2,000 characters. |
| string |
| Two-letter country the visitor appears to be in. |
| string | — | A 5-digit US ZIP code. Results reflect that area (local prices, stock and nearby results). Unknown ZIP codes are a free 400. |
Full reference → GET /v1/structured/chatgpt/answer