# Darty Product Search API Documentation

`GET /api/darty/search` returns public darty.pt product hits as JSON. Each item has `id`, `handle`, `sku`, `title`, `brand`, `price`, `original_price`, `discount_percent`, `currency`, `online_available`, `stock_status`, `specs`, `image`, `rating` and `review_count`. Prices are numbers in EUR. `specs` is an object and is `{}` when the item has no published properties. `online_available`, `stock_status` and variant availability share one stock source. `brand` is read from the product properties or the vendor, or stays `null`. `rating` and `review_count` are `null` because no public review source exists. Pass facet filters verbatim in `filter`; `inventory_available=true` adds the site in-stock filter. Unsupported filters return 422 before any lookup.

## Credits

A successful request with results costs **1 credit**. Errors, challenges and empty results cost nothing.

- **Documentation:** [https://scrappa.co/docs/darty-api/darty_search](https://scrappa.co/docs/darty-api/darty_search)
- **API group:** Darty API
- **Endpoint:** `GET https://scrappa.co/api/darty/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 | Yes | Search words. |
| `page` | integer | No | Site result page, 1-50. |
| `filter` | string | No | Site literal facet filter, passed verbatim. |
| `inventory_available` | boolean | No | Only items the site reports in stock. |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "site": "darty-pt",
    "query": "televisao",
    "page": 1,
    "page_size": 24,
    "total": 1361,
    "sort": "relevance",
    "items": [
        {
            "position": 1,
            "id": "12345678",
            "handle": "tv-lg-oled-55",
            "sku": "SKU-1234",
            "title": "TV OLED 55 pouces",
            "brand": "LG",
            "price": 899.99,
            "original_price": 1099.99,
            "discount_percent": 18,
            "currency": "EUR",
            "online_available": true,
            "stock_status": "in_stock",
            "specs": [],
            "image": "https://cdn.shopify.com/s/files/1/example/tv.jpg",
            "rating": null,
            "review_count": null
        }
    ],
    "meta": {
        "endpoint_family": "darty-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Parameter Not Available | A parameter has no verified recipe. It is rejected before any lookup (`unsupported_filter`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Storefront Unavailable | The storefront could not be reached or answered with a challenge. 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)
