Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Country State City API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fcountrystatecity.in%2Fcountry-state-city" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fcountrystatecity.in%2Fcountry-state-city" | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with Country State City API.
List all countries with their ISO codes and metadata
Look up a single country or state by its ISO code
Get the states or provinces within a country
Get the cities within a country or a specific state
Patterns agents use Country State City API for, with concrete tasks.
GET STARTED
★ Agent-Driven Address Form Population
An AI agent connected through Jentic can fill in the geographic fields of an address or profile form without hard-coded lists. It lists countries, then fetches the states for the chosen country and the cities for the chosen state, so the form always reflects the API's 247+ countries and 151,000+ cities rather than a stale local copy.
Given a selected country ISO2 code, fetch its states and then the cities of the chosen state to build a three-level address selector
Location Reference Lookup
Systems that store an ISO country or state code often need the human-readable name and related metadata. The Country State City API resolves a country or state from its ISO2 code, so a workflow can turn stored codes into display names and validate that a state genuinely belongs to a country.
Resolve the ISO2 code 'US' to its country record and confirm that the state code 'CA' is one of its states
Geographic Data Enrichment
Before geocoding or mapping, an agent often needs a clean, canonical name for a city or state. Using the Country State City API it can retrieve the standardized city and state list for a country and hand those names to a geocoding service, reducing mismatches from free-text location strings.
Fetch the cities of a state, match a free-text city name against that list, and pass the canonical name to a geocoder
7 endpoints — jentic publishes the only available openapi specification for country state city api, keeping it validated and agent-ready.
METHOD
PATH
DESCRIPTION
/countries
List all countries
/countries/{iso2}
Get a country by its ISO2 code
/countries/{iso2}/states
Get the states within a country
/countries/{iso2}/cities
Get the cities within a country
/countries/{iso2}/states/{stateIso2}/cities
Get the cities within a specific state
/countries
List all countries
/countries/{iso2}
Get a country by its ISO2 code
/countries/{iso2}/states
Get the states within a country
/countries/{iso2}/cities
Get the cities within a country
/countries/{iso2}/states/{stateIso2}/cities
Get the cities within a specific state
What agents get from Jentic-routed access to this vendor.
Setup
Wiring Country State City by hand means registering for an API key, setting the X-CSCAPI-KEY header, and chaining the country, state, and city lookups yourself. Through Jentic you install once, import the API from the API Directory, store the key once, and your agent calls the lookups directly.
Permission scoping
Every operation is read-only and countries and states are addressed by ISO code in the URL path, so a rule can bound your agent to the specific lookups it needs, such as listing countries and states only. It can never write or delete data.
Credential isolation
Your X-CSCAPI-KEY value is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'get the cities in a country', and Jentic returns the matching operation with its input schema so the agent calls it with the right ISO code.
Alternatives and complements available in the Jentic catalogue.
Specific to using Country State City API through Jentic.
Why is there no official OpenAPI spec for Country State City API?
Country State City publishes documentation but not a machine-readable OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call the API via structured tooling. It is validated against the live API and kept up to date. To run it on your own infrastructure, install Jentic One from its GitHub repo.
What authentication does the Country State City API use?
The Country State City API authenticates with an API key sent in the X-CSCAPI-KEY request header, per its OpenAPI spec. Through Jentic the key is stored once by your own self-hosted instance and injected when the agent calls, so it never appears in the agent's prompt or logs.
Is there a Country State City MCP server?
You don't need an MCP server to give your agent the Country State City API. Jentic connects it directly from the API Directory: import it, store your API key once, and your agent calls the country, state, and city lookups. Operations are discovered on demand, so nothing extra loads into the agent's context.
Can I limit what my agent is allowed to do with the Country State City API?
Yes. Every operation is a read, and countries and states are addressed by ISO code in the URL path, so a rule can bound the agent to the specific lookups it needs and it can never modify data. You might allow country and state listing but nothing else, with every call logged.
How much geographic data does the Country State City API cover?
According to its specification the API covers 247+ countries, 5000+ states or provinces, and 151,000+ cities, each carrying ISO codes and related metadata. You can list them globally or narrow to a single country or state.
What are the rate limits for the Country State City API?
The OpenAPI spec does not specify rate limits. Check the Country State City documentation at https://countrystatecity.in for current limits before running large batch lookups.
How do I look up cities by country through Jentic?
Search Jentic by intent, for example 'get the cities in a country', and Jentic returns the matching operation with its input schema. Your agent supplies the country ISO2 code and reads back the city list. To run it on your own infrastructure, install Jentic One from its GitHub repo.
Know of an official OpenAPI document? Contribute it →
For Agents
Look up reference data for countries, states or provinces, and cities by ISO code across 7 read-only endpoints. Authenticates with an API key in the X-CSCAPI-KEY header.
Use for: List every country to populate a signup form's country dropdown, Get the states in a country from its ISO2 code, Find all cities in a given state, Look up a country's details from its ISO2 code
Not supported: Does not geocode, route, or render maps, and provides no city demographics beyond names and ISO codes. Use for country, state, and city reference lookups only.
Jentic publishes the only available OpenAPI specification for Country State City API, keeping it validated and agent-ready. The Country State City API provides reference data for the world's countries, states or provinces, and cities, addressing each by its ISO code. It exposes 7 read-only endpoints covering 247+ countries, 5000+ states, and 151,000+ cities.