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

Gemini

Extract Gemini responses by submitting prompts and receive parsed data as structured JSON, plain text or Markdown.

The gemini source lets you submit a prompt to Google Gemini and receive a parsed, structured response, including the plain text and Markdown answers.

Request samples

The following code examples show how to submit a prompt and retrieve a Gemini response with parsed results.

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "gemini",
        "prompt": "best supplements for better sleep",
        "parse": true,
        "geo_location": "United States"
    }'

Note: JavaScript rendering is enabled by default for all LLM sources. You do not need to include rendering parameters in your request payload.

We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration (including batch queries), refer to the integration methods section.

Request parameters

Basic setup and customization options for scraping Gemini.

Parameter
Description
Default Value

source

Sets the scraper target. Use gemini.

prompt

The prompt or question to submit to Gemini. Must be under 8000 characters.

parse

Set to true for structured JSON data.

false

geo_location

Specify a country to route the request from. More info.

callback_url

URL to your callback endpoint. More info

- mandatory parameter

Structured data

Web Scraper API is capable of extracting a JSON object that contains Gemini output, offering structured data on various elements of the results page.

gemini structured output

Output data dictionary

All LLM targets return the same top-level job and results[] envelope. See LLMs and AI for the full metadata reference.

The following table shows Gemini-specific results[].content fields:

Field Name
Description
Type

prompt

Submitted prompt.

string

raw

Raw data from the streaming response.

array

response_text

Plain text response from Gemini.

string

markdown_text

Complete response in Markdown.

string

citations

Source citations referenced in the response. Each object contains title, url, text, and description.

array

parse_status_code

12000 – successful. Otherwise, parser failed to extract some or all structured fields.

integer

– conditional, returned only when content is in the LLM's response.

Last updated

Was this helpful?