# PriceSpy Search API Documentation

GET /api/pricespy/search returns product cards with numeric prices and images. Add a category id from the categories endpoint to get category-scoped products. Only the first upstream result page is returned. There is no page or offset parameter.

- **Documentation:** [https://scrappa.co/docs/pricespy-api/pricespy_search](https://scrappa.co/docs/pricespy-api/pricespy_search)
- **API group:** PriceSpy API
- **Endpoint:** `GET https://scrappa.co/api/pricespy/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 |
| --- | --- | --- | --- |
| `q` | string | Yes | Search keyword, e.g. iphone. |
| `category` | string | No | Category id from the categories endpoint. |

## Example response

```json
{
    "meta": {
        "attempts": 1,
        "billable": true
    },
    "page": 1,
    "total": 240,
    "success": true,
    "products": [
        {
            "id": "12345",
            "name": "Apple iPhone",
            "price": {
                "value": 699,
                "currency": "GBP"
            }
        }
    ],
    "pagination": {
        "note": "First result page only.",
        "page": 1,
        "has_more": false
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 503 | Upstream Unavailable | The public source is temporarily unavailable through every approved route. |

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