Search states
Search our states to filter companies in a specific location.
GET
https://api.thecompaniesapi.com/v2/locations/states
Free
If you need to filter companies by state, you can use this feature to retrieve information like their code.
Signup to access all our API features
Get your 500 free credits and start enriching and searching companies.
No credit card required
Query parameters
pagenumber (optional)
The page to fetch (default to 1).
searchstring (optional)
An additional search query applied to the state name.
sizenumber (optional)
The number of states to be returned (between 1 and 20). Default to 10.
Response schema
statesarray
The states 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.searchStates({
search: 'california',
size: 5
})
const states = response.data.states // States that match the name
const meta = response.data.meta // Meta information