# PeoplePerHour Categories API Documentation

`GET /api/peopleperhour/categories` returns public categories with their subcategories and ids. `query` filters category names and slugs, and `id` returns one category by its id. Use a category id as the `category` filter on the project and seller search routes. The heavy taxonomy is cached about one day.

## Credits

A successful request costs **1 credit**. Errors and blocks cost nothing. The response shows the charge in `meta.credits_charged`.

- **Documentation:** [https://scrappa.co/docs/peopleperhour-api/peopleperhour_categories](https://scrappa.co/docs/peopleperhour-api/peopleperhour_categories)
- **API group:** PeoplePerHour API
- **Endpoint:** `GET https://scrappa.co/api/peopleperhour/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 | Filter category names. |
| `id` | string | No | Category id. |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "data": {
        "categories": [
            {
                "id": "27",
                "name": "Design & Creative",
                "slug": "design",
                "subcategories": [
                    {
                        "id": "271",
                        "name": "Graphic Design"
                    }
                ]
            }
        ]
    },
    "meta": {
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or unusable. Unknown parameters are rejected. Non-billable. |
| 503 | Upstream Unavailable | The upstream blocked the request or could not be reached. Non-billable. Clients are never rate limited. |

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