This repo contains a collection of JSON files with ISO-3166-2 country and subdivision codes sourced from Wikipedia.
The index.json file contains the ISO-3166-2 codes for each country.
An country entry in the index.json
is a json object with the following structure:
{
"code": "country code:string",
"name": "country name:string"
}
For each of those countries, there is a file in the countries
directory with the name {country-code}.json
that contains the collection of subdivisions within that country and their ISO-3166-2 codes.
For example: the file for Mexico is named mx.json.
A subdivision entry in the country specific file is a json object with the following structure:
{
"code": "subdivision code:string",
"name": "subdivision name:string",
"category": "an optional category that subdivision belongs to:string"
}