# Worten Product Variants API Documentation

`GET /api/worten/variants` returns `variants`, `axes[]`, `property_groups` and the normalized `items` of a canonical product id from search.

Each axis has `property`, `value` and `id`. Items are unique by id; items with no price and no stock are removed. Prices, ratings and images use the same shape as search. The request bills only when an item or an axis exists.

## Credits

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

- **Documentation:** [https://scrappa.co/docs/worten-api/worten_variants](https://scrappa.co/docs/worten-api/worten_variants)
- **API group:** Worten API
- **Endpoint:** `GET https://scrappa.co/api/worten/variants`

## 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 |
| --- | --- | --- | --- |
| `id` | string | Yes | Canonical product id from a search result. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/worten/variants?id=ffffffff-0000-4000-a000-000077b0f986"
```

## Example response

```json
{
    "success": true,
    "site": "pt",
    "product": {
        "id": "ffffffff-0000-4000-a000-000077b0f986"
    },
    "variants": [
        {
            "pk": "w:01M25AD80BFXQM7G9EVTBVFRJT"
        }
    ],
    "axes": [
        {
            "property": "cor",
            "value": "Bord\u00f4",
            "id": "01M25AD80BFXQM7G9EVTBVFRJT"
        }
    ],
    "items": [
        {
            "id": "ffffffff-0000-4000-a000-0000795400c1",
            "sku": "8997856",
            "price": 1499,
            "currency": "EUR",
            "in_stock": true
        }
    ],
    "property_groups": [
        {
            "item_id": "retek;5501.03.06"
        }
    ],
    "meta": {
        "endpoint_family": "worten-variants",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The storefront has no product with that id (`not_found`). Non-billable. |
| 422 | Validation Error | A parameter is missing or unsupported. Only page sizes 24 and 48 are accepted, and filters use facet slugs from the search result. Non-billable. |
| 503 | Upstream Unavailable | The storefront could not be reached, answered with a challenge, or changed its response 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)
