<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
API operational JSON · Plans from €5/month </> REST API

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
api.countrydataapi.com
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
}

Start now with a 30-day free trial

Get Started

CountryDataAPI is perfect for...

Developers

Deploy projects that leverage reliable data and advanced algorithms.

User GroupStartups

Power your startup project with our simple yet effective REST APIs.

14Companies

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

200+ Countries
Complete data for every nation
5,000+ States
Provinces and administrative regions
150,000+ Cities
Urban centers worldwide
500,000+ Zip Codes
Postal codes for accurate delivery

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.

200+
Countries covered
150K+
Cities in database
500K+
Postal codes
6
Supported languages

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.