# Geizhals Product Search API Documentation

Scrappa's `GET /api/geizhals/search` endpoint searches the Geizhals product catalog by keyword and returns structured JSON with matching products, best prices, ratings, category and manufacturer facets, and pagination. Use the returned product `gzhid` with `GET /api/geizhals/product` to fetch full product details.

- **Documentation:** [https://scrappa.co/docs/geizhals-api/geizhals_search](https://scrappa.co/docs/geizhals-api/geizhals_search)
- **API group:** Geizhals API
- **Endpoint:** `GET https://scrappa.co/api/geizhals/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 keyword, e.g. thinkpad. |
| `loc` | string | No | Market code: de, at, eu, pl, or uk. Defaults to de. |
| `lang` | string | No | Response language: de or en. Defaults to de. |
| `page` | integer | No | 1-based page number. Defaults to 1. |
| `pagesize` | integer | No | Results per page, between 1 and 1000. Defaults to 10. |
| `sort` | string | No | Optional sort key as used by Geizhals (e.g. price). Defaults to relevance. |
| `category` | string | No | Optional Geizhals category id to constrain results. |
| `manufacturer` | string | No | Optional manufacturer id to constrain results. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/geizhals/search?query=thinkpad&loc=de&pagesize=10"
```

## Example response

```json
{
    "success": true,
    "query": "thinkpad",
    "loc": "de",
    "lang": "de",
    "page": 1,
    "pagesize": 10,
    "total": 431,
    "products": [
        {
            "gzhid": 3552190,
            "product": "Lenovo ThinkPad E14 G7",
            "manufacturer_name": "Lenovo",
            "offer_count": 12,
            "best_price": {
                "value": 899,
                "currency": "EUR"
            },
            "urls": {
                "overview": "https://geizhals.de/a3552190.html"
            }
        }
    ],
    "facets": {
        "price_range": {
            "min": 199,
            "max": 3499
        },
        "categories": [
            {
                "id": "nb",
                "name": "Notebooks",
                "count": 380
            }
        ],
        "manufacturer": [
            {
                "id": "1234",
                "name": "Lenovo",
                "count": 210
            }
        ]
    },
    "category_suggestions": [],
    "pager": {
        "first_page": 1,
        "next_page": 2,
        "last_page": 44
    },
    "meta": {
        "duration_ms": 812,
        "attempts": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 502 | Bad Gateway | Geizhals returned a non-successful, empty, or malformed response through every attempted proxy. |
| 503 | Upstream Unavailable | No approved proxy path was available or every retry failed before Geizhals returned usable JSON. |

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