Skip to main content
GET
Ask Gemini
Ask the real gemini.google.com a question anonymously and get the answer back as JSON — plus every web source Gemini retrieved, which of those it cited, and exactly which span of the answer each citation supports. Accepts GET (query params) or POST (JSON body) with identical fields. Credits: 20
This is a live answer, not a cache — with web search the call can take tens of seconds. Set your client timeout to at least 60 s.

Authorization

string
required
Your ScrapeBadger API key.

Query Parameters

string
required
The question to ask. Maximum 4,096 characters. Each request is standalone — there is no conversation memory, so include all the context you need here.
string
default:"US"
ISO-3166 alpha-2 egress country, e.g. US, GB, DE. Changes the localised results Gemini retrieves.
Whether Gemini should ground the answer with a web search. One of:
  • auto — let Gemini decide (default).
  • force — instruct it to search the web.
  • off — answer from the model’s own knowledge only.
Check web_search_triggered in the response for what actually happened.
string
deprecated
Not supported — returns 422. Signed-out Gemini refuses image questions, so this fails immediately and is never billed. Use ChatGPT /ask for image input.
string
deprecated
Not supported — returns 422. Same as image_url above.
Anonymous gemini.google.com neither reads nor GENERATES images — its logged-out page gates both behind a login — so no request to this endpoint can answer about a picture or return one it drew. images in the response is what the answer displayed.

Response

string
Echo of the prompt you sent.
string
The answer as plain text. Citation offsets index into this string.
string | null
The answer with its original Markdown formatting, when available.
Citation[]
The sources Gemini actually referenced in the answer.
SearchResult[]
The full set Gemini retrieved — including results it looked at but did not cite. Empty when web_search_triggered is false.
MediaItem[]
Images the answer displayed — product shots, article art and other pictures a web-grounded answer pulls in. Favicon-sized assets are excluded. Never a generated image: see the warning above.
string[]
Distinct hostnames across the cited sources — a quick view of who Gemini trusted.
boolean
Whether Gemini actually grounded this answer with a web search.
boolean
true when the render budget expired while Gemini was still writing, so answer is the partial text produced so far.
string | null
Which model answered — a Gemini Flash-Lite build. Reported, not requestable.
string | null
Identifier of the one-shot exchange. Not a handle you can continue from.
string | null
Identifier of the answer message.
string
Echo of the egress country used.
integer
Length of answer in characters.
integer
Number of entries in citations.
integer
End-to-end time to produce the answer, in milliseconds.
number | null
Answer creation time as a Unix timestamp.
string | null
Answer creation time as an ISO-8601 UTC string.

Example

Response
search_results is the full retrieved set; citations is the subset that made it into the answer. When web_search_triggered is false, both are empty and Gemini answered from its own knowledge — that is a valid response, not an error.

Asking about an image

Gemini cannot answer about an image, and this endpoint no longer tries.Passing image_url or image_base64 returns 422 with "code": "image_not_supported". Nothing is billed and no browser is spent.The upload itself works — the picture reaches Google and the prompt reaches the conversation — but signed-out sessions get PERMISSION_DENIED back from Gemini’s own answer-generation call, so no answer is ever produced. The same request without a picture answers normally in a few seconds. This is a Google restriction on anonymous sessions, not a limit we impose, and there is no request shape that works around it.Use ChatGPT /ask instead — it takes image_url or image_base64 and answers about the picture.
Returns 422
Gemini is non-deterministic. The same prompt can return different wording and different sources on each call. For tracking, sample on a schedule and aggregate.