# eBay Categories

The eBay category tree of one marketplace: top categories, sub categories and leaf categories with category id, name, slug, browse node, depth and link. Use `parent` for one subtree and `depth` to limit the levels. Use the ids with eBay Search. The tree is cached for 24 hours. The marketplaces com, de and com.au are supported; co.uk answers 422. Costs 1 credit.

- **Documentation:** [https://scrappa.co/docs/ebay-api/ebay_categories](https://scrappa.co/docs/ebay-api/ebay_categories)
- **API group:** eBay API
- **Endpoint:** `GET https://scrappa.co/api/ebay/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 |
| --- | --- | --- | --- |
| `parent` | integer | No | Return only the children of this category id. |
| `depth` | integer | No | Levels to return, 1 to 3. Default: 3. |
| `site` | string | No | eBay marketplace: com, de or com.au. Default: com. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/ebay/categories?depth=2"
```

## Example response

```json
{
    "success": true,
    "data": {
        "site": "com",
        "parent": null,
        "categories": [
            {
                "id": 6000,
                "name": "eBay Motors",
                "slug": "Auto-Parts-and-Vehicles",
                "browse_node": 1865334,
                "depth": 1,
                "children": [
                    {
                        "id": 6028,
                        "name": "Parts & Accessories",
                        "slug": "Auto-Parts-Accessories",
                        "depth": 2
                    }
                ]
            }
        ]
    },
    "meta": {
        "endpoint_family": "categories"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | eBay has no result for this request. This response is not billable. |  |
|  | A public parameter is invalid. This response is not billable. |  |
|  | eBay did not return usable data for this request. 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)
