curl --request POST \
--url https://api.companyenrich.com/v2/geo/cities \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"stateIds": [
123
],
"countryCodes": [
"<string>"
],
"query": "<string>",
"pageSize": 50,
"cursor": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stateIds: [123],
countryCodes: ['<string>'],
query: '<string>',
pageSize: 50,
cursor: '<string>'
})
};
fetch('https://api.companyenrich.com/v2/geo/cities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.companyenrich.com/v2/geo/cities"
payload = {
"stateIds": [123],
"countryCodes": ["<string>"],
"query": "<string>",
"pageSize": 50,
"cursor": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"id": 123,
"name": "<string>",
"countryCode": "<string>",
"stateId": 123,
"latitude": 123,
"longitude": 123
}
],
"nextCursor": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Search cities
Searches names using a literal, case-insensitive substring. Results use cursor pagination in stable code or ID order. Cursors expire 30 minutes after the first page; keep the same filters when continuing. This endpoint does not consume credits.
curl --request POST \
--url https://api.companyenrich.com/v2/geo/cities \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"stateIds": [
123
],
"countryCodes": [
"<string>"
],
"query": "<string>",
"pageSize": 50,
"cursor": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stateIds: [123],
countryCodes: ['<string>'],
query: '<string>',
pageSize: 50,
cursor: '<string>'
})
};
fetch('https://api.companyenrich.com/v2/geo/cities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.companyenrich.com/v2/geo/cities"
payload = {
"stateIds": [123],
"countryCodes": ["<string>"],
"query": "<string>",
"pageSize": 50,
"cursor": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"id": 123,
"name": "<string>",
"countryCode": "<string>",
"stateId": 123,
"latitude": 123,
"longitude": 123
}
],
"nextCursor": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
API Token used for authentication. Example: "Authorization: Bearer {token}"
Body
Up to 100 positive state IDs. Results may belong to any supplied state and must also match any country filter.
100Up to 250 two-letter country codes. Results may belong to any supplied country. Codes are trimmed and case-insensitive.
250A literal, case-insensitive substring of the name. Leading and trailing whitespace is ignored.
100The maximum number of results to return. Defaults to 100.
1 <= x <= 100The cursor from the previous response. Omit for the first page. Keep the same filters; pageSize may change.
2048