Skip to main content

Overview

The Country State City API provides developers with comprehensive access to geographical data covering 250 countries, 5,299+ states/provinces, and over 153,000 cities worldwide. Our RESTful API is designed for high performance, reliability, and ease of integration.

Get your API key

Register and start accessing geographical data immediately.

Key Features

Comprehensive Coverage

Access complete geographical hierarchies from countries down to individual cities with detailed metadata.

High Performance

Optimized endpoints with efficient data structures and caching for fast response times.

Developer Friendly

RESTful design with consistent responses, comprehensive error handling, and extensive documentation.

Always Current

Regular updates ensure data accuracy with automated validation and quality checks.

Quick Start

1

Get Your API Key

Register at our portal to obtain your free API key.
2

Make Your First Request

Use your API key to fetch all countries:
3

Explore the Endpoints

Browse our comprehensive endpoint documentation to integrate geographical data into your application.
All endpoints return consistent JSON responses with proper HTTP status codes.

Base URL

Authentication

All API requests require authentication using an API key sent in the request header:
Never expose your API key in client-side code or public repositories. Use environment variables or server-side configurations to keep your key secure.

Available Endpoints

Countries

Get all countries or specific country details with ISO codes, currencies, and regional information.

States

Access states, provinces, and regions with filtering by country and detailed geographical data.

Cities

Retrieve cities with coordinates, timezone data, and hierarchical filtering by country and state.

Countries Endpoints

States Endpoints

Cities Endpoints

Response Format

All API endpoints return JSON responses with consistent structure:

Success Response

Error Response

HTTP Status Codes

For 5xx errors, implement exponential backoff in your retry logic. Most issues are temporary and resolve quickly.

Need Help?

Sample Code

Complete integration examples in multiple programming languages.

Support

Common questions, troubleshooting, and community support.