Craigslist API endpoint
Completes a partial text with the Craigslist suggest API. type search returns search-box completions (optionally biased by area and category), type makemodel returns vehicle make and model completions (use with the auto_make_model filter of the vehicle categories), and type location returns places with their Craigslist area slug, city, region and postal code. Any other type is rejected.
/craigslist/suggestCompletes a partial text with the site's own suggest API (sapi/suggest/{type}).
type (required), a closed set proven against the live API: search (search-box completions), makemodel (vehicle make and model completions, the values to use with the auto_make_model filter of vehicle categories such as cta) and location (places). Every other value (for example title, query, posting-form) is rejected with a 400.q (required): the partial text, 1 to 100 characters.area: an area slug from craigslist-areas to bias search and makemodel.category: a category id from craigslist-categories to bias search and makemodel.lat with lon: bias location suggestions.search and makemodel fill suggestions[] (strings); location fills locations[] with the same objects as craigslist-locations, and the other list is empty.
Example response (type makemodel):
{
"code": 200,
"data": {
"type": "makemodel",
"query": "hon",
"suggestions": ["honda accord", "honda civic", "honda cr-v"],
"locations": []
}
}
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| type | string | Yes | Suggestion type Allowed values: search, makemodel, location. | makemodel | |
| q | string | Yes | Partial text, 1 to 100 characters | hon | |
| area | string | No | Area slug from craigslist_areas to bias search and makemodel | sfbay | |
| category | string | No | Category id from craigslist_categories to bias search and makemodel | cta | |
| lat | number | No | Latitude to bias location suggestions; requires lon | ||
| lon | number | No | Longitude to bias location suggestions; requires lat | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/craigslist/suggest?type=makemodel&q=hon" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"data": {
"type": "makemodel",
"query": "hon",
"suggestions": [
"honda accord",
"honda civic",
"honda cr-v"
],
"locations": []
}
}Request schema
No body schema
Response schema
#/definitions/craigslist.suggestResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | craigslist.SuggestResponse | No | ||||
| data.locations | array | No | ||||
| data.locations[].area_id | integer | No | 3 | |||
| data.locations[].area_slug | string | No | newyork | |||
| data.locations[].city | string | No | Brooklyn | |||
| data.locations[].country | string | No | US | |||
| data.locations[].lat | number | No | ||||
| data.locations[].lon | number | No | ||||
| data.locations[].postal | string | No | 11202 | |||
| data.locations[].radius | number | No | ||||
| data.locations[].region | string | No | NY | |||
| data.locations[].subarea_id | integer | No | ||||
| data.query | string | No | ||||
| data.suggestions | array | No | ||||
| data.type | string | No | search | |||
| 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/suggest?type=makemodel&q=hon" \
-H "x-api-key: $CRAWLORA_API_KEY"