# Migros Switzerland Product Search API Documentation

`GET /api/migros/search` returns public Migros products as JSON. Pass `query` or `category`, not both. `from` and `limit` are an offset range; each reply labels its own range and catalogue mode. Price and brand filters apply to the returned window only: `until` and `next_from` use the real upstream offset, so a filtered page never skips items on the next request. `filtered_out` counts removed cards. `sort` orders the returned window; category mode accepts only `relevance` and needs an offset that is a multiple of `limit`.

## Credits

A successful request costs **1 credit**. Errors and challenges cost nothing. The response shows the charge in `meta.credits_charged`.

## Known gaps

Review text is client-side and unsupported; only aggregate numbers are returned. Promotion group rows are excluded from product cards. Some INSTORE_ONLY items have `price: null` because the source publishes no online price; no number is invented. For stock send `uids[]=a&uids[]=b` (2 to 10 nine digit uids). Exact similar-product data is not offered; use the public recommendation rails.

- **Documentation:** [https://scrappa.co/docs/migros-api/migros_search](https://scrappa.co/docs/migros-api/migros_search)
- **API group:** Migros Switzerland API
- **Endpoint:** `GET https://scrappa.co/api/migros/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` | integer | No | Category id from the categories route. Use this or query. |
| `price_min` | number | No | Minimum numeric CHF price. |
| `price_max` | number | No | Maximum numeric CHF price. |
| `brand` | string | No | Brand or name fragment. |
| `sort` | string | No | relevance, price or price-desc. |
| `from` | integer | No | Result offset, not a page number. |
| `limit` | integer | No | Items per page, 1 to 24. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/migros/search?query=milch"
```

## Example response

```json
{
    "success": true,
    "context": {
        "country": "CH",
        "region": "national",
        "store_type": "OFFLINE",
        "language": "de"
    },
    "meta": {
        "endpoint_family": "migros-search",
        "billable": true,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | No public record for that id (`not_found`). Non-billable. |
| 422 | Validation Error | A parameter is missing, malformed or conflicts with another. Unknown parameters are rejected. Non-billable. |
| 503 | Upstream Unavailable | The source could not be reached or changed its shape. Retryable and never billed. Clients are never rate limited. |

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