Skip to content

Instantly share code, notes, and snippets.

@ienugr
Last active July 11, 2019 11:36
Show Gist options
  • Save ienugr/c4e33c4bd6d3139f231102b33c7ed117 to your computer and use it in GitHub Desktop.
Save ienugr/c4e33c4bd6d3139f231102b33c7ed117 to your computer and use it in GitHub Desktop.
Script to get JSON data from local file and show country regions by specifying the country id

Country Info

Prerequisites

  • Node JS

How to run

node index.js

Feature

  • Get JSON data from local file
  • Get regions by country id

Preview

preview

'use strict';
const fs = require('fs');
const standard_input = process.stdin;
var fileName = "./example.json"
var raw = JSON.parse(fs.readFileSync(fileName));
var data = raw.data;
var countriesInfo = data.countries_info;
console.log("Choose country: ");
standard_input.setEncoding('utf-8');
standard_input.on('data', (data) => {
if (data === 'exit\n') {
process.exit();
} else {
data = data.slice(0, data.length - 1).toUpperCase();
var country = countriesInfo[data];
console.log("You selected " + data + " with country name " + country.name);
if (country.regions != null) {
console.log(country.name + " has these following regions:");
country.regions.forEach(region => {
console.log(" - " + region.name);
});
} else {
console.log(country.name + " does not have any regions.");
}
}
})
{
"status": true,
"message": "OK",
"data": {
"countries_info": {
"AD": {
"id": "AD",
"name": "Andorra",
"regions": null
},
"AE": {
"id": "AE",
"name": "United Arab Emirates",
"regions": null
},
"AF": {
"id": "AF",
"name": "Afghanistan",
"regions": null
},
"AG": {
"id": "AG",
"name": "Antigua & Barbuda",
"regions": null
},
"AI": {
"id": "AI",
"name": "Anguilla",
"regions": null
},
"AL": {
"id": "AL",
"name": "Albania",
"regions": null
},
"AM": {
"id": "AM",
"name": "Armenia",
"regions": null
},
"AO": {
"id": "AO",
"name": "Angola",
"regions": null
},
"AQ": {
"id": "AQ",
"name": "Antarctica",
"regions": null
},
"AR": {
"id": "AR",
"name": "Argentina",
"regions": null
},
"AS": {
"id": "AS",
"name": "American Samoa",
"regions": null
},
"AT": {
"id": "AT",
"name": "Austria",
"regions": [
{
"id": "102",
"name": "Burgenland"
},
{
"id": "99",
"name": "Kärnten"
},
{
"id": "96",
"name": "Niederösterreich"
},
{
"id": "97",
"name": "Oberösterreich"
},
{
"id": "98",
"name": "Salzburg"
},
{
"id": "100",
"name": "Steiermark"
},
{
"id": "101",
"name": "Tirol"
},
{
"id": "103",
"name": "Vorarlberg"
},
{
"id": "95",
"name": "Wien"
}
]
},
"AU": {
"id": "AU",
"name": "Australia",
"regions": null
},
"AW": {
"id": "AW",
"name": "Aruba",
"regions": null
},
"AX": {
"id": "AX",
"name": "Åland Islands",
"regions": null
},
"AZ": {
"id": "AZ",
"name": "Azerbaijan",
"regions": null
},
"BA": {
"id": "BA",
"name": "Bosnia & Herzegovina",
"regions": null
},
"BB": {
"id": "BB",
"name": "Barbados",
"regions": null
},
"BD": {
"id": "BD",
"name": "Bangladesh",
"regions": null
},
"BE": {
"id": "BE",
"name": "Belgium",
"regions": null
},
"BF": {
"id": "BF",
"name": "Burkina Faso",
"regions": null
},
"BG": {
"id": "BG",
"name": "Bulgaria",
"regions": null
},
"BH": {
"id": "BH",
"name": "Bahrain",
"regions": null
},
"BI": {
"id": "BI",
"name": "Burundi",
"regions": null
},
"BJ": {
"id": "BJ",
"name": "Benin",
"regions": null
},
"BL": {
"id": "BL",
"name": "St. Barthélemy",
"regions": null
},
"BM": {
"id": "BM",
"name": "Bermuda",
"regions": null
},
"BN": {
"id": "BN",
"name": "Brunei",
"regions": null
},
"BO": {
"id": "BO",
"name": "Bolivia",
"regions": null
},
"BR": {
"id": "BR",
"name": "Brazil",
"regions": null
},
"BS": {
"id": "BS",
"name": "Bahamas",
"regions": null
},
"BT": {
"id": "BT",
"name": "Bhutan",
"regions": null
},
"BV": {
"id": "BV",
"name": "Bouvet Island",
"regions": null
},
"BW": {
"id": "BW",
"name": "Botswana",
"regions": null
},
"BY": {
"id": "BY",
"name": "Belarus",
"regions": null
},
"BZ": {
"id": "BZ",
"name": "Belize",
"regions": null
},
"CA": {
"id": "CA",
"name": "Canada",
"regions": [
{
"id": "66",
"name": "Alberta"
},
{
"id": "67",
"name": "British Columbia"
},
{
"id": "68",
"name": "Manitoba"
},
{
"id": "70",
"name": "New Brunswick"
},
{
"id": "69",
"name": "Newfoundland and Labrador"
},
{
"id": "72",
"name": "Northwest Territories"
},
{
"id": "71",
"name": "Nova Scotia"
},
{
"id": "73",
"name": "Nunavut"
},
{
"id": "74",
"name": "Ontario"
},
{
"id": "75",
"name": "Prince Edward Island"
},
{
"id": "76",
"name": "Quebec"
},
{
"id": "77",
"name": "Saskatchewan"
},
{
"id": "78",
"name": "Yukon Territory"
}
]
},
"CC": {
"id": "CC",
"name": "Cocos (Keeling) Islands",
"regions": null
},
"CD": {
"id": "CD",
"name": "Congo - Kinshasa",
"regions": null
},
"CF": {
"id": "CF",
"name": "Central African Republic",
"regions": null
},
"CG": {
"id": "CG",
"name": "Congo - Brazzaville",
"regions": null
},
"CH": {
"id": "CH",
"name": "Switzerland",
"regions": [
{
"id": "104",
"name": "Aargau"
},
{
"id": "106",
"name": "Appenzell Ausserrhoden"
},
{
"id": "105",
"name": "Appenzell Innerrhoden"
},
{
"id": "108",
"name": "Basel-Landschaft"
},
{
"id": "109",
"name": "Basel-Stadt"
},
{
"id": "107",
"name": "Bern"
},
{
"id": "110",
"name": "Freiburg"
},
{
"id": "111",
"name": "Genf"
},
{
"id": "112",
"name": "Glarus"
},
{
"id": "113",
"name": "Graubünden"
},
{
"id": "114",
"name": "Jura"
},
{
"id": "115",
"name": "Luzern"
},
{
"id": "116",
"name": "Neuenburg"
},
{
"id": "117",
"name": "Nidwalden"
},
{
"id": "118",
"name": "Obwalden"
},
{
"id": "120",
"name": "Schaffhausen"
},
{
"id": "122",
"name": "Schwyz"
},
{
"id": "121",
"name": "Solothurn"
},
{
"id": "119",
"name": "St. Gallen"
},
{
"id": "124",
"name": "Tessin"
},
{
"id": "123",
"name": "Thurgau"
},
{
"id": "125",
"name": "Uri"
},
{
"id": "126",
"name": "Waadt"
},
{
"id": "127",
"name": "Wallis"
},
{
"id": "128",
"name": "Zug"
},
{
"id": "129",
"name": "Zürich"
}
]
},
"CI": {
"id": "CI",
"name": "Côte d’Ivoire",
"regions": null
},
"CK": {
"id": "CK",
"name": "Cook Islands",
"regions": null
},
"CL": {
"id": "CL",
"name": "Chile",
"regions": null
},
"CM": {
"id": "CM",
"name": "Cameroon",
"regions": null
},
"CN": {
"id": "CN",
"name": "China",
"regions": null
},
"CO": {
"id": "CO",
"name": "Colombia",
"regions": null
},
"CR": {
"id": "CR",
"name": "Costa Rica",
"regions": null
},
"CU": {
"id": "CU",
"name": "Cuba",
"regions": null
},
"CV": {
"id": "CV",
"name": "Cape Verde",
"regions": null
},
"CX": {
"id": "CX",
"name": "Christmas Island",
"regions": null
},
"CY": {
"id": "CY",
"name": "Cyprus",
"regions": null
},
"CZ": {
"id": "CZ",
"name": "Czechia",
"regions": null
},
"DE": {
"id": "DE",
"name": "Germany",
"regions": [
{
"id": "80",
"name": "Baden-Württemberg"
},
{
"id": "81",
"name": "Bayern"
},
{
"id": "82",
"name": "Berlin"
},
{
"id": "83",
"name": "Brandenburg"
},
{
"id": "84",
"name": "Bremen"
},
{
"id": "85",
"name": "Hamburg"
},
{
"id": "86",
"name": "Hessen"
},
{
"id": "87",
"name": "Mecklenburg-Vorpommern"
},
{
"id": "79",
"name": "Niedersachsen"
},
{
"id": "88",
"name": "Nordrhein-Westfalen"
},
{
"id": "89",
"name": "Rheinland-Pfalz"
},
{
"id": "90",
"name": "Saarland"
},
{
"id": "91",
"name": "Sachsen"
},
{
"id": "92",
"name": "Sachsen-Anhalt"
},
{
"id": "93",
"name": "Schleswig-Holstein"
},
{
"id": "94",
"name": "Thüringen"
}
]
},
"DJ": {
"id": "DJ",
"name": "Djibouti",
"regions": null
},
"DK": {
"id": "DK",
"name": "Denmark",
"regions": null
},
"DM": {
"id": "DM",
"name": "Dominica",
"regions": null
},
"DO": {
"id": "DO",
"name": "Dominican Republic",
"regions": null
},
"DZ": {
"id": "DZ",
"name": "Algeria",
"regions": null
},
"EC": {
"id": "EC",
"name": "Ecuador",
"regions": null
},
"EE": {
"id": "EE",
"name": "Estonia",
"regions": [
{
"id": "340",
"name": "Harjumaa"
},
{
"id": "341",
"name": "Hiiumaa"
},
{
"id": "342",
"name": "Ida-Virumaa"
},
{
"id": "344",
"name": "Järvamaa"
},
{
"id": "343",
"name": "Jõgevamaa"
},
{
"id": "346",
"name": "Lääne-Virumaa"
},
{
"id": "345",
"name": "Läänemaa"
},
{
"id": "348",
"name": "Pärnumaa"
},
{
"id": "347",
"name": "Põlvamaa"
},
{
"id": "349",
"name": "Raplamaa"
},
{
"id": "350",
"name": "Saaremaa"
},
{
"id": "351",
"name": "Tartumaa"
},
{
"id": "352",
"name": "Valgamaa"
},
{
"id": "353",
"name": "Viljandimaa"
},
{
"id": "354",
"name": "Võrumaa"
}
]
},
"EG": {
"id": "EG",
"name": "Egypt",
"regions": null
},
"EH": {
"id": "EH",
"name": "Western Sahara",
"regions": null
},
"ER": {
"id": "ER",
"name": "Eritrea",
"regions": null
},
"ES": {
"id": "ES",
"name": "Spain",
"regions": [
{
"id": "130",
"name": "A Coruña"
},
{
"id": "131",
"name": "Alava"
},
{
"id": "132",
"name": "Albacete"
},
{
"id": "133",
"name": "Alicante"
},
{
"id": "134",
"name": "Almeria"
},
{
"id": "135",
"name": "Asturias"
},
{
"id": "136",
"name": "Avila"
},
{
"id": "137",
"name": "Badajoz"
},
{
"id": "138",
"name": "Baleares"
},
{
"id": "139",
"name": "Barcelona"
},
{
"id": "140",
"name": "Burgos"
},
{
"id": "141",
"name": "Caceres"
},
{
"id": "142",
"name": "Cadiz"
},
{
"id": "143",
"name": "Cantabria"
},
{
"id": "144",
"name": "Castellon"
},
{
"id": "145",
"name": "Ceuta"
},
{
"id": "146",
"name": "Ciudad Real"
},
{
"id": "147",
"name": "Cordoba"
},
{
"id": "148",
"name": "Cuenca"
},
{
"id": "149",
"name": "Girona"
},
{
"id": "150",
"name": "Granada"
},
{
"id": "151",
"name": "Guadalajara"
},
{
"id": "152",
"name": "Guipuzcoa"
},
{
"id": "153",
"name": "Huelva"
},
{
"id": "154",
"name": "Huesca"
},
{
"id": "155",
"name": "Jaen"
},
{
"id": "156",
"name": "La Rioja"
},
{
"id": "157",
"name": "Las Palmas"
},
{
"id": "158",
"name": "Leon"
},
{
"id": "159",
"name": "Lleida"
},
{
"id": "160",
"name": "Lugo"
},
{
"id": "161",
"name": "Madrid"
},
{
"id": "162",
"name": "Malaga"
},
{
"id": "163",
"name": "Melilla"
},
{
"id": "164",
"name": "Murcia"
},
{
"id": "165",
"name": "Navarra"
},
{
"id": "166",
"name": "Ourense"
},
{
"id": "167",
"name": "Palencia"
},
{
"id": "168",
"name": "Pontevedra"
},
{
"id": "169",
"name": "Salamanca"
},
{
"id": "170",
"name": "Santa Cruz de Tenerife"
},
{
"id": "171",
"name": "Segovia"
},
{
"id": "172",
"name": "Sevilla"
},
{
"id": "173",
"name": "Soria"
},
{
"id": "174",
"name": "Tarragona"
},
{
"id": "175",
"name": "Teruel"
},
{
"id": "176",
"name": "Toledo"
},
{
"id": "177",
"name": "Valencia"
},
{
"id": "178",
"name": "Valladolid"
},
{
"id": "179",
"name": "Vizcaya"
},
{
"id": "180",
"name": "Zamora"
},
{
"id": "181",
"name": "Zaragoza"
}
]
},
"ET": {
"id": "ET",
"name": "Ethiopia",
"regions": null
},
"FI": {
"id": "FI",
"name": "Finland",
"regions": [
{
"id": "339",
"name": "Ahvenanmaa"
},
{
"id": "333",
"name": "Etelä-Karjala"
},
{
"id": "326",
"name": "Etelä-Pohjanmaa"
},
{
"id": "325",
"name": "Etelä-Savo"
},
{
"id": "337",
"name": "Itä-Uusimaa"
},
{
"id": "322",
"name": "Kainuu"
},
{
"id": "335",
"name": "Kanta-Häme"
},
{
"id": "330",
"name": "Keski-Pohjanmaa"
},
{
"id": "331",
"name": "Keski-Suomi"
},
{
"id": "338",
"name": "Kymenlaakso"
},
{
"id": "320",
"name": "Lappi"
},
{
"id": "334",
"name": "Päijät-Häme"
},
{
"id": "328",
"name": "Pirkanmaa"
},
{
"id": "327",
"name": "Pohjanmaa"
},
{
"id": "323",
"name": "Pohjois-Karjala"
},
{
"id": "321",
"name": "Pohjois-Pohjanmaa"
},
{
"id": "324",
"name": "Pohjois-Savo"
},
{
"id": "329",
"name": "Satakunta"
},
{
"id": "336",
"name": "Uusimaa"
},
{
"id": "332",
"name": "Varsinais-Suomi"
}
]
},
"FJ": {
"id": "FJ",
"name": "Fiji",
"regions": null
},
"FK": {
"id": "FK",
"name": "Falkland Islands",
"regions": null
},
"FM": {
"id": "FM",
"name": "Micronesia",
"regions": null
},
"FO": {
"id": "FO",
"name": "Faroe Islands",
"regions": null
},
"FR": {
"id": "FR",
"name": "France",
"regions": [
{
"id": "182",
"name": "Ain"
},
{
"id": "183",
"name": "Aisne"
},
{
"id": "184",
"name": "Allier"
},
{
"id": "185",
"name": "Alpes-de-Haute-Provence"
},
{
"id": "187",
"name": "Alpes-Maritimes"
},
{
"id": "188",
"name": "Ardèche"
},
{
"id": "189",
"name": "Ardennes"
},
{
"id": "190",
"name": "Ariège"
},
{
"id": "191",
"name": "Aube"
},
{
"id": "192",
"name": "Aude"
},
{
"id": "193",
"name": "Aveyron"
},
{
"id": "249",
"name": "Bas-Rhin"
},
{
"id": "194",
"name": "Bouches-du-Rhône"
},
{
"id": "195",
"name": "Calvados"
},
{
"id": "196",
"name": "Cantal"
},
{
"id": "197",
"name": "Charente"
},
{
"id": "198",
"name": "Charente-Maritime"
},
{
"id": "199",
"name": "Cher"
},
{
"id": "200",
"name": "Corrèze"
},
{
"id": "201",
"name": "Corse-du-Sud"
},
{
"id": "203",
"name": "Côte-d'Or"
},
{
"id": "204",
"name": "Côtes-d'Armor"
},
{
"id": "205",
"name": "Creuse"
},
{
"id": "261",
"name": "Deux-Sèvres"
},
{
"id": "206",
"name": "Dordogne"
},
{
"id": "207",
"name": "Doubs"
},
{
"id": "208",
"name": "Drôme"
},
{
"id": "273",
"name": "Essonne"
},
{
"id": "209",
"name": "Eure"
},
{
"id": "210",
"name": "Eure-et-Loir"
},
{
"id": "211",
"name": "Finistère"
},
{
"id": "212",
"name": "Gard"
},
{
"id": "214",
"name": "Gers"
},
{
"id": "215",
"name": "Gironde"
},
{
"id": "250",
"name": "Haut-Rhin"
},
{
"id": "202",
"name": "Haute-Corse"
},
{
"id": "213",
"name": "Haute-Garonne"
},
{
"id": "225",
"name": "Haute-Loire"
},
{
"id": "234",
"name": "Haute-Marne"
},
{
"id": "252",
"name": "Haute-Saône"
},
{
"id": "256",
"name": "Haute-Savoie"
},
{
"id": "269",
"name": "Haute-Vienne"
},
{
"id": "186",
"name": "Hautes-Alpes"
},
{
"id": "247",
"name": "Hautes-Pyrénées"
},
{
"id": "274",
"name": "Hauts-de-Seine"
},
{
"id": "216",
"name": "Hérault"
},
{
"id": "217",
"name": "Ille-et-Vilaine"
},
{
"id": "218",
"name": "Indre"
},
{
"id": "219",
"name": "Indre-et-Loire"
},
{
"id": "220",
"name": "Isère"
},
{
"id": "221",
"name": "Jura"
},
{
"id": "222",
"name": "Landes"
},
{
"id": "223",
"name": "Loir-et-Cher"
},
{
"id": "224",
"name": "Loire"
},
{
"id": "226",
"name": "Loire-Atlantique"
},
{
"id": "227",
"name": "Loiret"
},
{
"id": "228",
"name": "Lot"
},
{
"id": "229",
"name": "Lot-et-Garonne"
},
{
"id": "230",
"name": "Lozère"
},
{
"id": "231",
"name": "Maine-et-Loire"
},
{
"id": "232",
"name": "Manche"
},
{
"id": "233",
"name": "Marne"
},
{
"id": "235",
"name": "Mayenne"
},
{
"id": "236",
"name": "Meurthe-et-Moselle"
},
{
"id": "237",
"name": "Meuse"
},
{
"id": "238",
"name": "Morbihan"
},
{
"id": "239",
"name": "Moselle"
},
{
"id": "240",
"name": "Nièvre"
},
{
"id": "241",
"name": "Nord"
},
{
"id": "242",
"name": "Oise"
},
{
"id": "243",
"name": "Orne"
},
{
"id": "257",
"name": "Paris"
},
{
"id": "244",
"name": "Pas-de-Calais"
},
{
"id": "245",
"name": "Puy-de-Dôme"
},
{
"id": "246",
"name": "Pyrénées-Atlantiques"
},
{
"id": "248",
"name": "Pyrénées-Orientales"
},
{
"id": "251",
"name": "Rhône"
},
{
"id": "253",
"name": "Saône-et-Loire"
},
{
"id": "254",
"name": "Sarthe"
},
{
"id": "255",
"name": "Savoie"
},
{
"id": "259",
"name": "Seine-et-Marne"
},
{
"id": "258",
"name": "Seine-Maritime"
},
{
"id": "275",
"name": "Seine-Saint-Denis"
},
{
"id": "262",
"name": "Somme"
},
{
"id": "263",
"name": "Tarn"
},
{
"id": "264",
"name": "Tarn-et-Garonne"
},
{
"id": "272",
"name": "Territoire-de-Belfort"
},
{
"id": "277",
"name": "Val-d'Oise"
},
{
"id": "276",
"name": "Val-de-Marne"
},
{
"id": "265",
"name": "Var"
},
{
"id": "266",
"name": "Vaucluse"
},
{
"id": "267",
"name": "Vendée"
},
{
"id": "268",
"name": "Vienne"
},
{
"id": "270",
"name": "Vosges"
},
{
"id": "271",
"name": "Yonne"
},
{
"id": "260",
"name": "Yvelines"
}
]
},
"GA": {
"id": "GA",
"name": "Gabon",
"regions": null
},
"GB": {
"id": "GB",
"name": "United Kingdom",
"regions": null
},
"GD": {
"id": "GD",
"name": "Grenada",
"regions": null
},
"GE": {
"id": "GE",
"name": "Georgia",
"regions": null
},
"GF": {
"id": "GF",
"name": "French Guiana",
"regions": null
},
"GG": {
"id": "GG",
"name": "Guernsey",
"regions": null
},
"GH": {
"id": "GH",
"name": "Ghana",
"regions": null
},
"GI": {
"id": "GI",
"name": "Gibraltar",
"regions": null
},
"GL": {
"id": "GL",
"name": "Greenland",
"regions": null
},
"GM": {
"id": "GM",
"name": "Gambia",
"regions": null
},
"GN": {
"id": "GN",
"name": "Guinea",
"regions": null
},
"GP": {
"id": "GP",
"name": "Guadeloupe",
"regions": null
},
"GQ": {
"id": "GQ",
"name": "Equatorial Guinea",
"regions": null
},
"GR": {
"id": "GR",
"name": "Greece",
"regions": null
},
"GS": {
"id": "GS",
"name": "South Georgia & South Sandwich Islands",
"regions": null
},
"GT": {
"id": "GT",
"name": "Guatemala",
"regions": null
},
"GU": {
"id": "GU",
"name": "Guam",
"regions": null
},
"GW": {
"id": "GW",
"name": "Guinea-Bissau",
"regions": null
},
"GY": {
"id": "GY",
"name": "Guyana",
"regions": null
},
"HK": {
"id": "HK",
"name": "Hong Kong SAR China",
"regions": null
},
"HM": {
"id": "HM",
"name": "Heard & McDonald Islands",
"regions": null
},
"HN": {
"id": "HN",
"name": "Honduras",
"regions": null
},
"HR": {
"id": "HR",
"name": "Croatia",
"regions": null
},
"HT": {
"id": "HT",
"name": "Haiti",
"regions": null
},
"HU": {
"id": "HU",
"name": "Hungary",
"regions": null
},
"ID": {
"id": "ID",
"name": "Indonesia",
"regions": null
},
"IE": {
"id": "IE",
"name": "Ireland",
"regions": null
},
"IM": {
"id": "IM",
"name": "Isle of Man",
"regions": null
},
"IN": {
"id": "IN",
"name": "India",
"regions": null
},
"IO": {
"id": "IO",
"name": "British Indian Ocean Territory",
"regions": null
},
"IQ": {
"id": "IQ",
"name": "Iraq",
"regions": null
},
"IR": {
"id": "IR",
"name": "Iran",
"regions": null
},
"IS": {
"id": "IS",
"name": "Iceland",
"regions": null
},
"IT": {
"id": "IT",
"name": "Italy",
"regions": null
},
"JE": {
"id": "JE",
"name": "Jersey",
"regions": null
},
"JM": {
"id": "JM",
"name": "Jamaica",
"regions": null
},
"JO": {
"id": "JO",
"name": "Jordan",
"regions": null
},
"JP": {
"id": "JP",
"name": "Japan",
"regions": null
},
"KE": {
"id": "KE",
"name": "Kenya",
"regions": null
},
"KG": {
"id": "KG",
"name": "Kyrgyzstan",
"regions": null
},
"KH": {
"id": "KH",
"name": "Cambodia",
"regions": null
},
"KI": {
"id": "KI",
"name": "Kiribati",
"regions": null
},
"KM": {
"id": "KM",
"name": "Comoros",
"regions": null
},
"KN": {
"id": "KN",
"name": "St. Kitts & Nevis",
"regions": null
},
"KP": {
"id": "KP",
"name": "North Korea",
"regions": null
},
"KR": {
"id": "KR",
"name": "South Korea",
"regions": null
},
"KW": {
"id": "KW",
"name": "Kuwait",
"regions": null
},
"KY": {
"id": "KY",
"name": "Cayman Islands",
"regions": null
},
"KZ": {
"id": "KZ",
"name": "Kazakhstan",
"regions": null
},
"LA": {
"id": "LA",
"name": "Laos",
"regions": null
},
"LB": {
"id": "LB",
"name": "Lebanon",
"regions": null
},
"LC": {
"id": "LC",
"name": "St. Lucia",
"regions": null
},
"LI": {
"id": "LI",
"name": "Liechtenstein",
"regions": null
},
"LK": {
"id": "LK",
"name": "Sri Lanka",
"regions": null
},
"LR": {
"id": "LR",
"name": "Liberia",
"regions": null
},
"LS": {
"id": "LS",
"name": "Lesotho",
"regions": null
},
"LT": {
"id": "LT",
"name": "Lithuania",
"regions": [
{
"id": "475",
"name": "Alytaus Apskritis"
},
{
"id": "476",
"name": "Kauno Apskritis"
},
{
"id": "477",
"name": "Klaipėdos Apskritis"
},
{
"id": "478",
"name": "Marijampolės Apskritis"
},
{
"id": "479",
"name": "Panevėžio Apskritis"
},
{
"id": "480",
"name": "Šiaulių Apskritis"
},
{
"id": "481",
"name": "Tauragės Apskritis"
},
{
"id": "482",
"name": "Telšių Apskritis"
},
{
"id": "483",
"name": "Utenos Apskritis"
},
{
"id": "484",
"name": "Vilniaus Apskritis"
}
]
},
"LU": {
"id": "LU",
"name": "Luxembourg",
"regions": null
},
"LV": {
"id": "LV",
"name": "Latvia",
"regions": [
{
"id": "471",
"name": "Ādažu novads"
},
{
"id": "366",
"name": "Aglonas novads"
},
{
"id": "367",
"name": "Aizkraukles novads"
},
{
"id": "368",
"name": "Aizputes novads"
},
{
"id": "369",
"name": "Aknīstes novads"
},
{
"id": "370",
"name": "Alojas novads"
},
{
"id": "371",
"name": "Alsungas novads"
},
{
"id": "372",
"name": "Alūksnes novads"
},
{
"id": "373",
"name": "Amatas novads"
},
{
"id": "374",
"name": "Apes novads"
},
{
"id": "375",
"name": "Auces novads"
},
{
"id": "376",
"name": "Babītes novads"
},
{
"id": "377",
"name": "Baldones novads"
},
{
"id": "378",
"name": "Baltinavas novads"
},
{
"id": "379",
"name": "Balvu novads"
},
{
"id": "380",
"name": "Bauskas novads"
},
{
"id": "381",
"name": "Beverīnas novads"
},
{
"id": "382",
"name": "Brocēnu novads"
},
{
"id": "383",
"name": "Burtnieku novads"
},
{
"id": "384",
"name": "Carnikavas novads"
},
{
"id": "387",
"name": "Cēsu novads"
},
{
"id": "385",
"name": "Cesvaines novads"
},
{
"id": "386",
"name": "Ciblas novads"
},
{
"id": "388",
"name": "Dagdas novads"
},
{
"id": "355",
"name": "Daugavpils"
},
{
"id": "389",
"name": "Daugavpils novads"
},
{
"id": "390",
"name": "Dobeles novads"
},
{
"id": "391",
"name": "Dundagas novads"
},
{
"id": "392",
"name": "Durbes novads"
},
{
"id": "393",
"name": "Engures novads"
},
{
"id": "472",
"name": "Ērgļu novads"
},
{
"id": "394",
"name": "Garkalnes novads"
},
{
"id": "395",
"name": "Grobiņas novads"
},
{
"id": "396",
"name": "Gulbenes novads"
},
{
"id": "397",
"name": "Iecavas novads"
},
{
"id": "398",
"name": "Ikšķiles novads"
},
{
"id": "399",
"name": "Ilūkstes novads"
},
{
"id": "400",
"name": "Inčukalna novads"
},
{
"id": "401",
"name": "Jaunjelgavas novads"
},
{
"id": "402",
"name": "Jaunpiebalgas novads"
},
{
"id": "403",
"name": "Jaunpils novads"
},
{
"id": "357",
"name": "Jēkabpils"
},
{
"id": "405",
"name": "Jēkabpils novads"
},
{
"id": "356",
"name": "Jelgava"
},
{
"id": "404",
"name": "Jelgavas novads"
},
{
"id": "358",
"name": "Jūrmala"
},
{
"id": "406",
"name": "Kandavas novads"
},
{
"id": "412",
"name": "Kārsavas novads"
},
{
"id": "473",
"name": "Ķeguma novads"
},
{
"id": "474",
"name": "Ķekavas novads"
},
{
"id": "407",
"name": "Kokneses novads"
},
{
"id": "410",
"name": "Krāslavas novads"
},
{
"id": "408",
"name": "Krimuldas novads"
},
{
"id": "409",
"name": "Krustpils novads"
},
{
"id": "411",
"name": "Kuldīgas novads"
},
{
"id": "413",
"name": "Lielvārdes novads"
},
{
"id": "359",
"name": "Liepāja"
},
{
"id": "360",
"name": "Liepājas novads"
},
{
"id": "417",
"name": "Līgatnes novads"
},
{
"id": "414",
"name": "Limbažu novads"
},
{
"id": "418",
"name": "Līvānu novads"
},
{
"id": "415",
"name": "Lubānas novads"
},
{
"id": "416",
"name": "Ludzas novads"
},
{
"id": "419",
"name": "Madonas novads"
},
{
"id": "421",
"name": "Mālpils novads"
},
{
"id": "422",
"name": "Mārupes novads"
},
{
"id": "420",
"name": "Mazsalacas novads"
},
{
"id": "423",
"name": "Naukšēnu novads"
},
{
"id": "424",
"name": "Neretas novads"
},
{
"id": "425",
"name": "Nīcas novads"
},
{
"id": "426",
"name": "Ogres novads"
},
{
"id": "427",
"name": "Olaines novads"
},
{
"id": "428",
"name": "Ozolnieku novads"
},
{
"id": "432",
"name": "Pārgaujas novads"
},
{
"id": "433",
"name": "Pāvilostas novads"
},
{
"id": "434",
"name": "Pļaviņu novads"
},
{
"id": "429",
"name": "Preiļu novads"
},
{
"id": "430",
"name": "Priekules novads"
},
{
"id": "431",
"name": "Priekuļu novads"
},
{
"id": "435",
"name": "Raunas novads"
},
{
"id": "361",
"name": "Rēzekne"
},
{
"id": "442",
"name": "Rēzeknes novads"
},
{
"id": "436",
"name": "Riebiņu novads"
},
{
"id": "362",
"name": "Rīga"
},
{
"id": "363",
"name": "Rīgas novads"
},
{
"id": "437",
"name": "Rojas novads"
},
{
"id": "438",
"name": "Ropažu novads"
},
{
"id": "439",
"name": "Rucavas novads"
},
{
"id": "440",
"name": "Rugāju novads"
},
{
"id": "443",
"name": "Rūjienas novads"
},
{
"id": "441",
"name": "Rundāles novads"
},
{
"id": "444",
"name": "Salacgrīvas novads"
},
{
"id": "445",
"name": "Salas novads"
},
{
"id": "446",
"name": "Salaspils novads"
},
{
"id": "447",
"name": "Saldus novads"
},
{
"id": "448",
"name": "Saulkrastu novads"
},
{
"id": "455",
"name": "Sējas novads"
},
{
"id": "449",
"name": "Siguldas novads"
},
{
"id": "451",
"name": "Skrīveru novads"
},
{
"id": "450",
"name": "Skrundas novads"
},
{
"id": "452",
"name": "Smiltenes novads"
},
{
"id": "453",
"name": "Stopiņu novads"
},
{
"id": "454",
"name": "Strenču novads"
},
{
"id": "456",
"name": "Talsu novads"
},
{
"id": "458",
"name": "Tērvetes novads"
},
{
"id": "457",
"name": "Tukuma novads"
},
{
"id": "459",
"name": "Vaiņodes novads"
},
{
"id": "460",
"name": "Valkas novads"
},
{
"id": "364",
"name": "Valmiera"
},
{
"id": "461",
"name": "Valmieras novads"
},
{
"id": "462",
"name": "Varakļānu novads"
},
{
"id": "469",
"name": "Vārkavas novads"
},
{
"id": "463",
"name": "Vecpiebalgas novads"
},
{
"id": "464",
"name": "Vecumnieku novads"
},
{
"id": "365",
"name": "Ventspils"
},
{
"id": "465",
"name": "Ventspils novads"
},
{
"id": "466",
"name": "Viesītes novads"
},
{
"id": "467",
"name": "Viļakas novads"
},
{
"id": "468",
"name": "Viļānu novads"
},
{
"id": "470",
"name": "Zilupes novads"
}
]
},
"LY": {
"id": "LY",
"name": "Libya",
"regions": null
},
"MA": {
"id": "MA",
"name": "Morocco",
"regions": null
},
"MC": {
"id": "MC",
"name": "Monaco",
"regions": null
},
"MD": {
"id": "MD",
"name": "Moldova",
"regions": null
},
"ME": {
"id": "ME",
"name": "Montenegro",
"regions": null
},
"MF": {
"id": "MF",
"name": "St. Martin",
"regions": null
},
"MG": {
"id": "MG",
"name": "Madagascar",
"regions": null
},
"MH": {
"id": "MH",
"name": "Marshall Islands",
"regions": null
},
"MK": {
"id": "MK",
"name": "North Macedonia",
"regions": null
},
"ML": {
"id": "ML",
"name": "Mali",
"regions": null
},
"MM": {
"id": "MM",
"name": "Myanmar (Burma)",
"regions": null
},
"MN": {
"id": "MN",
"name": "Mongolia",
"regions": null
},
"MO": {
"id": "MO",
"name": "Macao SAR China",
"regions": null
},
"MP": {
"id": "MP",
"name": "Northern Mariana Islands",
"regions": null
},
"MQ": {
"id": "MQ",
"name": "Martinique",
"regions": null
},
"MR": {
"id": "MR",
"name": "Mauritania",
"regions": null
},
"MS": {
"id": "MS",
"name": "Montserrat",
"regions": null
},
"MT": {
"id": "MT",
"name": "Malta",
"regions": null
},
"MU": {
"id": "MU",
"name": "Mauritius",
"regions": null
},
"MV": {
"id": "MV",
"name": "Maldives",
"regions": null
},
"MW": {
"id": "MW",
"name": "Malawi",
"regions": null
},
"MX": {
"id": "MX",
"name": "Mexico",
"regions": null
},
"MY": {
"id": "MY",
"name": "Malaysia",
"regions": [
{
"id": "487",
"name": "Johor"
},
{
"id": "488",
"name": "Kedah"
},
{
"id": "489",
"name": "Kelantan"
},
{
"id": "490",
"name": "Melaka"
},
{
"id": "491",
"name": "Negeri Sembilan"
},
{
"id": "492",
"name": "Pahang"
},
{
"id": "494",
"name": "Perak"
},
{
"id": "495",
"name": "Perlis"
},
{
"id": "493",
"name": "Pulau Pinang"
},
{
"id": "497",
"name": "Sabah"
},
{
"id": "498",
"name": "Sarawak"
},
{
"id": "486",
"name": "Selangor"
},
{
"id": "496",
"name": "Terengganu"
},
{
"id": "485",
"name": "WP Kuala Lumpur"
},
{
"id": "499",
"name": "WP Labuan"
},
{
"id": "500",
"name": "WP Putrajaya"
}
]
},
"MZ": {
"id": "MZ",
"name": "Mozambique",
"regions": null
},
"NA": {
"id": "NA",
"name": "Namibia",
"regions": null
},
"NC": {
"id": "NC",
"name": "New Caledonia",
"regions": null
},
"NE": {
"id": "NE",
"name": "Niger",
"regions": null
},
"NF": {
"id": "NF",
"name": "Norfolk Island",
"regions": null
},
"NG": {
"id": "NG",
"name": "Nigeria",
"regions": null
},
"NI": {
"id": "NI",
"name": "Nicaragua",
"regions": null
},
"NL": {
"id": "NL",
"name": "Netherlands",
"regions": null
},
"NO": {
"id": "NO",
"name": "Norway",
"regions": null
},
"NP": {
"id": "NP",
"name": "Nepal",
"regions": null
},
"NR": {
"id": "NR",
"name": "Nauru",
"regions": null
},
"NU": {
"id": "NU",
"name": "Niue",
"regions": null
},
"NZ": {
"id": "NZ",
"name": "New Zealand",
"regions": null
},
"OM": {
"id": "OM",
"name": "Oman",
"regions": null
},
"PA": {
"id": "PA",
"name": "Panama",
"regions": null
},
"PE": {
"id": "PE",
"name": "Peru",
"regions": null
},
"PF": {
"id": "PF",
"name": "French Polynesia",
"regions": null
},
"PG": {
"id": "PG",
"name": "Papua New Guinea",
"regions": null
},
"PH": {
"id": "PH",
"name": "Philippines",
"regions": null
},
"PK": {
"id": "PK",
"name": "Pakistan",
"regions": null
},
"PL": {
"id": "PL",
"name": "Poland",
"regions": null
},
"PM": {
"id": "PM",
"name": "St. Pierre & Miquelon",
"regions": null
},
"PN": {
"id": "PN",
"name": "Pitcairn Islands",
"regions": null
},
"PR": {
"id": "PR",
"name": "Puerto Rico",
"regions": null
},
"PS": {
"id": "PS",
"name": "Palestinian Territories",
"regions": null
},
"PT": {
"id": "PT",
"name": "Portugal",
"regions": null
},
"PW": {
"id": "PW",
"name": "Palau",
"regions": null
},
"PY": {
"id": "PY",
"name": "Paraguay",
"regions": null
},
"QA": {
"id": "QA",
"name": "Qatar",
"regions": null
},
"RE": {
"id": "RE",
"name": "Réunion",
"regions": null
},
"RO": {
"id": "RO",
"name": "Romania",
"regions": [
{
"id": "278",
"name": "Alba"
},
{
"id": "279",
"name": "Arad"
},
{
"id": "280",
"name": "Argeş"
},
{
"id": "281",
"name": "Bacău"
},
{
"id": "282",
"name": "Bihor"
},
{
"id": "283",
"name": "Bistriţa-Năsăud"
},
{
"id": "284",
"name": "Botoşani"
},
{
"id": "286",
"name": "Brăila"
},
{
"id": "285",
"name": "Braşov"
},
{
"id": "287",
"name": "Bucureşti"
},
{
"id": "288",
"name": "Buzău"
},
{
"id": "290",
"name": "Călăraşi"
},
{
"id": "289",
"name": "Caraş-Severin"
},
{
"id": "291",
"name": "Cluj"
},
{
"id": "292",
"name": "Constanţa"
},
{
"id": "293",
"name": "Covasna"
},
{
"id": "294",
"name": "Dâmboviţa"
},
{
"id": "295",
"name": "Dolj"
},
{
"id": "296",
"name": "Galaţi"
},
{
"id": "297",
"name": "Giurgiu"
},
{
"id": "298",
"name": "Gorj"
},
{
"id": "299",
"name": "Harghita"
},
{
"id": "300",
"name": "Hunedoara"
},
{
"id": "301",
"name": "Ialomiţa"
},
{
"id": "302",
"name": "Iaşi"
},
{
"id": "303",
"name": "Ilfov"
},
{
"id": "304",
"name": "Maramureş"
},
{
"id": "305",
"name": "Mehedinţi"
},
{
"id": "306",
"name": "Mureş"
},
{
"id": "307",
"name": "Neamţ"
},
{
"id": "308",
"name": "Olt"
},
{
"id": "309",
"name": "Prahova"
},
{
"id": "311",
"name": "Sălaj"
},
{
"id": "310",
"name": "Satu-Mare"
},
{
"id": "312",
"name": "Sibiu"
},
{
"id": "313",
"name": "Suceava"
},
{
"id": "314",
"name": "Teleorman"
},
{
"id": "315",
"name": "Timiş"
},
{
"id": "316",
"name": "Tulcea"
},
{
"id": "318",
"name": "Vâlcea"
},
{
"id": "317",
"name": "Vaslui"
},
{
"id": "319",
"name": "Vrancea"
}
]
},
"RS": {
"id": "RS",
"name": "Serbia",
"regions": null
},
"RU": {
"id": "RU",
"name": "Russia",
"regions": null
},
"RW": {
"id": "RW",
"name": "Rwanda",
"regions": null
},
"SA": {
"id": "SA",
"name": "Saudi Arabia",
"regions": null
},
"SB": {
"id": "SB",
"name": "Solomon Islands",
"regions": null
},
"SC": {
"id": "SC",
"name": "Seychelles",
"regions": null
},
"SD": {
"id": "SD",
"name": "Sudan",
"regions": null
},
"SE": {
"id": "SE",
"name": "Sweden",
"regions": null
},
"SG": {
"id": "SG",
"name": "Singapore",
"regions": null
},
"SH": {
"id": "SH",
"name": "St. Helena",
"regions": null
},
"SI": {
"id": "SI",
"name": "Slovenia",
"regions": null
},
"SJ": {
"id": "SJ",
"name": "Svalbard & Jan Mayen",
"regions": null
},
"SK": {
"id": "SK",
"name": "Slovakia",
"regions": null
},
"SL": {
"id": "SL",
"name": "Sierra Leone",
"regions": null
},
"SM": {
"id": "SM",
"name": "San Marino",
"regions": null
},
"SN": {
"id": "SN",
"name": "Senegal",
"regions": null
},
"SO": {
"id": "SO",
"name": "Somalia",
"regions": null
},
"SR": {
"id": "SR",
"name": "Suriname",
"regions": null
},
"ST": {
"id": "ST",
"name": "São Tomé & Príncipe",
"regions": null
},
"SV": {
"id": "SV",
"name": "El Salvador",
"regions": null
},
"SY": {
"id": "SY",
"name": "Syria",
"regions": null
},
"SZ": {
"id": "SZ",
"name": "Eswatini",
"regions": null
},
"TC": {
"id": "TC",
"name": "Turks & Caicos Islands",
"regions": null
},
"TD": {
"id": "TD",
"name": "Chad",
"regions": null
},
"TF": {
"id": "TF",
"name": "French Southern Territories",
"regions": null
},
"TG": {
"id": "TG",
"name": "Togo",
"regions": null
},
"TH": {
"id": "TH",
"name": "Thailand",
"regions": null
},
"TJ": {
"id": "TJ",
"name": "Tajikistan",
"regions": null
},
"TK": {
"id": "TK",
"name": "Tokelau",
"regions": null
},
"TL": {
"id": "TL",
"name": "Timor-Leste",
"regions": null
},
"TM": {
"id": "TM",
"name": "Turkmenistan",
"regions": null
},
"TN": {
"id": "TN",
"name": "Tunisia",
"regions": null
},
"TO": {
"id": "TO",
"name": "Tonga",
"regions": null
},
"TR": {
"id": "TR",
"name": "Turkey",
"regions": null
},
"TT": {
"id": "TT",
"name": "Trinidad & Tobago",
"regions": null
},
"TV": {
"id": "TV",
"name": "Tuvalu",
"regions": null
},
"TW": {
"id": "TW",
"name": "Taiwan",
"regions": null
},
"TZ": {
"id": "TZ",
"name": "Tanzania",
"regions": null
},
"UA": {
"id": "UA",
"name": "Ukraine",
"regions": null
},
"UG": {
"id": "UG",
"name": "Uganda",
"regions": null
},
"UM": {
"id": "UM",
"name": "U.S. Outlying Islands",
"regions": null
},
"US": {
"id": "US",
"name": "United States",
"regions": [
{
"id": "1",
"name": "Alabama"
},
{
"id": "2",
"name": "Alaska"
},
{
"id": "3",
"name": "American Samoa"
},
{
"id": "4",
"name": "Arizona"
},
{
"id": "5",
"name": "Arkansas"
},
{
"id": "6",
"name": "Armed Forces Africa"
},
{
"id": "7",
"name": "Armed Forces Americas"
},
{
"id": "8",
"name": "Armed Forces Canada"
},
{
"id": "9",
"name": "Armed Forces Europe"
},
{
"id": "10",
"name": "Armed Forces Middle East"
},
{
"id": "11",
"name": "Armed Forces Pacific"
},
{
"id": "12",
"name": "California"
},
{
"id": "13",
"name": "Colorado"
},
{
"id": "14",
"name": "Connecticut"
},
{
"id": "15",
"name": "Delaware"
},
{
"id": "16",
"name": "District of Columbia"
},
{
"id": "17",
"name": "Federated States Of Micronesia"
},
{
"id": "18",
"name": "Florida"
},
{
"id": "19",
"name": "Georgia"
},
{
"id": "20",
"name": "Guam"
},
{
"id": "21",
"name": "Hawaii"
},
{
"id": "22",
"name": "Idaho"
},
{
"id": "23",
"name": "Illinois"
},
{
"id": "24",
"name": "Indiana"
},
{
"id": "25",
"name": "Iowa"
},
{
"id": "26",
"name": "Kansas"
},
{
"id": "27",
"name": "Kentucky"
},
{
"id": "28",
"name": "Louisiana"
},
{
"id": "29",
"name": "Maine"
},
{
"id": "30",
"name": "Marshall Islands"
},
{
"id": "31",
"name": "Maryland"
},
{
"id": "32",
"name": "Massachusetts"
},
{
"id": "33",
"name": "Michigan"
},
{
"id": "34",
"name": "Minnesota"
},
{
"id": "35",
"name": "Mississippi"
},
{
"id": "36",
"name": "Missouri"
},
{
"id": "37",
"name": "Montana"
},
{
"id": "38",
"name": "Nebraska"
},
{
"id": "39",
"name": "Nevada"
},
{
"id": "40",
"name": "New Hampshire"
},
{
"id": "41",
"name": "New Jersey"
},
{
"id": "42",
"name": "New Mexico"
},
{
"id": "43",
"name": "New York"
},
{
"id": "44",
"name": "North Carolina"
},
{
"id": "45",
"name": "North Dakota"
},
{
"id": "46",
"name": "Northern Mariana Islands"
},
{
"id": "47",
"name": "Ohio"
},
{
"id": "48",
"name": "Oklahoma"
},
{
"id": "49",
"name": "Oregon"
},
{
"id": "50",
"name": "Palau"
},
{
"id": "51",
"name": "Pennsylvania"
},
{
"id": "52",
"name": "Puerto Rico"
},
{
"id": "53",
"name": "Rhode Island"
},
{
"id": "54",
"name": "South Carolina"
},
{
"id": "55",
"name": "South Dakota"
},
{
"id": "56",
"name": "Tennessee"
},
{
"id": "57",
"name": "Texas"
},
{
"id": "58",
"name": "Utah"
},
{
"id": "59",
"name": "Vermont"
},
{
"id": "60",
"name": "Virgin Islands"
},
{
"id": "61",
"name": "Virginia"
},
{
"id": "62",
"name": "Washington"
},
{
"id": "63",
"name": "West Virginia"
},
{
"id": "64",
"name": "Wisconsin"
},
{
"id": "65",
"name": "Wyoming"
}
]
},
"UY": {
"id": "UY",
"name": "Uruguay",
"regions": null
},
"UZ": {
"id": "UZ",
"name": "Uzbekistan",
"regions": null
},
"VA": {
"id": "VA",
"name": "Vatican City",
"regions": null
},
"VC": {
"id": "VC",
"name": "St. Vincent & Grenadines",
"regions": null
},
"VE": {
"id": "VE",
"name": "Venezuela",
"regions": null
},
"VG": {
"id": "VG",
"name": "British Virgin Islands",
"regions": null
},
"VI": {
"id": "VI",
"name": "U.S. Virgin Islands",
"regions": null
},
"VN": {
"id": "VN",
"name": "Vietnam",
"regions": null
},
"VU": {
"id": "VU",
"name": "Vanuatu",
"regions": null
},
"WF": {
"id": "WF",
"name": "Wallis & Futuna",
"regions": null
},
"WS": {
"id": "WS",
"name": "Samoa",
"regions": null
},
"YE": {
"id": "YE",
"name": "Yemen",
"regions": null
},
"YT": {
"id": "YT",
"name": "Mayotte",
"regions": null
},
"ZA": {
"id": "ZA",
"name": "South Africa",
"regions": null
},
"ZM": {
"id": "ZM",
"name": "Zambia",
"regions": null
},
"ZW": {
"id": "ZW",
"name": "Zimbabwe",
"regions": null
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment