List zones
Zones with companies, largest first. Values for the zone filter.
GEThttps://findbytown.com/api/v1/zonesNo quota
Parameters
| Name | Type | Description |
|---|---|---|
| country | string | Two-letter country code, such as FR. See GET /countries. |
| locale | en | fr | es | Language of labels and category names: en, fr or es. Defaults to the language of your account. |
Examples
curl "https://findbytown.com/api/v1/zones?country=FR&locale=en" \
-H "Authorization: Bearer fbt_EXAMPLE_not_a_real_key_0000"const res = await fetch("https://findbytown.com/api/v1/zones?country=FR&locale=en", {
headers: { Authorization: "Bearer fbt_EXAMPLE_not_a_real_key_0000" },
});
const body = await res.json();
if (!res.ok) throw new Error(body.error);
console.log(body);import requests
res = requests.get(
"https://findbytown.com/api/v1/zones?country=FR&locale=en",
headers={"Authorization": "Bearer fbt_EXAMPLE_not_a_real_key_0000"},
)
body = res.json()
if not res.ok:
raise RuntimeError(body["error"])
print(body)Response
Example with fake values:
{
"data": [
{
"slug": "fr_idf",
"country": "FR",
"level": "admin1",
"label": "Ile-de-France",
"count": 900
}
]
}Errors
| Code | HTTP status | Meaning |
|---|---|---|
| validation_error | 400 | A parameter is missing or has the wrong form. details names it. |
| unknown_parameter | 400 | A query parameter is not one this endpoint knows, usually a typing mistake. details names it. |
| use_reveal_endpoint | 400 | You sent reveal= on a read. Reads never spend quota: use the reveal endpoint. |
| missing_api_key | 401 | No Authorization header, or an empty one. |
| invalid_api_key | 401 | The key does not exist or has been revoked. |
| plan_without_api | 403 | The account's current plan does not include the API. Applies from the moment a plan ends. |
| suspended | 403 | The account is suspended. Its keys start working again if the suspension is lifted. |
| rate_limited | 429 | Too many requests this minute. Wait for the number of seconds in Retry-After. |
| blocked | 429 | Access to company data is temporarily paused because of automated use, such as walking through ids. Retry-After gives the time left. Write to support if this is a mistake. |
| internal_error | 500 | Something went wrong on our side. Quote requestId when writing to support. |