# Google AI Overview

Fetch a dedicated Google AI Overview for a query. Unlike Search Advanced, this endpoint always requests Google AI Mode and returns the generated answer as plain text plus customer-renderable markdown, structured text blocks (paragraphs, headings, lists, equations), cited sources/quotes, and header images when Google produces them. Queries that do not yield a parseable AI Overview after retries return an unbilled 503. This is a separate product from the best-effort ai_overview field on Search Advanced.

- **Documentation:** [https://scrappa.co/docs/google-search-api/google_search_ai_overview](https://scrappa.co/docs/google-search-api/google_search_ai_overview)
- **API group:** Google Search API
- **Endpoint:** `GET https://scrappa.co/api/search-ai-overview`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Search query sent to Google AI Mode |
| `hl` | string | No | Interface language code (e.g. en, de) |
| `gl` | string | No | Country code (e.g. us, de) |
| `google_domain` | string | No | Google domain (e.g. google.de) |
| `uule` | string | No | Encoded location (passed through when provided) |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us"
```

## Example response

```json
{
    "search_information": {
        "query_displayed": "how does photosynthesis work",
        "search_url": "https://www.google.com/search?udm=50&q=how+does+photosynthesis+work&hl=en&gl=us&complete=0&pws=0"
    },
    "ai_overview": {
        "text_blocks": [
            {
                "type": "paragraph",
                "snippet": "Photosynthesis is the process plants use to convert light energy into chemical energy.",
                "snippet_markdown": "Photosynthesis is the process plants use to convert light energy into chemical energy."
            },
            {
                "type": "heading",
                "snippet": "The overall equation",
                "snippet_markdown": "The overall equation"
            },
            {
                "type": "paragraph",
                "snippet": "The general balanced equation for photosynthesis is: 6CO\u2082 + 6H\u2082O + Light Energy \u2192 C\u2086H\u2081\u2082O\u2086 + 6O\u2082",
                "snippet_markdown": "The general balanced equation for photosynthesis is: $6\\text{CO}_{2}+6\\text{H}_{2}\\text{O}+\\text{Light\\ Energy}\\rightarrow \\text{C}_{6}\\text{H}_{12}\\text{O}_{6}+6\\text{O}_{2}$",
                "snippet_latex": [
                    "6\\text{CO}_{2}+6\\text{H}_{2}\\text{O}+\\text{Light\\ Energy}\\rightarrow \\text{C}_{6}\\text{H}_{12}\\text{O}_{6}+6\\text{O}_{2}"
                ]
            },
            {
                "type": "list",
                "snippet": "Reactants: Carbon dioxide (CO\u2082) and water (H\u2082O).\nProducts: Glucose (C\u2086H\u2081\u2082O\u2086) and oxygen (O\u2082).",
                "snippet_markdown": "- **Reactants:** Carbon dioxide ($\\text{CO}_{2}$) and water ($\\text{H}_{2}\\text{O}$).\n- **Products:** Glucose ($\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}$) and oxygen ($\\text{O}_{2}$).",
                "list": [
                    {
                        "title": "Reactants:",
                        "snippet": "Carbon dioxide (CO\u2082) and water (H\u2082O).",
                        "snippet_markdown": "Carbon dioxide ($\\text{CO}_{2}$) and water ($\\text{H}_{2}\\text{O}$).",
                        "snippet_latex": [
                            "\\text{CO}_{2}",
                            "\\text{H}_{2}\\text{O}"
                        ]
                    },
                    {
                        "title": "Products:",
                        "snippet": "Glucose (C\u2086H\u2081\u2082O\u2086) and oxygen (O\u2082).",
                        "snippet_markdown": "Glucose ($\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}$) and oxygen ($\\text{O}_{2}$).",
                        "snippet_latex": [
                            "\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}",
                            "\\text{O}_{2}"
                        ]
                    }
                ]
            }
        ],
        "header_images": [
            {
                "image": "https://www.science-sparks.com/wp-content/uploads/2020/04/Photosynthesis-Diagram-scaled.jpg",
                "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcPhotosynthesisDiagram",
                "title": "What is photosynthesis?",
                "source": "www.science-sparks.com",
                "link": "https://www.science-sparks.com/what-is-photosynthesis/"
            }
        ],
        "references": [
            {
                "title": "Photosynthesis - National Geographic Education",
                "link": "https://education.nationalgeographic.org/resource/photosynthesis",
                "snippet": "Photosynthesis is the process by which plants use sunlight, water, and carbon dioxide to create oxygen and energy.",
                "source": "National Geographic Society",
                "index": 0
            }
        ],
        "quotes": [
            {
                "snippet": "Photosynthesis is the process by which plants use sunlight, water, and carbon dioxide to create oxygen and energy.",
                "title": "Photosynthesis - National Geographic Education",
                "source": "National Geographic Society",
                "link": "https://education.nationalgeographic.org/resource/photosynthesis"
            }
        ]
    },
    "text": "Photosynthesis is the process plants use to convert light energy into chemical energy.\nThe overall equation\nThe general balanced equation for photosynthesis is: 6CO\u2082 + 6H\u2082O + Light Energy \u2192 C\u2086H\u2081\u2082O\u2086 + 6O\u2082\nReactants: Carbon dioxide (CO\u2082) and water (H\u2082O).\nProducts: Glucose (C\u2086H\u2081\u2082O\u2086) and oxygen (O\u2082).",
    "markdown": "Photosynthesis is the process plants use to convert light energy into chemical energy.\n\n### The overall equation\n\nThe general balanced equation for photosynthesis is: $6\\text{CO}_{2}+6\\text{H}_{2}\\text{O}+\\text{Light\\ Energy}\\rightarrow \\text{C}_{6}\\text{H}_{12}\\text{O}_{6}+6\\text{O}_{2}$\n\n- **Reactants:** Carbon dioxide ($\\text{CO}_{2}$) and water ($\\text{H}_{2}\\text{O}$).\n- **Products:** Glucose ($\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}$) and oxygen ($\\text{O}_{2}$).",
    "service_used": "google"
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 503 | AI Overview Unavailable | Google AI Overview is temporarily unable to return a valid answer. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
