# LDLC Product Search API Documentation

`GET /api/ldlc/search` returns public LDLC products as structured JSON.

## What you get

Each item has `id` (the PB product id), `offer_id`, `name`, `description`, numeric `price`, `original_price`, `discount_percent`, `currency` (EUR), `stock_code`, `stock_text`, `in_stock`, `rating`, full-size `images` and `url`. Use `id` unchanged with product and reviews.

## Scope

`q` searches keywords. Only page 1 is available; a later page returns 422. Prices are numbers in EUR. Price and sort filters live on the category route; keyword-search filters and later search pages are named follow-ups. A zero-result search is a successful, billable response.

## Credits

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

- **Documentation:** [https://scrappa.co/docs/ldlc-api/ldlc_search](https://scrappa.co/docs/ldlc-api/ldlc_search)
- **API group:** LDLC API
- **Endpoint:** `GET https://scrappa.co/api/ldlc/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 |
| --- | --- | --- | --- |
| `q` | string | Yes | Search words. |
| `page` | integer | No | Only page 1 is available. |
| `locale` | string | No | Storefront. Currently fr. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/ldlc/search?q=rtx"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "PB00512844",
                "offer_id": "AR00512844",
                "name": "Gigabyte GeForce RTX 5070",
                "price": 269.95,
                "original_price": 279.95,
                "discount_percent": 3,
                "currency": "EUR",
                "stock_text": "En stock",
                "in_stock": true,
                "rating": 9,
                "images": [
                    "https://media.ldlc.com/r1600/ld/products/LD0005128412.jpg"
                ],
                "url": "https://www.ldlc.com/fiche/PB00512844.html"
            }
        ],
        "pagination": {
            "page": 1,
            "page_size": 48,
            "item_count": 48,
            "has_more": true
        },
        "query": "rtx",
        "locale": "fr",
        "listing": "search",
        "applied_filters": {
            "locale": "fr",
            "q": "rtx",
            "page": 1
        }
    },
    "meta": {
        "endpoint_family": "ldlc-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1,
        "unavailable_reason": []
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or unsupported. A bare category id without a public slug and an unsupported storefront are rejected instead of returning a different page. Non-billable. |
| 503 | Upstream Unavailable | The storefront could not be reached or changed its page shape (`upstream_blocked`, `upstream_unavailable`, `parser_drift`). 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)
