# Trovaprezzi Product Search API Documentation

`GET /api/trovaprezzi/search` searches products by query or category. Returns full-size images, EUR prices, offer count, facets, a price range and a pager. Price bounds are applied to the parsed page after fetch, not sent upstream, so a bounded page can be sparse. Rows outside the bounds are removed.

- **Documentation:** [https://scrappa.co/docs/trovaprezzi-api/trovaprezzi_search](https://scrappa.co/docs/trovaprezzi-api/trovaprezzi_search)
- **API group:** Trovaprezzi API
- **Endpoint:** `GET https://scrappa.co/api/trovaprezzi/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 | No | Search words. Use this or category. |
| `category` | string | No | Category slug such as notebook. Use this or query. |
| `page` | integer | No | 1-based page number for a category search. A query search supports page 1 only. |
| `price_min` | number | No | Lowest EUR price. Rows below it are removed. |
| `price_max` | number | No | Highest EUR price. Rows above it are removed. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/trovaprezzi/search?query=notebook&page=1"
```

## Example response

```json
{
    "success": true,
    "query": "notebook",
    "category": null,
    "page": 1,
    "products": [
        {
            "id": 1,
            "name": "Notebook example",
            "path": "/informatica/prezzi-scheda-prodotto/notebook_example",
            "image": "https://s1.trovaprezzi.it/notebook.jpg",
            "price": 599.9,
            "currency": "EUR",
            "offer_count": 12,
            "source_category": "informatica"
        }
    ],
    "facets": {
        "price_range": {
            "min": null,
            "max": null
        },
        "categories": [],
        "shops": []
    },
    "pager": {
        "first_page": 1,
        "next_page": 2,
        "last_page": null
    },
    "meta": {
        "duration_ms": 610,
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 503 | Upstream Unavailable | Trovaprezzi returned a challenged, empty or malformed response through the approved pool. |

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