# OfferUp Categories API Documentation

Scrappa's `GET /api/offerup/categories` endpoint returns OfferUp's complete category tree so you can build category pickers without hardcoding ids.

## Three levels, not two

The default response is the full tree: 14 top-level categories, 137 second-level, and 1,093 third-level. The `counts` object reports what came back so you can assert the tree is complete rather than trusting the request.

Pass `exclude_l3=true` for the lighter two-level tree when you only need a top-level picker.

## Category ids are paths, not numbers

Ids are dotted hierarchical paths such as `1`, `1.2`, and `5.1`, where `5` is vehicles. The widely repeated claim that these are flat numeric ids is wrong, and a lookup table keyed on the wrong id format silently returns nothing.

Pass any id to search as the `cid` parameter for keyword-free category browsing. `category_id` behaves differently and requires a keyword — see [Search](/docs/offerup-api/offerup_search).

- **Documentation:** [https://scrappa.co/docs/offerup-api/offerup_categories](https://scrappa.co/docs/offerup-api/offerup_categories)
- **API group:** OfferUp API
- **Endpoint:** `GET https://scrappa.co/api/offerup/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 |
| --- | --- | --- | --- |
| `exclude_l3` | string | No | Return only the top two levels. Defaults to false, which returns all three. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/offerup/categories?exclude_l3=0"
```

## Example response

```json
{
    "success": true,
    "counts": {
        "level_1": 14,
        "level_2": 137,
        "level_3": 1093
    },
    "categories": [
        {
            "id": "5",
            "label": "Vehicles",
            "level": 1,
            "children": []
        }
    ]
}
```

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