Overview

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

Get your API key

Register for free and start accessing geographical data immediately with 3,000 requests/month.

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.
Free tier includes 3,000 requests per month (100/day) - perfect for development and small applications.
2

Make Your First Request

Use your API key to fetch all countries:
curl -X GET 'https://api.countrystatecity.in/v1/countries' \
  -H 'X-CSCAPI-KEY: YOUR_API_KEY'
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

https://api.countrystatecity.in/v1

Authentication

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

Rate Limits

PlanMonthly RequestsDaily RequestsRate Limit
Community (Free)3,0001002 req/second
Supporter30,0001,00010 req/second
Professional150,0005,00025 req/second

View Full Rate Limit Details

Learn about monitoring, best practices, and handling rate limits

Available Endpoints

Countries Endpoints

States Endpoints

Cities Endpoints

Response Format

All API endpoints return JSON responses with consistent structure:

Success Response

{
  "data": [...], // Array of results or single object
  "total": 247,  // Total count (for list endpoints)
  "page": 1      // Current page (for paginated endpoints)
}

Error Response

{
  "error": "Unauthorized. You shouldn't be here.",
  "code": 401,
  "message": "Invalid or missing API key"
}

HTTP Status Codes

CodeDescription
200Success - Request completed successfully
401Unauthorized - Invalid or missing API key
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end
For 5xx errors, implement exponential backoff in your retry logic. Most issues are temporary and resolve quickly.

Need Help?