# Milanuncios Categories API Documentation

Returns the complete category tree as nested nodes with id, name, slug and children. Use a node id as the category parameter of /search. Roots include 1 Motor, 13 Coches (cars) and 32 Inmobiliaria; leaf ids 131 (flats for sale) and 132 (flats for rent) work for real estate. No parameters.

- **Documentation:** [https://scrappa.co/docs/milanuncios-api/milanuncios_categories](https://scrappa.co/docs/milanuncios-api/milanuncios_categories)
- **API group:** Milanuncios API
- **Endpoint:** `GET https://scrappa.co/api/milanuncios/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.

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/milanuncios/categories"
```

## Example response

```json
{
    "success": true,
    "data": {
        "categories": [
            {
                "id": 1,
                "name": "Motor",
                "slug": "motor",
                "children": [
                    {
                        "id": 13,
                        "name": "Coches",
                        "slug": "coches-de-segunda-mano"
                    },
                    {
                        "id": 15,
                        "name": "Todoterreno",
                        "slug": "todoterreno-de-ocasion"
                    }
                ]
            }
        ]
    },
    "meta": {
        "endpoint_family": "categories",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested ad or car make was not found or has expired. This response is not billable. |
| 422 | Validation Error | A parameter is invalid, including a sort newest or oldest on a real estate category or an offset + limit above 10000. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result from Milanuncios. 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)
