# Allegro Categories API Documentation

<p><strong>Allegro Categories API Documentation</strong> List the 13 Allegro department roots with id and alias (PL, 1 credit), or send a category id or alias to get its path and its sub-categories with offer counts (20 credits). The ids and aliases work unchanged as the category of the search route. Cost: 1 credit for the root list, 20 credits for one category tree. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/allegro-api/allegro_categories](https://scrappa.co/docs/allegro-api/allegro_categories)
- **API group:** Allegro API
- **Endpoint:** `GET https://scrappa.co/api/allegro/categories`

## 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` | string | No | Category id or alias, for example 165 or elektronika. Leave empty for the 13 department roots (PL only, 1 credit). Department roots exist on PL only. A category without sub-categories returns an empty, unbilled answer. |
| `country` | string | No | Allegro storefront: PL (allegro.pl, PLN), CZ (allegro.cz, CZK) or SK (allegro.sk, EUR). Default PL. |

## Example response

```json
{
    "data": {
        "path": [
            {
                "id": "42540aec-367a-4e5e-b411-17c09b08e41f",
                "name": "Elektronika",
                "alias": "elektronika"
            },
            {
                "id": "4",
                "name": "Telefony i Akcesoria",
                "alias": "telefony-i-akcesoria"
            },
            {
                "id": "165",
                "name": "Smartfony i telefony kom\u00f3rkowe",
                "alias": "smartfony-i-telefony-komorkowe-165"
            }
        ],
        "country": "PL",
        "category": {
            "id": "165",
            "name": "Smartfony i telefony kom\u00f3rkowe",
            "alias": "smartfony-i-telefony-komorkowe-165"
        },
        "children": [
            {
                "id": "4937",
                "name": "Alcatel",
                "alias": "smartfony-i-telefony-komorkowe-alcatel-4937",
                "offers_count": 127
            },
            {
                "id": "48978",
                "name": "Apple",
                "alias": "smartfony-i-telefony-komorkowe-apple-48978",
                "offers_count": 9999
            },
            {
                "id": "250568",
                "name": "Asus",
                "alias": "smartfony-i-telefony-komorkowe-asus-250568",
                "offers_count": 39
            },
            {
                "id": "257985",
                "name": "Blackview",
                "alias": "smartfony-i-telefony-komorkowe-blackview-257985",
                "offers_count": 441
            },
            {
                "id": "253022",
                "name": "Cat Phones",
                "alias": "smartfony-i-telefony-komorkowe-cat-phones-253022",
                "offers_count": 33
            },
            {
                "id": "258336",
                "name": "Cubot",
                "alias": "smartfony-i-telefony-komorkowe-cubot-258336",
                "offers_count": 295
            }
        ]
    },
    "meta": {
        "credits": 20,
        "billable": true,
        "endpoint_family": "categories"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. This response is not billable. |
| 404 | Not Found | No category has this id or alias. This response is not billable. |
| 502 | Upstream Unavailable | Allegro did not answer in time or blocked the lookup. Retry. This response is not billable. |

## 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)
