For the complete documentation index, see llms.txt. This page is also available as Markdown.

Gemini

The Gemini API endpoint fetches response data from a results page of a Gemini prompt. Results can be returned in raw HTML format or as a structured JSON format.

curl --request GET \
--url "https://api.scraperapi.com/structured/google/gemini?api_key=API_KEY&\
query=QUERY&output_format=OUTPUT_FORMAT&include_html=Boolean"

Async Request

curl -s -X POST \
"https://async.scraperapi.com/structured/google/gemini" \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"query": "PROMPT_TEXT",
			"output_format": "OUTPUT_FORMAT",
		  "include_html": "true"
		}'

Async Response

After the job(s) finish, you will find the response payload by polling the statusURL.

Supported Parameters

Parameters
Details

API_KEY (required)

Your API Key.

QUERY (required)

The prompt to send to Gemini.

OUTPUT_FORMAT

json returns parsed structured data (default). html returns raw HTML.

INCLUDE_HTML

Determines whether raw HTML is included in the response (this can increase the size of the response). Can be set to true or false (default).

JSON Response

Field Reference

Field
Type
Always present?
Notes

query

string

yes

Echoed prompt

url

string | null

yes

Result/thread URL

model

string | null

yes

Best-effort. null when not surfaced

answer

string (Markdown)

yes

The answer body

sources[]

array of object

yes (may be empty)

{ title, url, domain, snippet }

related_queries[]

array of string

yes (may be empty)

Follow-up suggestions

Specifics

model

  • Populated for Gemini. For example 3.5 Flash.

sources

  • Empty when the answer was not web-grounded (common for plain Gemini answers that did not trigger a web search).

  • snippet

  • domain is normalized to a bare hostname (www. stripped) across all engines.

Pricing

Gemini queries run on ScraperAPI's standard credit system.

Request Type

Credits Charged

Any Parameter

25

Last updated