# Gumtree Categories API Documentation

Retrieve the complete Gumtree UK category tree as nested nodes with id, name, slug and children. Use the id as category_id in the search endpoint. The tree is cached for 24 hours.

- **Documentation:** [https://scrappa.co/docs/gumtree-api/gumtree_categories](https://scrappa.co/docs/gumtree-api/gumtree_categories)
- **API group:** Gumtree API
- **Endpoint:** `GET https://scrappa.co/api/gumtree/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/gumtree/categories"
```

## Example response

```json
{
    "success": true,
    "data": {
        "categories": {
            "id": "1",
            "name": "All Categories",
            "slug": "all",
            "seo_name": "All Classifieds",
            "children": [
                {
                    "id": "2549",
                    "name": "For Sale",
                    "slug": "for-sale",
                    "seo_name": "Stuff for Sale",
                    "children": [
                        {
                            "id": "2518",
                            "name": "Audio & Stereo",
                            "slug": "stereos-audio",
                            "seo_name": "Audio & Stereo Equipment for Sale"
                        },
                        {
                            "id": "2497",
                            "name": "Baby & Kids Stuff",
                            "slug": "baby-kids-stuff",
                            "seo_name": "Baby & Kids Stuff for Sale"
                        }
                    ]
                },
                {
                    "id": "2551",
                    "name": "Motors",
                    "slug": "cars-vans-motorbikes",
                    "children": [
                        {
                            "id": "9314",
                            "name": "Parts",
                            "slug": "motors-parts",
                            "seo_name": "Parts for Sale"
                        },
                        {
                            "id": "9311",
                            "name": "Cars",
                            "slug": "cars",
                            "seo_name": "Cars for Sale"
                        }
                    ]
                }
            ]
        }
    },
    "meta": {
        "endpoint_family": "categories",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 502 | Invalid Source Response | The upstream answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

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