The Companies API LogoThe Companies API Logo
APIUse casesCompanies
LoginLogin
Get started
Authentication
Errors
Rate limits
Webhooks
Datapoints
Companies
Enrich from domain
Enrich from email
Enrich from social network
Count companies
Search companies
Search by name
Search by prompt
Search similar
Ask company
Fetch context
Find email patterns
Fetch analytics
Export analytics
Industries
Search industries
Find similar industries
Lists
Fetch lists
Create list
Fetch companies
Toggle companies
Locations
Search cities
Search counties
Search countries
Search states
Search continents
Actions
Request action
Fetch actions
Teams
Fetch team
Technologies
Search technologies
Utilities
API health
OpenAPI spec
Get started
Authentication
Errors
Rate limits
Webhooks
Datapoints
Companies
Enrich from domain
Enrich from email
Enrich from social network
Count companies
Search companies
Search by name
Search by prompt
Search similar
Ask company
Fetch context
Find email patterns
Fetch analytics
Export analytics
Industries
Search industries
Find similar industries
Lists
Fetch lists
Create list
Fetch companies
Toggle companies
Locations
Search cities
Search counties
Search countries
Search states
Search continents
Actions
Request action
Fetch actions
Teams
Fetch team
Technologies
Search technologies
Utilities
API health
OpenAPI spec

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:
C#

Go

Java

JavaScript
SDK

PHP

Python

Ruby

Rust

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

Find similar industries

Identify related sectors and expand your business opportunities.

Search counties

Search our counties to filter companies in a specific location.

A glowing background image to highlight the titleA glowing background image to highlight the title
© 2025 The Companies API
  • Updates
  • Terms
  • Privacy
  • FAQ
  • Status

Fast-growing SaaS companies with remote teams