Country Data API for Countries, States, Cities & Zip Codes
One REST API with 200+ countries, 5,000+ states, 150,000+ cities and 500,000+ zip codes in JSON. Try it free for 30 days, and connect AI assistants to our free MCP server with no API key.
- Countries
- 200+ Countries
- States & provinces
- 5.000+ States & provinces
- Cities
- 150.000+ Cities
- Zip codes
- 500.000+ Zip codes
curl -s "https://api.countrydataapi.com/v1/countries/all?apikey=TU_API_KEY&limit=2"
{
"success": true,
"data": [
{ "id": 1, "lang": "en", "country_name": "Spain" },
{ "id": 2, "lang": "en", "country_name": "France" }
],
"count": 2,
"tokens_used": 2,
"remaining_tokens": 199998,
"cost_per_item": 1
}Power your app with our API
What you get, in concrete terms.
Countries, states, cities and postal codes in one API
One REST API with JSON responses and 200+ countries, from €5/month.
Free datasets
Download open datasets in JSON or CSV, no account needed.
MCP server and SDKs in every plan
Connect Claude, ChatGPT or Cursor to the MCP server and use the SDKs at no extra cost. The MCP server also has a free tier with no API key.
Address forms built in
Autocomplete and validation of country, state, city and postal code with /v1/places. No street-level data.
EU billing, VAT included
Prices in euros with VAT included, monthly billing, invoices in your account, cancel any time.
A token is our unit of usage: each item a request returns costs 1 to 4 tokens (a full country costs 4), a dropdown call costs 1 and address autocomplete costs 1 per search session. Plans are measured in tokens per month.
Start now with a 30-day free trial
Get StartedCountryDataAPI is perfect for...
Deploy projects that leverage reliable data and advanced algorithms.
Power your startup project with our simple yet effective REST APIs.
Deliver first-class information consistently and scalably to your end users.
Geographical Data API - Countries, States, Cities and Zip Codes
CountryDataAPI is the ultimate countries API platform that provides access to detailed information from all countries worldwide. Our zip codes API allows you to validate and obtain accurate geographical information of zip codes by country, state and region. Additionally, we offer complete data on cities and states to create localized experiences in your applications.
Comprehensive Global Coverage
Common Use Cases
- E-commerce shipping calculators and address validation
- Location-based user registration and forms
- International market analysis and research
- Travel and tourism applications
- CRM and customer data enrichment
- Logistics and delivery route optimization
Everything in one API
Country, state, city and postal-code data for 200+ countries, ready to drop into your application.
Popular API Endpoints
Popular Countries
Frequently Asked Questions
What data formats does the API support? ▼
CountryDataAPI returns data in JSON format, making it easy to integrate with any programming language or framework.
What plans are available? ▼
We offer flexible paid plans starting at €5/month with 200,000 monthly tokens, scaling up to enterprise-level volumes. All plans include full access to every endpoint.
How often is the data updated? ▼
Our geographical database is updated regularly to ensure accuracy. Country borders, city names, and zip codes are verified against official sources.
What programming languages work with CountryDataAPI? ▼
CountryDataAPI works with any language that can make HTTP requests — JavaScript, TypeScript, Python, PHP, Java, Ruby, Go, and more. We also offer a TypeScript SDK and MCP Server for AI tools.
How do I get started? ▼
Create your account, copy your API key from the dashboard, and make your first request in minutes. Full documentation with code examples is available in the Docs section.
Is there a rate limit? ▼
Usage is measured in tokens, not requests. Each plan includes a monthly token allowance, from 200,000 on Learner up to 250 million on Business, and each item returned costs 1 to 4 tokens. Tokens are replenished at every monthly renewal. See the pricing page for details.
Can I use the API for commercial projects? ▼
Yes, from the Developer plan (€7.50/month) upwards: every plan except Learner includes commercial use. Learner is for personal and learning projects. Check the pricing page for the details of each plan.
Does the API support IP-based geolocation? ▼
CountryDataAPI focuses on structured geographic data — countries, states, cities, and zip codes. For IP geolocation, you would use our country code or timezone endpoints in combination with a separate IP lookup service.