administrative-divisons-db API

⭐ Beginner's Pick Geocoding / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

The Administrative Divisions DB API provides a structured list of all administrative divisions (states, provinces, regions, cities) for countries around the world. It requires no API key and returns simple JSON, making it easy to populate dropdown menus or validate location data in forms. This is ideal for any app that needs consistent, structured geographic data by country.

💡

Beginner Tip

Use ISO 3166-1 alpha-2 country codes (e.g., US, GB, JP) as your query parameter. The response data is cached so responses are nearly instant.

Available Data

country name and code
population
capital city
region and subregion
flag image URL

Example Response

JSON Response
{
  "name": "Japan",
  "capital": "Tokyo",
  "population": 125800000,
  "region": "Asia",
  "languages": [
    "Japanese"
  ],
  "flag": "https://flagcdn.com/jp.svg",
  "currencies": [
    {
      "code": "JPY",
      "name": "Japanese yen"
    }
  ]
}

Field Reference

name Name of the administrative division (e.g., state or province name).
iso ISO code for the division, if available.
level The administrative level of the division (e.g., state, province, region).

Implementation Example

const url = "https://github.com/kamikazechaser/administrative-divisions-db";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 Not Found The country code provided does not match any available dataset file.
Verify you are using the correct ISO 3166-1 alpha-2 code (2 uppercase letters). Check the repository README for supported countries.
Unexpected data structure The response schema may vary slightly between countries based on available division levels.
Always check for the existence of nested fields before accessing them, as not all countries have the same administrative hierarchy.
Stale or outdated data The dataset is a static file in a GitHub repository and may not reflect very recent geopolitical changes.
Check the repository's last commit date to assess data freshness. For critical applications, verify key entries against an official source.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 40ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Geocoding
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →