# Craigslist Category tree API (craigslist.categories)

- Canonical page: [https://everyinfra.com/en/craigslist-api/categories](https://everyinfra.com/en/craigslist-api/categories?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "craigslist", "action": "categories", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=craigslist&action=categories

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| limit | integer (1–) | no | not declared | Positive integer (≥1): the maximum number of results to return; omit it to get every result from this call. Setting it only trims the response to at most this many and never fetches more; billing is the same with or without `limit`, whatever the value. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| category | Category: in `posting_detail` and `categories` the three-letter category code, such as bik or apa; in `search` the category name, sometimes the code. |
| category_id | Numeric ID of the category. |
| name | Name: in `areas` the city site's name, such as new york city; in `categories` the category name, such as bicycles - by owner. |
| type | The section the category belongs to, such as for_sale, housing, jobs, services, community or gigs. |
| rank | Position of the row in the platform's order, from 1. |
| collected_at | When this record was collected (ISO 8601, UTC). |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "craigslist",
  "action": "categories",
  "params": {}
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "craigslist",
        "action": "categories",
        "params": {},
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "craigslist",
  "action": "categories",
  "results": [
    {
      "category": …,
      "category_id": …,
      "name": …,
      "type": …,
      "rank": …,
      "collected_at": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=craigslist
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
