# LDLC Category Listing API Documentation

`GET /api/ldlc/category` returns public products from one LDLC category. Pass the `category_id` and the public `category_slug` from the site.

## What you get

Each item has `id`, `offer_id`, `name`, numeric `price`, `original_price`, `discount_percent`, `currency` (EUR), stock fields, `rating` and full-size `images`. Category prices and stock codes are read from the page source.

## Filters

`filters` accepts the site's own plus-joined filter values. `sort` is the public sort index. `page` selects the result page. All three are built into the upstream address, so returned products match the request. A bare category id without a slug is rejected. A later page together with filters returns 422; the filtered page-2 address is a named follow-up.

## 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_category](https://scrappa.co/docs/ldlc-api/ldlc_category)
- **API group:** LDLC API
- **Endpoint:** `GET https://scrappa.co/api/ldlc/category`

## 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 |
| --- | --- | --- | --- |
| `category_id` | string | Yes | Category id from the site or sitemap. |
| `category_slug` | string | Yes | Full public category slug path. |
| `filters` | string | No | Plus-joined public filter values. |
| `sort` | integer | No | Public sort index. |
| `page` | integer | No | Result page, starting at 1. |
| `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/category?category_id=c4684&category_slug=informatique%2Fpieces-informatique%2Fcarte-graphique-interne&sort=4"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "PB00512844",
                "price": 269.95,
                "currency": "EUR",
                "stock_text": "En stock",
                "in_stock": true
            }
        ],
        "pagination": {
            "page": 1,
            "page_size": 48,
            "item_count": 48,
            "has_more": true
        },
        "category": {
            "id": "c4684",
            "slug": "informatique/pieces-informatique/carte-graphique-interne"
        },
        "sort": 4,
        "applied_filters": {
            "category_id": "c4684",
            "filters": null,
            "sort": 4,
            "page": 1
        }
    },
    "meta": {
        "endpoint_family": "ldlc-category",
        "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)
