# Google Search

Perform a Google search and get structured results including organic results, related searches, knowledge graphs, and more.

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

## 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 |
| `location` | string | No | Location for results (currently ignored by backend) |
| `uule` | string | No | Encoded location (deprecated; supported) |
| `google_domain` | string | No | Google domain (e.g., google.de) |
| `gl` | string | No | Country code (e.g., us, de, fr) |
| `cr` | string | No | Restrict results to countries (e.g., countryUS\|countryDE) |
| `hl` | string | No | Interface language code |
| `lr` | string | No | Restrict results to language (e.g., lang_en) |
| `ludocid` | string | No | Google Customer ID for places |
| `lsig` | string | No | Knowledge graph map signature |
| `kgmid` | string | No | Knowledge graph entity ID (e.g., /g/11b6gq7c8p) |
| `si` | string | No | Encrypted cached search parameters |
| `ibp` | string | No | Controls rendering layouts and expansions |
| `uds` | string | No | Google-provided filter strings |
| `tbs` | string | No | Advanced search filters (dates, patents, etc.) |
| `as_qdr` | string | No | Simple time range filter (e.g., d, w, m, y) |
| `safe` | string | No | Safe search mode (active, off) |
| `nfpr` | integer | No | Exclude auto-corrected results (0 or 1) |
| `filter` | integer | No | Enable/disable similar/omitted filters (0 or 1) |
| `tbm` | string | No | Search type (isch, vid, nws, lcl, shop, pts) |
| `start` | integer | No | Result offset for pagination (0-indexed) |
| `page` | integer | No | Page number for pagination (0-indexed) |
| `amount` | integer | No | Results per page (1-10, may return fewer) |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/search?query=best+restaurants+in+Berlin&hl=en&safe=off"
```

## Example response

```json
{
    "search_information": {
        "query_displayed": "best restaurants in Berlin",
        "total_results": 428000000,
        "time_taken_displayed": 0.42
    },
    "organic_results": [
        {
            "position": 1,
            "title": "The 38 Best Restaurants in Berlin",
            "link": "https://www.example.com/berlin/best-restaurants",
            "redirect_link": "https://www.google.com/url?q=https://www.example.com/berlin/best-restaurants",
            "displayed_link": "www.example.com > berlin > best-restaurants",
            "snippet": "A curated guide to Berlin restaurants, from modern German dining rooms to casual neighborhood favorites.",
            "source": "example.com",
            "sitelinks": {
                "inline": [
                    {
                        "title": "Fine Dining",
                        "link": "https://www.example.com/berlin/fine-dining"
                    },
                    {
                        "title": "Neighborhood Guides",
                        "link": "https://www.example.com/berlin/neighborhoods"
                    }
                ]
            }
        },
        {
            "position": 2,
            "title": "Berlin Restaurant Guide",
            "link": "https://guide.example.org/berlin-restaurants",
            "displayed_link": "guide.example.org > berlin-restaurants",
            "snippet": "Compare highly rated restaurants in Berlin by cuisine, district, price level, and opening hours.",
            "source": "guide.example.org"
        }
    ],
    "related_searches": [
        {
            "query": "best restaurants berlin mitte",
            "link": "https://www.google.com/search?q=best+restaurants+berlin+mitte"
        },
        {
            "query": "berlin restaurants with tasting menu",
            "link": "https://www.google.com/search?q=berlin+restaurants+with+tasting+menu"
        }
    ],
    "people_also_search_for": [
        {
            "name": "Berlin food guide",
            "query": "Berlin food guide",
            "link": "https://www.google.com/search?q=Berlin+food+guide"
        },
        {
            "name": "Restaurants in Kreuzberg",
            "query": "restaurants in Kreuzberg",
            "link": "https://www.google.com/search?q=restaurants+in+Kreuzberg"
        },
        {
            "name": "Michelin restaurants Berlin",
            "query": "Michelin restaurants Berlin",
            "link": "https://www.google.com/search?q=Michelin+restaurants+Berlin"
        }
    ],
    "related_questions": [
        {
            "question": "What food is Berlin best known for?",
            "text_blocks": [
                {
                    "type": "paragraph",
                    "snippet": "Berlin is known for currywurst, doner kebab, schnitzel, and a large international restaurant scene."
                }
            ]
        }
    ],
    "local_results": {
        "places": [
            {
                "position": 1,
                "title": "Example Berlin Bistro",
                "rating": 4.7,
                "reviews": 1842,
                "type": "Restaurant",
                "address": "Mitte, Berlin"
            }
        ]
    },
    "knowledge_graph": null,
    "inline_images": [
        {
            "title": "Berlin restaurant dining room",
            "thumbnail": "https://images.example.com/berlin-restaurant.jpg",
            "source": "example.com"
        }
    ],
    "pagination": {
        "next": null
    },
    "total_results": 428000000,
    "engine_used": "google",
    "service_used": "google"
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 503 | Search Providers Unavailable | Google Search and fallback providers are temporarily unavailable. |

## 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)
