Skip to content

scrapeless-ai/google-ai-mode-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Google AI Mode Scraper

Scrapeless Google AI Mode Scraper - collect Google AI Mode answers with one API call

Try Scrapeless Blog X LinkedIn

Collect Google AI Mode answers through the Scrapeless LLM Chat Scraper API, including the plain-text and Markdown response, rendered HTML, citation sources, search results, and shopping products, without reverse-engineering the Google AI Mode UI, maintaining browsers, or building your own anti-blocking stack.

Use this repo when you need a repeatable way to monitor Google AI Mode answers for GEO and AI search visibility, compare prompts across regions, audit cited sources, capture shopping product data, or pipe AI responses into analytics and automation workflows.

How it works

Send a single POST request to the Scrapeless endpoint with your API token in the x-api-token header. The body specifies the actor (scraper.aimode) and an input object with your prompt and options. The API runs the query and returns the structured result in task_result.

POST https://api.scrapeless.com/api/v2/scraper/execute
Content-Type: application/json
x-api-token: <YOUR_API_TOKEN>

Quick start (curl)

curl 'https://api.scrapeless.com/api/v2/scraper/execute' \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: YOUR_API_TOKEN' \
  --data '{
    "actor": "scraper.aimode",
    "input": {
      "prompt": "Recommended attractions in New York",
      "country": "US",
      "shopping": true
    }
  }'

To receive the result asynchronously, add a webhook object:

"webhook": { "url": "https://www.your-webhook.com" }

Request parameters

The request body has three top-level fields: actor (always scraper.aimode), input (below), and an optional webhook.

Parameter (input.*) Type Required Description
prompt string Yes Prompt sent to Google AI Mode.
country string Yes Country / region code (e.g. US, JP).
shopping boolean No Fetch shopping data. Defaults to true. When enabled, product info is returned in products.
location string No Google canonical location name for geo-targeted results (e.g. New York,New York,United States). See Google's geo target list. Mutually exclusive with uule.
uule string No Pre-encoded Google UULE string for precise geo-targeting. Use this when you have a pre-built UULE value instead of a location name. Mutually exclusive with location.

Billing note: When the response includes shopping data (the products field), the call is charged at 2× the base rate due to the extra work of extracting and processing product information from multiple sources.

Response

A successful call returns a status envelope; the scraped data lives in task_result:

{
  "status": "success",
  "task_id": "e705743d-da2e-4163-9ccd-eef62529ff72",
  "task_result": {
    "result_text": "...answer body...",
    "result_md": "...markdown answer...",
    "result_html": "<div>...</div>",
    "raw_url": "https://...",
    "citations": [
      { "title": "...", "url": "https://...", "snippet": "...", "website_name": "...", "favicon": "...", "thumbnail": "..." }
    ],
    "search_result": [
      { "title": "...", "url": "https://...", "snippet": "...", "website_name": "...", "thumbnail": "..." }
    ],
    "products": []
  }
}

Top-level fields

Field Type Description
status string Request status, e.g. success.
task_id string Unique identifier for the task.
task_result object Scraped result (fields below).

task_result fields

Field Type Description
result_text string Answer body.
result_md string Answer body in Markdown format.
result_html string HTML version of the answer.
raw_url string Original Google AI Mode URL.
citations array Citation sources (title, url, snippet, website_name, favicon, thumbnail).
search_result array Search results referenced by Google (title, url, snippet, website_name, thumbnail).
products array Product information (present when shopping is enabled).

The products array is deeply nested. Key subfields include title, brand, url, rating, reviews, and price_range, plus stores (per-store offers), about_the_product (features and description), variants, ratings, and user_reviews. For the complete field list, see the official documentation.

Code examples

Ready-to-run examples live in examples/:

Language File Run
Python example.py pip install requests && python example.py
Node.js example.js node example.js (Node 18+)
Go example.go go run example.go
Java Example.java java Example.java (Java 11+)
PHP example.php php example.php

All examples read the token from the SCRAPELESS_API_TOKEN environment variable:

export SCRAPELESS_API_TOKEN="your_api_token"

Practical use cases

AI answer monitoring

Track how Google AI Mode responds to your brand, product category, documentation topics, or competitor prompts. Store the Markdown answer and citations so your team can measure AI visibility over time.

GEO and SEO research

Run the same prompt across countries and geo-targeted locations to compare which sources Google AI Mode cites, how recommendations change by region, and where your content appears in AI-generated answers.

Shopping and product intelligence

Enable the shopping option to capture structured product data — titles, brands, ratings, reviews, price ranges, and per-store offers — for product recommendations surfaced in Google AI Mode answers.

Dataset and workflow automation

Pipe Google AI Mode answers into internal dashboards, knowledge-base QA systems, spreadsheets, data warehouses, or alerting workflows through the synchronous API response or webhook callback.

Why use Scrapeless for Google AI Mode scraping?

Benefit What it means for your team
One unified API Query Google AI Mode through the same Scrapeless LLM Chat Scraper workflow used for other AI answer engines.
Structured output Receive plain-text and Markdown answers, HTML, citations, search results, and shopping products in a developer-friendly response.
Less maintenance Avoid building browser automation, UI selectors, proxy rotation, retries, and anti-blocking logic yourself.
Region-aware analysis Use country codes plus location or uule geo-targeting to compare localized AI answers and source citations.
Production integration Use API tokens, webhooks, and language examples to connect Google AI Mode data to real applications quickly.

FAQ

What is Google AI Mode Scraper?

Google AI Mode Scraper is a Scrapeless LLM Chat Scraper actor that sends prompts to Google AI Mode and returns structured answer data, including the plain-text and Markdown response, rendered HTML, citations, search results, and shopping products.

Do I need to run a browser or proxy pool?

No. This repo shows how to call the Scrapeless API. Scrapeless handles the scraping workflow behind the API, so your application only needs to send requests and process the returned data.

How do I get shopping data, and how is it billed?

Set shopping to true (the default) to include product information in the products field. When the response includes shopping data, the call is charged at 2× the base rate because of the extra work of extracting and processing product information from multiple sources.

Can I target a specific location?

Yes. Use location with a Google canonical location name, or uule with a pre-encoded UULE string for precise geo-targeting. The two options are mutually exclusive — supply one or the other, not both.

Can I get results asynchronously?

Yes. Add a webhook object with your callback URL to receive results asynchronously when the task completes.

Is this suitable for AI search visibility monitoring?

Yes. The response includes AI-generated Markdown, HTML, outbound citations, and search results, which makes it useful for GEO analysis, brand monitoring, source tracking, and competitive research.

What should I consider before using AI scraping in production?

Make sure your use case complies with applicable laws, platform terms, privacy requirements, and your organization's data policies. Avoid collecting sensitive, private, or unauthorized information.

Learn more

Contact us

Need help building a Google AI Mode monitoring workflow or scaling AI answer collection?

  • Join our Discord.
  • Contact us on Telegram.
  • For repo-specific issues or improvements, open an issue or pull request in this repository.

About

Collect Google AI Mode answers, Markdown responses, links, and citations through the Scrapeless LLM Chat Scraper API for GEO research and AI search monitoring.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors