# SNIPES Search API Documentation

<p><strong>SNIPES Search API</strong> searches the SNIPES catalog or browses a category with a query or a category id. Each product carries numeric prices with currency (current, original, discount percent and amount), full size image URLs, and every size with an integer stock quantity. Facets carry the numeric ids that the size, color and brand filters take, and sorts carries the accepted sort codes.</p><p><strong>Cost:</strong> 1 credit per request. Failed requests are not billed. The locale <code>de</code> is the only soaked store today; another locale answers 422. A price filter, an unknown sort, a perPage above 48 and a non-numeric facet id are refused with 422. Results never carry another page or another filter than the one requested.</p>

- **Documentation:** [https://scrappa.co/docs/snipes-api/snipes_search](https://scrappa.co/docs/snipes-api/snipes_search)
- **API group:** SNIPES API
- **Endpoint:** `GET https://scrappa.co/api/snipes/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 text, 2 to 100 characters. Send query or category, not both. |
| `category` | integer | No | Numeric category id from the categories endpoint or a SNIPES category URL. Send query or category, not both. |
| `locale` | string | No | Store locale. Only de is soaked. |
| `page` | integer | No | One-based page number, default 1. |
| `perPage` | integer | No | 12, 24 or 48 products per page, default 24. |
| `sort` | string | No | default, newest, price_asc, price_desc or reduction. |
| `size` | string | No | Numeric size facet ids, comma separated. |
| `color` | string | No | Numeric color facet ids, comma separated. |
| `brand` | string | No | Numeric brand facet ids, comma separated. |
| `sale` | boolean | No | true to return only reduced items. |

## Example response

```json
{
    "data": {
        "sorts": [],
        "facets": [],
        "locale": "de",
        "currency": "EUR",
        "products": [
            {
                "id": "24853",
                "name": "AIR FORCE 1 07",
                "brand": {
                    "id": null,
                    "name": "Nike"
                },
                "price": {
                    "current": 71.99,
                    "on_sale": true,
                    "currency": "EUR",
                    "original": 89.99,
                    "discount_amount": 18,
                    "discount_percent": 20
                },
                "sizes": [
                    {
                        "size": "42",
                        "stock": 3,
                        "in_stock": true
                    }
                ]
            }
        ],
        "pagination": {
            "page": 1,
            "per_page": 24,
            "total_pages": 48,
            "has_next_page": true,
            "total_results": 1142
        },
        "breadcrumbs": []
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid, the locale is not soaked, or the answer did not match the request. This response is not billable. |
| 503 | Upstream Unavailable | SNIPES could not be reached. This response is not billable. |

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