# Coop Online Store Stock API Documentation

`GET /api/coop/stores?availabilityProductId=...&onlyWithAvailableProductId=true` narrows the store list to one product code. Send both parameters together.

## What you get

Each item carries `product_code` and `product_available`. Availability is `true` or `false` only when the storefront states it. When the storefront does not state it the value is `null`; a store appearing in the list is never read as proof of stock.

## Credits

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

- **Documentation:** [https://scrappa.co/docs/coop-api/coop_stock](https://scrappa.co/docs/coop-api/coop_stock)
- **API group:** Coop Online API
- **Endpoint:** `GET https://scrappa.co/api/coop/stores`

## 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 |
| --- | --- | --- | --- |
| `latitude` | number | Yes | Latitude between -90 and 90. |
| `longitude` | number | Yes | Longitude between -180 and 180. |
| `availabilityProductId` | string | Yes | Product code from search results. |
| `onlyWithAvailableProductId` | boolean | Yes | Must be true with the product code. |
| `radius` | number | No | Search radius in kilometres. |
| `page` | integer | No | Result page of 20 stores. |
| `language` | string | No | de, fr, it or en. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/coop/stores?latitude=47.376&longitude=8.541&availabilityProductId=4446520&onlyWithAvailableProductId=1"
```

## Example response

```json
{
    "success": true,
    "items": [
        {
            "id": "9521581359127",
            "product_code": "4446520",
            "product_available": null
        }
    ],
    "stock_filter": {
        "product_code": "4446520",
        "applied_upstream": true,
        "availability_is_explicit_only": true
    },
    "page": 1,
    "meta": {
        "endpoint_family": "coop-stock",
        "billable": true,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or conflicting. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | The storefront could not be reached, answered with a challenge, or changed its JSON 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)
