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 to Gemini using Push-Pull.
curl 'https://data.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "gemini",
"prompt": "official websites of the most visited US national parks",
"parse": true,
"geo_location": "United States",
"callback_url": "https://your-server.com/oxylabs-callback"
}'import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'gemini',
'prompt': 'official websites of the most visited US national parks',
'parse': True,
'geo_location': "United States",
'callback_url': "https://your-server.com/oxylabs-callback"
}
# Get response.
response = requests.request(
'POST',
'https://data.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())Submitting a job with Push-Pull integration (including batch queries) method returns the job ID immediately – not the result. Once the job status is done, retrieve the parsed response. See Integration method on the LLMs and AI page for the full submit-and-retrieve flow.
Request parameters
Basic setup and customization options for scraping Gemini.
source
Sets the scraper target. Use gemini.
–
prompt
The prompt or question to submit to Gemini. Up to 8,000 characters.
–
parse
Set to true for structured JSON data.
false
- mandatory parameter
Structured data
Once the job is retrieved via the Push-Pull results endpoint, Web Scraper API is capable of extracting a JSON object that contains Gemini output, offering structured data on various elements of the results page.
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:
prompt
Submitted prompt.
string
raw_response
Raw streamed response from Gemini, one line per item.
array of strings
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
additional_results
Additional data attached to the answer. Each list is returned only when present in the answer:
sources_results- web pages Gemini consulted while answering (url, and optionaltitle).images_results- images shown in the answer (title,image_url, and optionalimage_from_url- the page the image comes from).videos_results- YouTube videos shown in the answer (url,title, and optionalthumbnail).
object
related_queries
Follow-up questions Gemini suggests under the answer.
array of strings
links
List of objects for links written inside the answer text: url and text. text can be empty if the link has no visible text.
array
parse_status_code
12000 – successful. Otherwise, parser failed to extract some or all structured fields.
integer
model
AI model used to generate the response.
string
– conditional, returned only when content is in the LLM's response.
Last updated
Was this helpful?