Skip to content

Gemini LLM Responses 10 Endpoints

Query Google Gemini through DataForSEO's AI Optimization API. Gemini is covered by two sub-APIs: LLM Responses (structured output) and LLM Scraper (raw scraped results from Google's AI-powered search).

Endpoints

Gemini LLM Responses (4 endpoints)

Call NameMethodEndpoint
Set Gemini TasksPOST/v3/ai_optimization/gemini/tasks_post
Get Completed TasksGET/v3/ai_optimization/gemini/tasks_ready
Get Re-parsed TasksGET/v3/ai_optimization/gemini/tasks_fixed
Task GETGET/v3/ai_optimization/gemini/task_get/{id}

Gemini LLM Scraper (6 endpoints)

The Gemini scraper retrieves actual results from Google's AI-powered search interface (formerly Bard, now Gemini in Search).

Call NameMethodEndpoint
Set Gemini Scraper TasksPOST/v3/ai_optimization/gemini/llm_scraper/task_post
Get Completed Scraper TasksGET/v3/ai_optimization/gemini/llm_scraper/tasks_ready
Get Re-parsed Scraper TasksGET/v3/ai_optimization/gemini/llm_scraper/tasks_fixed
Task GET ScraperGET/v3/ai_optimization/gemini/llm_scraper/task_get/{id}
Live ScraperPOST/v3/ai_optimization/gemini/llm_scraper/live
LocationsGET/v3/ai_optimization/gemini/llm_scraper/locations

Method

Gemini LLM Responses: Standard (async) — POST to set task, GET to retrieve.

Gemini LLM Scraper: Supports both Standard and Live. Use Live for instant results (single query). Use Standard for bulk/batch work.

Use Cases

  • Determine whether a brand is cited in Gemini's AI-generated answers
  • Compare Gemini recommendations to ChatGPT and Claude for the same query
  • Track which competitor domains Gemini links to in its responses
  • Monitor Gemini's shopping and local recommendations for a product category

LLM Responses Example

python
import os
import requests
from requests.auth import HTTPBasicAuth

auth = HTTPBasicAuth(os.environ["DATAFORSEO_LOGIN"], os.environ["DATAFORSEO_PASSWORD"])
BASE = "https://api.dataforseo.com"

# Post task
r = requests.post(
    f"{BASE}/v3/ai_optimization/gemini/tasks_post",
    auth=auth,
    headers={"Content-Type": "application/json"},
    json=[{
        "keyword": "who are the best local roofers in Dallas?",
        "location_code": 2840,
        "language_code": "en"
    }]
)
task_id = r.json()["tasks"][0]["id"]
print(f"Task: {task_id}")

LLM Scraper Example (Live)

python
r = requests.post(
    f"{BASE}/v3/ai_optimization/gemini/llm_scraper/live",
    auth=auth,
    headers={"Content-Type": "application/json"},
    json=[{
        "keyword": "roofing contractor Dallas TX",
        "location_code": 2840,
        "language_code": "en"
    }]
)
result = r.json()["tasks"][0]["result"][0]
print(result.get("response_text", "No response"))

Response Fields

FieldTypeDescription
keywordstringQuery submitted
response_textstringGemini's full text response
brands_mentionedarrayBrands detected in response
urls_mentionedarrayURLs cited
se_typestring"gemini"

Pricing

~$0.01 per LLM Responses task. LLM Scraper pricing varies — Live method costs more than Standard. Check account dashboard.

Notes

  • Gemini is the only LLM provider with both a Responses API and a Scraper API — the scraper returns what users actually see in Google's AI-powered search UI
  • The scraper is more representative of real AI Overview results than the structured Responses API
  • Run llm_scraper/live for instant competitive checks; use task_post for bulk scheduled pulls

Internal SOP reference — not affiliated with DataForSEO.