# Craigslist Categories API Documentation

List every Craigslist category: the code to use as category in the search endpoint, the name and the section (for sale, housing, jobs, services, gigs, community, events, resumes, calendar). Filter by a name substring. The aggregate codes sss (all for sale), bia (all bicycles) and hhh (all housing) also work in search. The list is cached for 24 hours. A filter without matches is a successful empty result.

- **Documentation:** [https://scrappa.co/docs/craigslist-api/craigslist_categories](https://scrappa.co/docs/craigslist-api/craigslist_categories)
- **API group:** Craigslist API
- **Endpoint:** `GET https://scrappa.co/api/craigslist/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 |
| --- | --- | --- | --- |
| `query` | string | No | Case-insensitive substring of the category code or name. Example: bicycles. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/craigslist/categories?query=bicycles"
```

## Example response

```json
{
    "success": true,
    "data": {
        "total": 2,
        "results": [
            {
                "category": "bik",
                "name": "bicycles - by owner",
                "section": "for sale"
            },
            {
                "category": "bid",
                "name": "bicycles - by dealer",
                "section": "for sale"
            }
        ]
    },
    "meta": {
        "endpoint_family": "categories",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid. This response is not billable. |
| 502 | Invalid Source Response | Craigslist 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)
