Endpoints
Retrieve data including name, demonym, capital, iso codes, dialing codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide.
Request Countries
Query this endpoint to retrieve a collection of countries.
Arguments
detailedboolean | Whether to retrieve detailed country data. |
Example Request
fetch("https://sandbox.connections-pro.com/wp-json/cn-api/v1/countries", {
method: "get",
})
.then((data) => data.json())
.then(console.log);fetch("https://sandbox.connections-pro.com/wp-json/cn-api/v1/countries?detailed=true", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Request Country
Query this endpoint to retrieve a collection of country details.
Arguments
codestring | Retrieve detailed country data. One of: ad, ae, af, ag, ai, al, am, ao, aq, ar, as, at, au, aw, ax, az, ba, bb, bd, be, bf, bg, bh, bi, bj, bl, bm, bn, bo, bq, br, bs, bt, bv, bw, by, bz, ca, cc, cd, cf, cg, ch, ci, ck, cl, cm, cn, co, cr, cu, cv, cw, cx, cy, cz, de, dj, dk, dm, do, dz, ec, ee, eg, eh, er, es, et, fi, fj, fk, fm, fo, fr, ga, gb, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy, hk, hm, hn, hr, ht, hu, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly, ma, mc, md, me, mf, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py, qa, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, si, sj, sk, sl, sm, sn, so, sr, ss, st, sv, sx, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tr, tt, tv, tw, tz, ua, ug, um, us, uy, uz, va, vc, ve, vg, vi, vn, vu, wf, ws, xk, ye, yt, za, zm, zw |
Example Request
fetch("https://sandbox.connections-pro.com/wp-json/cn-api/v1/countries/us", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Example Response
{
"name": {
"common": "United States",
"official": "United States of America",
"native": {
"eng": {
"common": "United States",
"official": "United States of America"
}
}
},
"demonym": "American",
"capital": "Washington D.C.",
"iso_3166_1_alpha2": "US",
"iso_3166_1_alpha3": "USA",
"iso_3166_1_numeric": "840",
"currency": {
"USD": {
"iso_4217_code": "USD",
"iso_4217_numeric": 840,
"iso_4217_name": "US Dollar",
"iso_4217_minor_unit": 2
}
},
"tld": [
".us"
],
"alt_spellings": [
"US",
"USA",
"United States of America"
],
"languages": {
"eng": "English"
},
"geo": {
"continent": {
"NA": "North America"
},
"postal_code": true,
"latitude": "38 00 N",
"latitude_desc": "39.44325637817383",
"longitude": "97 00 W",
"longitude_desc": "-98.95733642578125",
"max_latitude": "71.441059",
"max_longitude": "-66.885417",
"min_latitude": "17.831509",
"min_longitude": "-179.231086",
"area": 9372610,
"region": "Americas",
"subregion": "Northern America",
"world_region": "AMER",
"region_code": "019",
"subregion_code": "021",
"landlocked": false,
"borders": [
"CAN",
"MEX"
],
"independent": "Yes"
},
"dialling": {
"calling_code": [
"1"
],
"national_prefix": "1",
"national_number_lengths": [
10
],
"national_destination_code_lengths": [
3
],
"international_prefix": "011"
},
"extra": {
"geonameid": 6252001,
"edgar": 0,
"itu": "USA",
"marc": "xxu",
"wmo": "US",
"ds": "USA",
"fifa": "USA",
"fips": "US",
"gaul": 259,
"ioc": "USA",
"cowc": "USA",
"cown": 2,
"fao": 231,
"imf": 111,
"ar5": "OECD1990",
"address_format": "{{recipient}}\n{{street}}\n{{city}} {{region_short}} {{postalcode}}\n{{country}}",
"eu_member": null,
"data_protection": "Other",
"vat_rates": null,
"emoji": "🇺🇸"
}
}Request Country GeoJSON
Query this endpoint to retrieve the GeoJSON borders of a requested country. The request result can be fed into a GeoJSON Parser or Viewer.
Arguments
codestring | The country code. One of: ad, ae, af, ag, ai, al, am, ao, aq, ar, as, at, au, aw, ax, az, ba, bb, bd, be, bf, bg, bh, bi, bj, bl, bm, bn, bo, bq, br, bs, bt, bv, bw, by, bz, ca, cc, cd, cf, cg, ch, ci, ck, cl, cm, cn, co, cr, cu, cv, cw, cx, cy, cz, de, dj, dk, dm, do, dz, ec, ee, eg, eh, er, es, et, fi, fj, fk, fm, fo, fr, ga, gb, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy, hk, hm, hn, hr, ht, hu, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly, ma, mc, md, me, mf, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py, qa, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, si, sj, sk, sl, sm, sn, so, sr, ss, st, sv, sx, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tr, tt, tv, tw, tz, ua, ug, um, us, uy, uz, va, vc, ve, vg, vi, vn, vu, wf, ws, xk, ye, yt, za, zm, zw |
Example Request
fetch("https://sandbox.connections-pro.com/wp-json/cn-api/v1/countries/va/geojson", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Example Response
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"cca2": "va"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12.4450903308890001852660134318284690380096435546875,
41.90311752178499915544307441450655460357666015625
],
[
12.4516533395810000683923135511577129364013671875,
41.90798903339099723552862997166812419891357421875
],
[
12.4566601709540005771259529865346848964691162109375,
41.90142602469899912875916925258934497833251953125
],
[
12.4450903308890001852660134318284690380096435546875,
41.90311752178499915544307441450655460357666015625
]
]
]
}
}
]
}Request Country Regions
Query this endpoint to retrieve administrative divisions or units of a country (states, provinces, etc.).
Arguments
codestring | The country code. One of: ad, ae, af, ag, ai, al, am, ao, aq, ar, as, at, au, aw, ax, az, ba, bb, bd, be, bf, bg, bh, bi, bj, bl, bm, bn, bo, bq, br, bs, bt, bv, bw, by, bz, ca, cc, cd, cf, cg, ch, ci, ck, cl, cm, cn, co, cr, cu, cv, cw, cx, cy, cz, de, dj, dk, dm, do, dz, ec, ee, eg, eh, er, es, et, fi, fj, fk, fm, fo, fr, ga, gb, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy, hk, hm, hn, hr, ht, hu, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly, ma, mc, md, me, mf, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py, qa, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, si, sj, sk, sl, sm, sn, so, sr, ss, st, sv, sx, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tr, tt, tv, tw, tz, ua, ug, um, us, uy, uz, va, vc, ve, vg, vi, vn, vu, wf, ws, xk, ye, yt, za, zm, zw |
Example Request
fetch("https://sandbox.connections-pro.com/wp-json/cn-api/v1/countries/ca/regions", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Example Response
{
"AB": {
"name": "Alberta",
"alt_names": [
"Alberta"
],
"geo": {
"latitude": 53.9332706000000001722582965157926082611083984375,
"longitude": -116.57650350000000116779119707643985748291015625,
"min_latitude": 48.99666710000000335867298417724668979644775390625,
"min_longitude": -120.000521899999995412144926376640796661376953125,
"max_latitude": 60.00006210000000095305949798785150051116943359375,
"max_longitude": -109.9998551000000048816218622960150241851806640625
}
},
"BC": {
"name": "British Columbia",
"alt_names": [
"Colombie-Britannique"
],
"geo": {
"latitude": 53.726668300000000044747139327228069305419921875,
"longitude": -127.6476205999999962159563438035547733306884765625,
"min_latitude": 48.308912300000002915112418122589588165283203125,
"min_longitude": -139.05707019999999829451553523540496826171875,
"max_latitude": 60.0001488999999992302036844193935394287109375,
"max_longitude": -114.05422110000000657237251289188861846923828125
}
},
"MB": {
"name": "Manitoba",
"alt_names": [
"Manitoba"
],
"geo": {
"latitude": 53.7608608000000032234311220236122608184814453125,
"longitude": -98.81387630000000399377313442528247833251953125,
"min_latitude": 48.99886099999999800047589815221726894378662109375,
"min_longitude": -102.0000040999999981750079314224421977996826171875,
"max_latitude": 60.00010309999999691399352741427719593048095703125,
"max_longitude": -88.9852264999999960082277539186179637908935546875
}
},
"NB": {
"name": "New Brunswick",
"alt_names": [
"Nouveau-Brunswick"
],
"geo": {
"latitude": 46.56531629999999921665221336297690868377685546875,
"longitude": -66.46191640000000688814907334744930267333984375,
"min_latitude": 44.49957400000000262707544607110321521759033203125,
"min_longitude": -69.05339290000000573854777030646800994873046875,
"max_latitude": 48.17351570000000293703124043531715869903564453125,
"max_longitude": -63.770640299999996614133124239742755889892578125
}
},
"NL": {
"name": "Newfoundland and Labrador",
"alt_names": [
"Terre-Neuve-et-Labrador",
"Newfoundland",
"Terre-Neuve"
],
"geo": {
"latitude": 53.13550910000000015998011804185807704925537109375,
"longitude": -57.66043640000000181089490070007741451263427734375,
"min_latitude": 46.61145710000000264017216977663338184356689453125,
"min_longitude": -67.8216848999999939451299724169075489044189453125,
"max_latitude": 60.37627009999999927458702586591243743896484375,
"max_longitude": -52.6194085999999998648490873165428638458251953125
}
},
"NS": {
"name": "Nova Scotia",
"alt_names": [
"Nouvelle-Écosse"
],
"geo": {
"latitude": 44.6819866000000018857463146559894084930419921875,
"longitude": -63.74431100000000327554516843520104885101318359375,
"min_latitude": 43.3918804999999991878212313167750835418701171875,
"min_longitude": -66.3948185999999935802406980656087398529052734375,
"max_latitude": 47.2277437999999989415300660766661167144775390625,
"max_longitude": -59.6769139999999964629751048050820827484130859375
}
},
"NT": {
"name": "Northwest Territories",
"alt_names": [
"Territoires du Nord-Ouest"
],
"geo": {
"latitude": 64.8255441000000018902937881648540496826171875,
"longitude": -124.845733400000000301588443107903003692626953125,
"min_latitude": 59.9999540000000024519977159798145294189453125,
"min_longitude": -136.468705300000010538497008383274078369140625,
"max_latitude": 78.7613420999999931382262730039656162261962890625,
"max_longitude": -101.9999990000000025247572921216487884521484375
}
},
"NU": {
"name": "Nunavut",
"alt_names": [
"Nunavut"
],
"geo": {
"latitude": 70.2997711000000009562427294440567493438720703125,
"longitude": -83.107576899999997976919985376298427581787109375,
"min_latitude": 51.6406984999999991714503266848623752593994140625,
"min_longitude": -121.04924909999999727006070315837860107421875,
"max_latitude": 83.0956637999999969679265632294118404388427734375,
"max_longitude": -61.17943840000000221834852709434926509857177734375
}
},
"ON": {
"name": "Ontario",
"alt_names": [
"Ontario"
],
"geo": {
"latitude": 51.25377499999999741930878371931612491607666015625,
"longitude": -85.3232138999999989437128533609211444854736328125,
"min_latitude": 41.68134880000000208610799745656549930572509765625,
"min_longitude": -95.156227099999995289181242696940898895263671875,
"max_latitude": 56.85652790000000322834239341318607330322265625,
"max_longitude": -74.3438823000000041929524741135537624359130859375
}
},
"PE": {
"name": "Prince Edward Island",
"alt_names": [
"Île-du-Prince-Édouard"
],
"geo": {
"latitude": 46.5107119999999980564098223112523555755615234375,
"longitude": -63.4168135999999975638274918310344219207763671875,
"min_latitude": 45.94818450000000353838913724757730960845947265625,
"min_longitude": -64.5661237999999997327904566191136837005615234375,
"max_latitude": 47.4416628000000031306626624427735805511474609375,
"max_longitude": -61.97075459999999935689629637636244297027587890625
}
},
"QC": {
"name": "Quebec",
"alt_names": [
"Québec"
],
"geo": {
"latitude": 52.9399159000000025798726710490882396697998046875,
"longitude": -73.54913609999999835054040886461734771728515625,
"min_latitude": 44.9913580999999993537130649201571941375732421875,
"min_longitude": -79.762337099999996326005202718079090118408203125,
"max_latitude": 62.58305519999999688707248424179852008819580078125,
"max_longitude": -57.10548589999999791189111419953405857086181640625
}
},
"SK": {
"name": "Saskatchewan",
"alt_names": [
"Saskatchewan"
],
"geo": {
"latitude": 52.9399159000000025798726710490882396697998046875,
"longitude": -106.45086390000000164945959113538265228271484375,
"min_latitude": 48.99880590000000069039742811582982540130615234375,
"min_longitude": -110.0077548999999947909600450657308101654052734375,
"max_latitude": 60.0000629999999972596924635581672191619873046875,
"max_longitude": -101.3623050000000063164407038129866123199462890625
}
},
"YT": {
"name": "Yukon",
"alt_names": [
"Yukon Territory"
],
"geo": {
"latitude": 64.2823273999999997840859577991068363189697265625,
"longitude": -135,
"min_latitude": 59.99688900000000302270564134232699871063232421875,
"min_longitude": -141.00186999999999670762917958199977874755859375,
"max_latitude": 69.6464979999999940218913252465426921844482421875,
"max_longitude": -123.80091790000000173677108250558376312255859375
}
}
}Request Country Region
Arguments
codestring | The country code. One of: ad, ae, af, ag, ai, al, am, ao, aq, ar, as, at, au, aw, ax, az, ba, bb, bd, be, bf, bg, bh, bi, bj, bl, bm, bn, bo, bq, br, bs, bt, bv, bw, by, bz, ca, cc, cd, cf, cg, ch, ci, ck, cl, cm, cn, co, cr, cu, cv, cw, cx, cy, cz, de, dj, dk, dm, do, dz, ec, ee, eg, eh, er, es, et, fi, fj, fk, fm, fo, fr, ga, gb, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy, hk, hm, hn, hr, ht, hu, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly, ma, mc, md, me, mf, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py, qa, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, si, sj, sk, sl, sm, sn, so, sr, ss, st, sv, sx, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tr, tt, tv, tw, tz, ua, ug, um, us, uy, uz, va, vc, ve, vg, vi, vn, vu, wf, ws, xk, ye, yt, za, zm, zw |
regionstring | The region code. |
Example Request
fetch("https://sandbox.connections-pro.com/wp-json/cn-api/v1/countries/ca/region/ns", {
method: "get",
})
.then((data) => data.json())
.then(console.log);Example Response
{
"name": "Nova Scotia",
"alt_names": [
"Nouvelle-Écosse"
],
"geo": {
"latitude": 44.6819866000000018857463146559894084930419921875,
"longitude": -63.74431100000000327554516843520104885101318359375,
"min_latitude": 43.3918804999999991878212313167750835418701171875,
"min_longitude": -66.3948185999999935802406980656087398529052734375,
"max_latitude": 47.2277437999999989415300660766661167144775390625,
"max_longitude": -59.6769139999999964629751048050820827484130859375
}
}Hooks
Actions
- No action hooks are available.
Filters
- No filter hooks are available.
Examples
- No examples are available.
