Get Cities
get_citiesGet cities for a country, optionally filtered by state. Pass country_code (e.g., "US") and optionally state_code (e.g., "CA") to narrow results.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"_apiKey": "your-country-state-city-api-key",
"state_code": "CA",
"country_code": "US"
},
"name": "get_cities"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _apiKey | Yes | CountryStateCity API key | |
| state_code | No | State/province code to filter by (e.g., "CA", "NY", "TX") | |
| country_code | Yes | ISO2 country code (e.g., "US", "IN") |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Total number of cities returned | |
| cities | Yes | ||
| state_code | Yes | State code filter if provided, null if not | |
| country_code | Yes | ISO2 country code provided |