Search cities
Search our cities to filter companies in a specific location.
GET
https://api.thecompaniesapi.com/v2/locations/cities
Free
If you need to filter companies by city, you can use this feature to retrieve information like their code.
Signup to access all the features
Get your API token and start implementing the API in your product with 500 free credits.
No credit card required
Query parameters
pagenumber (optional)
The page to fetch (default to 1).
searchstring (optional)
An additional search query applied to the city name.
sizenumber (optional)
The number of cities to be returned (between 1 and 20). Default to 10.
Response schema
citiesarray
The cities that match your conditions.
metaobject
The metas information.
Code examples
Select your favorite language:
import createClient from '@thecompaniesapi/sdk'
const tca = createClient({ apiToken: 'YOUR_API_TOKEN' })
const response = await tca.searchCities({
search: 'new york',
size: 5
})
const cities = response.data.cities // Cities that match the name
const meta = response.data.meta // Meta information