HasData
Back to all posts

Get Clean Google AI Mode Results with the HasData API

Sergey Ermakovich
Sergey Ermakovich
24 Jun 2025

Google is no longer just a list of links. It’s an answer engine. With the introduction of “AI Overviews” and the deeper, conversational “AI Mode”, the most valuable information is now embedded within AI-generated responses.

Google AI Mode

This creates a new, critical challenge: this data is not designed for programmatic access. How do you track it? How do you analyze it? How do you integrate it into your own applications?

Today, we’re answering those questions.

Announcing the HasData API for Google AI Mode

HasData has launched a new API that provides programmatic access to Google’s AI Mode search results. We handle the complexity, and you get clean, structured JSON.

The HasData API is engineered to solve the specific challenges businesses now face, offering a robust and reliable alternative to brittle in-house solutions or inadequate official tools.

  • Complete AI Mode Access: Go beyond standard organic results. The API is built specifically to capture the full context of an AI Mode response, including the complete AI-generated text, all cited web sources, and other rich elements like tables for comparisons and local packs for location-based queries.
  • Reliable Structured JSON Output: Eliminate the complexity and unreliability of manual scraping. Our platform handles the difficult work of parsing the ever-changing SERP layout, delivering a consistent, well-documented, and easy-to-use JSON object for every query.
  • Built for Enterprise Scale: HasData’s API for Google AI Mode is designed for high-volume, real-time data collection. Whether monitoring a handful of brand keywords or analyzing millions of queries for market trends, our infrastructure is built to deliver with speed and reliability.
  • Simple and Fast Integration: Get started in minutes, not months. With clear documentation, intuitive API design, and code libraries for popular languages, developers can integrate AI Mode data into their existing applications and dashboards with minimal effort.

Demonstration: How It Works

Our API handles the complex task of interacting with Google’s AI Mode and returns the result as clean, structured JSON. It’s as simple as a single API call.

The API playground interface for HasData's Google AI Mode SERP API, where users can enter search queries and execute requests.

Google AI Mode API playground interface

Let’s ask the API a complex, topical question: “What are the key differences between Google’s Gemini 1.5 Pro and OpenAI’s GPT-4o?”

Step 1: The Request

All you need to do is send your query to our endpoint. Here is an example using cURL:

curl --request GET \
	--url 'https://api.hasdata.com/scrape/google/ai-mode?q=what+are+the+key+differences+between+Google+Gemini+1.5+Pro+and+OpenAI+GPT-4o' \
	--header 'Content-Type: application/json' \
	--header 'x-api-key: YOUR-API-KEY'

Step 2: The Response

The API returns a structured JSON object. The core content is in the textBlocks array, which segments the AI’s answer into logical paragraphs.

{
  "requestMetadata": {
    "status": "ok",
    "url": "https://www.google.com/search?q=what+are+the+key+differences+between+Google+Gemini+1.5+Pro+and+OpenAI+GPT-4o&udm=50"
  },
  "textBlocks": [
    {
      "type": "paragraph",
      "snippet": "The key differences between Google Gemini 1.5 Pro and OpenAI GPT-4o are:"
    },
    {
      "type": "paragraph",
      "snippet": "Context Window:",
      "snippetHighlightedWords": ["Context Window:"]
    },
    {
      "type": "list",
      "list": [
        {"snippet": "Gemini 1.5 Pro: Supports up to 1 million tokens, allowing it to process large amounts of data."},
        {"snippet": "GPT-4o: Has a context window of 128,000 tokens."}
      ]
    },
    {
      "type": "paragraph",
      "snippet": "Performance and Multimodality:",
      "snippetHighlightedWords": ["Performance and Multimodality:"]
    },
    {
      "type": "list",
      "list": [
        {"snippet": "Gemini 1.5 Pro: Excels in complex reasoning, creative writing, and coding, and handles text, code, images, video, and audio."},
        {"snippet": "GPT-4o: Performs well in multilingual tasks and multimodal comprehension, especially with vision and audio. It often outperforms Gemini 1.5 Pro on various benchmarks."}
      ]
    },
    {
      "type": "paragraph",
      "snippet": "Cost:",
      "snippetHighlightedWords": ["Cost:"]
    },
    {
      "type": "list",
      "list": [
        {"snippet": "Gemini 1.5 Pro: Has a tiered pricing structure that is more affordable for smaller inputs (under 128k tokens)."},
        {"snippet": "GPT-4o: Provides cost-effectiveness, especially for larger volumes."}
      ]
    }
  ],
  "references": [
    {
      "link": "https://www.promptlayer.com/blog/gemini-1-5-pro-vs-chatgpt-4o-choosing-the-right-model#:~:text=Performance:%20GPT%2D4o%20beats%20Gemini,suited%20for%20extremely%20long%20inputs.",
      "title": "Gemini 1.5 Pro vs ChatGPT 4o: Choosing the right model",
      "snippet": "Nov 1, 2024 — Choosing Between Gemini 1.5 Pro and GPT-4o. OpenAI and Google have been releasing better and better frontier large language models (LLMs) in 2024. The newest ve...",
      "source": "PromptLayer",
      "index": 1
    },
    {
      "link": "https://www.appaca.ai/resources/llm-comparison/gpt-4o-vs-gemini-15-pro#:~:text=In%20summary,%2D4o%20(October%202023).",
      "title": "GPT-4o vs Gemini 1.5 Pro: Which AI Model Is Right for You? - Appaca",
      "snippet": "GPT-4o: Strengths and Advantages. GPT-4o is OpenAI's high-intelligence flagship model, designed for complex, multi-step tasks. It offers advanced capabilities a...",
      "source": "Appaca",
      "index": 3
    }
  ]
}

As you can see, the response is predictable and easy to parse.

But our API doesn’t just extract textual information. Google’s AI Mode often presents data in various formats, and the HasData API is designed to capture these as well. This includes structured tables for comparisons and local results for location-based queries.

Let’s take a look at how this works.

For a comparative query like “best laptops for students”, Google’s AI often generates a summary table.

Screenshot of Google AI Mode displaying a comparison table of features for different laptops models.

Our API identifies and parses this element directly. Instead of just getting a block of text, you receive a structured table object:

{
  "type": "table",
  "rows": [
    [
      "Feature",
      "Apple MacBook Air (M3, 2024)",
      "Asus Zenbook 14 OLED",
      "Microsoft Surface Pro 11th Edition (2024)",
      "Acer Swift Go 14 (2024)",
      "Lenovo ThinkPad X1 Carbon Gen 12",
      "Acer Aspire Go 15"
    ],
    [
      "Best For",
      "Overall, Creative students",
      "Overall, Performance/Display",
      "Note-takers, 2-in-1 users",
      "Mid-Range, Value",
      "Business, Portability",
      "Budget"
    ],
    [
      "CPU",
      "Apple M3",
      "Intel Core Ultra 7 155H",
      "Qualcomm Snapdragon X Elite",
      "Intel Core Ultra 5/7",
      "Intel Core Ultra 7 155H",
      "Intel Core i3"
    ],
    [
      "GPU",
      "Integrated (10-core)",
      "Integrated (Intel Arc)",
      "Integrated (Qualcomm Adreno)",
      "Integrated (Intel Arc/Iris Xe)",
      "Integrated (Intel Arc)",
      "Integrated"
    ],
    [
      "Display",
      "13.5-inch Liquid Retina",
      "14-inch OLED touchscreen",
      "13-inch OLED PixelSense Flow",
      "14-inch IPS/OLED",
      "14-inch OLED (120Hz)",
      "15.6-inch Full HD"
    ],
    [
      "Battery Life",
      "Excellent (15+ hours)",
      "Good (approx. 16 hours)",
      "Long (e.g., 10 hours)",
      "Decent (approx. 11 hours)",
      "Middling (with OLED)",
      "Approx. 12 hours"
    ],
    [
      "Weight",
      "2.7 pounds (13-inch)",
      "2.82 pounds",
      "1.97 pounds (without keyboard)",
      "3.1 pounds",
      "2.42 pounds",
      "Not specified"
    ],
    [
      "Starting Price",
      "$1,099",
      "$849 (at Walmart)",
      "$999.99 (currently discounted)",
      "Around $700 (with OLED)",
      "$1,424.25 (discounted)",
      "$299"
    ]
  ]
}

For a location-based query like “italian restaurants near me”, the API extracts the businesses listed in the AI-driven local pack.

Screenshot of a Google AI Mode response showing a local pack listing several Italian restaurants with their ratings and addresses.

You get a clean localResults object containing actionable data:

{
  "type": "localResults",
  "localResults": [
    {
      "position": 1,
      "title": "Siragusa's Taste of Italy",
      "thumbnail": "https://lh3.googleusercontent.com/p/AF1QipMs4Qt83-h19YB6S6jX7-AK4wXsGYHI01P8Orfo=w300-h224-n-k-no",
      "address": "4115 S Redwood Rd",
      "openState": "Open",
      "reviews": 2200,
      "rating": 4.4,
      "type": "Italian"
    },
    {
      "position": 2,
      "title": "La Dolce Vita Ristorante Italiano",
      "thumbnail": "https://lh3.googleusercontent.com/p/AF1QipPxB7aSGdakj5B9uuvWJYdhVGJlDiBpqmDrxNKH=w300-h225-n-k-no",
      "address": "61 N 100 E",
      "openState": "Open",
      "reviews": 1200,
      "rating": 4.2,
      "type": "Italian"
    },
    {
      "position": 3,
      "title": "Stoneground Italian Kitchen",
      "thumbnail": "https://lh3.googleusercontent.com/gps-cs-s/AC9h4nqj_8cV66BCLW346c6zDsVQHSz-wrdvxTA1fdpsnVSmh4T_1sMhr2FecC515OYBIQOiMYermmQHX2srRdDCiimpzlZpAL7TaSgk5W3Shs9_oiw6VYOsGZ_PeXANV0IW7IXr02P8Xg=w300-h400-n-k-no",
      "address": "249 E 400 S",
      "openState": "Open",
      "reviews": 1100,
      "rating": 4.5,
      "type": "Italian"
    },
    {
      "position": 4,
      "title": "Bartolo's Sugar House",
      "thumbnail": "https://lh3.googleusercontent.com/p/AF1QipP2-JdihMmXB1zaiPIsNc29DWUrNeEBrcKvWYYR=w300-h168-n-k-no",
      "address": "1270 S 1100 E",
      "openState": "Open",
      "reviews": 610,
      "rating": 4.4,
      "type": "Italian"
    }
  ]
}

Practical Use Cases

Access to this data opens up new possibilities for product development and data analysis:

  • Automated Brand Monitoring: Track how Google’s AI portrays your brand and products by analyzing its direct answers.
  • Competitive Intelligence: Analyze how Google’s AI positions you against competitors on strengths, weaknesses, and key features.
  • Automated Content Briefs: Generate outlines and key points for articles by querying AI Mode for topic summaries.
  • Enhanced RAG Pipelines: Use the high-quality, summarized answers from Google’s AI to enrich the context for your own Large Language Models.

Get Started

The future of search data is conversational and synthesized. With the HasData API for Google AI Mode, you can build that future into your applications today.

  1. Get Your API Key: https://app.hasdata.com/sign-up
  2. Read the Docs: https://docs.hasdata.com/apis/google-ai-mode/quickstart
  3. Start Building: Make your first request.
Sergey Ermakovich
Sergey Ermakovich
I am a seasoned marketer with a passion for digital innovation. My expertise lies in creating innovative solutions to present data-driven insights, and I have extensive experience in the web scraping and data analysis industry.
Articles

Might Be Interesting