Craigslist API endpoint
Returns how many postings match a query in each Craigslist section and category of an area, the same per-category counts the site shows beside its search box. Use it to see where a query has results before calling craigslist_search with a category. Optionally count around a postal code or lat and lon with a radius, or within one subarea.
/craigslist/category-countsarea (required): an area slug from craigslist-areas.q (required): the search text, 1 to 200 characters.postal, or lat with lon, plus search_distance (miles, 1 to 10000): count around a point instead of the whole area. search_distance needs postal or lat and lon.subarea: a subarea abbreviation from the subarea filter of craigslist-category-filters (for example nby for the north bay of sfbay).sections[] has id (ccc, bbb, hhh, sss, jjj, ggg), label, count and its categories[] (id, label, count); sections with no matches may be absent. total is the sum of the section counts.
Example response (abridged):
{
"code": 200,
"data": {
"area": "sfbay",
"area_id": 1,
"query": "bicycle",
"total": 9500,
"sections": [
{"id": "hhh", "label": "housing", "count": 449, "categories": [{"id": "apa", "label": "apartments / housing for rent", "count": 337}]},
{"id": "sss", "label": "for sale", "count": 8992, "categories": [{"id": "bia", "label": "bikes", "count": 2300}]}
]
}
}
| Field | Filled in, of 2 checked | Values in the sample |
|---|---|---|
| id | 2 | |
| label | 2 | “housing” and 1 other value |
| count | 2 | 3 to 27, median 3 |
| categories | 2 | median 1 entry |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| area | string | Yes | Area slug from craigslist_areas | sfbay | |
| q | string | Yes | Search text to count matches for | bicycle | |
| postal | string | No | Postal or ZIP code to count around | 10001 | |
| lat | number | No | Latitude to count around; requires lon | ||
| lon | number | No | Longitude to count around; requires lat | ||
| search_distance | integer | No | Radius in miles around postal or lat and lon Minimum: 1. Maximum: 10000. | ||
| subarea | string | No | Subarea abbreviation from the subarea filter of craigslist_category_filters | nby | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/craigslist/category-counts?area=sfbay&q=bicycle" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"data": {
"area": "sfbay",
"area_id": 1,
"query": "bicycle",
"total": 9500,
"sections": [
{
"id": "hhh",
"label": "housing",
"count": 449,
"categories": [
{
"id": "apa",
"label": "apartments / housing for rent",
"count": 337
}
]
},
{
"id": "sss",
"label": "for sale",
"count": 8992,
"categories": [
{
"id": "bia",
"label": "bikes",
"count": 2300
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/craigslist.categoryCountsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | craigslist.CategoryCountsResponse | No | ||||
| data.area | string | No | ||||
| data.area_id | integer | No | ||||
| data.query | string | No | ||||
| data.sections | array | No | ||||
| data.sections[].categories | array | No | ||||
| data.sections[].categories[].count | integer | No | ||||
| data.sections[].categories[].id | string | No | bia | |||
| data.sections[].categories[].label | string | No | bikes | |||
| data.sections[].count | integer | No | ||||
| data.sections[].id | string | No | sss | |||
| data.sections[].label | string | No | for sale | |||
| data.total | integer | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/craigslist/category-counts?area=sfbay&q=bicycle" \
-H "x-api-key: $CRAWLORA_API_KEY"