administrative-divisons-db API

Beginner's Pick Geocoding / No Auth Required Beginner HTTPS CORS
Free to Use

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

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

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

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "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

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://raw.githubusercontent.com/kamikazechaser/administrative-divisions-db/master/api/US.json";
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

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Geocoding
Difficulty Beginner
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →