Everything the API does,
one feature at a time
CountryDataAPI covers countries, states, cities and postal codes: lookups, address-form autocomplete, validation and downloadable datasets. There is no street-level or point-of-interest data.
Address forms
Fill and check the country, state, city and postcode fields of a form.
City Autocomplete API
Suggest cities, states and countries as the user types, with the full hierarchy in every suggestion and one token per address field.
See the autocomplete API →Zip Code API
List postal codes by country or state, find the state for a zip code and validate the postcode of an address.
See the zip code API →Postal Code Validator
Check a postal code against the format of its country, right in the browser.
Open the validator →
Geographic data
Look up the world hierarchy or download it.
Countries API
How a countries API compares with RestCountries and GeoNames, and where CountryDataAPI fits.
Compare countries APIs →Datasets (JSON & CSV)
Downloadable lists of countries with ISO codes, capitals and regions.
Browse the datasets →World directories
Browse every country and its cities, with the data the API returns.
Browse countries →
Choosing an API
Compare options before you integrate.
Use it from AI assistants (MCP)
Connect Claude, ChatGPT or Cursor to the public MCP server and ask geographic questions in plain language.
See how to connect →Alternatives
How CountryDataAPI compares with other geographic data APIs.
See the comparison →Documentation
Every endpoint with parameters, responses and code examples.
Read the documentation →
Pick a feature and try it
Create an account, grab your key and call any endpoint from the docs.