Please wait...

Countries

By: Qymera


Need to provide information about a country? Our Countries API got you covered with data of the world countries’ population, flag, languages used, even their longitudinal and latitudinal values.



Overview

  • Retrieve information on various countries
  • Data is available in JSON, XML, or HTML format
Using the API

We built the API documentation to be as self-documenting as possible, but if you find yourself overwhelmed, we organized this site into these major areas:

  • Getting Started - introduces you to the operations offered by the API.
  • API Calls - gives you a hands-on experience of those operations with an interactive console.
  • Parameters List - can be found inside each API. It lists and describes the type of information needed by the API.
  • Comments - get in touch by leaving a comment. We appreciate any feedback, too.

Getting Started

The current version of the API lives at https://gateway.qymera.tech/qymera/sb/countries/v1/.

  • https://gateway.qymera.tech/qymera/sb/countries/v1/all
  • https://gateway.qymera.tech/qymera/sb/countries/v1/search?name=Japan
  • https://gateway.qymera.tech/qymera/sb/countries/v1/capital?city=Tokyo
  • https://gateway.qymera.tech/qymera/sb/countries/v1/region?region=Asia
  • https://gateway.qymera.tech/qymera/sb/countries/v1/currency?code=JPY
  • https://gateway.qymera.tech/qymera/sb/countries/v1/language?code=jpn
Endpoints
Endpoint What it does
/all Gets all countries and its information.
/search Gets the country that matches the specified name.
/capital Gets the country with the specified city as its capital.
/region Gets the country within the specified region.
/currency Gets the countries that uses the specified currency.
/language Gets the countries that uses the specified language.

API Calls

Headers
Key Value Description
accept application/json
x-ibm-client-id Use the given application credential id
x-ibm-client-secret Use the given application credential secret
/all
Implementation Notes

Gets all countries and its information.

Sample Request:
curl --request GET \
  --url 'https://gateway.qymera.tech/qymera/sb/countries/v1/' \
  --header 'accept: application/json' \
  --header 'x-ibm-client-id: REPLACE_THIS_VALUE' \
  --header 'x-ibm-client-secret: REPLACE_THIS_VALUE'
Request

GET

https://gateway.qymera.tech/qymera/sb/countries/v1/

Response

200

{
   "message":"Success.",
   "data":[
      {
         "name":"Afghanistan",
         "topLevelDomain":[
            ".af"
         ],
         "alpha2Code":"AF",
         "alpha3Code":"AFG",
         "callingCodes":[
            "93"
         ],
         "capital":"Kabul",
         "altSpellings":[
            "AF",
            "Afġānistān"
         ],
         "region":"Asia",
         "subregion":"Southern Asia",
         "population":27657145,
         "latlng":[
            33,
            65
         ],
         "demonym":"Afghan",
         "area":652230,
         "gini":27.8,
         "timezones":[
            "UTC+04:30"
         ],
         "borders":[
            "IRN",
            "PAK",
            "TKM",
            "UZB",
            "TJK",
            "CHN"
         ],
         "nativeName":"افغانستان",
         "numericCode":"004",
         "currencies":[
            {
               "code":"AFN",
               "name":"Afghan afghani",
               "symbol":"؋"
            }
         ],
         "languages":[
            {
               "iso639_1":"ps",
               "iso639_2":"pus",
               "name":"Pashto",
               "nativeName":"پښتو"
            },
            {
               "iso639_1":"uz",
               "iso639_2":"uzb",
               "name":"Uzbek",
               "nativeName":"Oʻzbek"
            },
            {
               "iso639_1":"tk",
               "iso639_2":"tuk",
               "name":"Turkmen",
               "nativeName":"Türkmen"
            }
         ],
         "translations":{
            "de":"Afghanistan",
            "es":"Afganistán",
            "fr":"Afghanistan",
            "ja":"アフガニスタン",
            "it":"Afghanistan",
            "br":"Afeganistão",
            "pt":"Afeganistão",
            "nl":"Afghanistan",
            "hr":"Afganistan",
            "fa":"افغانستان"
         },
         "flag":"https://restcountries.eu/data/afg.svg",
         "regionalBlocs":[
            {
               "acronym":"SAARC",
               "name":"South Asian Association for Regional Cooperation",
               "otherAcronyms":[

               ],
               "otherNames":[

               ]
            }
         ],
         "cioc":"AFG"
      },
		//more countries
      {
         "name":"Zimbabwe",
         "topLevelDomain":[
            ".zw"
         ],
         "alpha2Code":"ZW",
         "alpha3Code":"ZWE",
         "callingCodes":[
            "263"
         ],
         "capital":"Harare",
         "altSpellings":[
            "ZW",
            "Republic of Zimbabwe"
         ],
         "region":"Africa",
         "subregion":"Eastern Africa",
         "population":14240168,
         "latlng":[
            -20,
            30
         ],
         "demonym":"Zimbabwean",
         "area":390757,
         "gini":null,
         "timezones":[
            "UTC+02:00"
         ],
         "borders":[
            "BWA",
            "MOZ",
            "ZAF",
            "ZMB"
         ],
         "nativeName":"Zimbabwe",
         "numericCode":"716",
         "currencies":[
            {
               "code":"BWP",
               "name":"Botswana pula",
               "symbol":"P"
            },
            {
               "code":"GBP",
               "name":"British pound",
               "symbol":"£"
            },
            {
               "code":"CNY",
               "name":"Chinese yuan",
               "symbol":"¥"
            },
            {
               "code":"EUR",
               "name":"Euro",
               "symbol":"€"
            },
            {
               "code":"INR",
               "name":"Indian rupee",
               "symbol":"₹"
            },
            {
               "code":"JPY",
               "name":"Japanese yen",
               "symbol":"¥"
            },
            {
               "code":"ZAR",
               "name":"South African rand",
               "symbol":"Rs"
            },
            {
               "code":"USD",
               "name":"United States dollar",
               "symbol":"$"
            },
            {
               "code":"(none)",
               "name":null,
               "symbol":null
            }
         ],
         "languages":[
            {
               "iso639_1":"en",
               "iso639_2":"eng",
               "name":"English",
               "nativeName":"English"
            },
            {
               "iso639_1":"sn",
               "iso639_2":"sna",
               "name":"Shona",
               "nativeName":"chiShona"
            },
            {
               "iso639_1":"nd",
               "iso639_2":"nde",
               "name":"Northern Ndebele",
               "nativeName":"isiNdebele"
            }
         ],
         "translations":{
            "de":"Simbabwe",
            "es":"Zimbabue",
            "fr":"Zimbabwe",
            "ja":"ジンバブエ",
            "it":"Zimbabwe",
            "br":"Zimbabwe",
            "pt":"Zimbabué",
            "nl":"Zimbabwe",
            "hr":"Zimbabve",
            "fa":"زیمباوه"
         },
         "flag":"https://restcountries.eu/data/zwe.svg",
         "regionalBlocs":[
            {
               "acronym":"AU",
               "name":"African Union",
               "otherAcronyms":[

               ],
               "otherNames":[
                  "الاتحاد الأفريقي",
                  "Union africaine",
                  "União Africana",
                  "Unión Africana",
                  "Umoja wa Afrika"
               ]
            }
         ],
         "cioc":"ZIM"
      }
   ]
}

500

{
      "code": -23,
      "message": "Something went wrong to countries service."
}

400

{
   "code": -24,
   "message": "Missing query parameter."
}
/search
Implementation Notes

Gets the country that matches the specified name.

Parameters
Parameter Data Type Necessity Location Description
name string required query Country name. Can be the native name or partial name. (e.g. name=jap, ticker=united)
Sample Request
curl --request GET \search
  --url 'https://gateway.qymera.tech/qymera/sb/stocks/v1/search?name=jap' \
  --header 'accept: application/json' \
  --header 'x-ibm-client-id: REPLACE_THIS_VALUE' \
  --header 'x-ibm-client-secret: REPLACE_THIS_VALUE'
Request

GET

https://gateway.qymera.tech/qymera/sb/countries/v1/search?name=jap

Response

200

{
   "message":"Success.",
   "data":[
      {
         "name":"Japan",
         "topLevelDomain":[
            ".jp"
         ],
         "alpha2Code":"JP",
         "alpha3Code":"JPN",
         "callingCodes":[
            "81"
         ],
         "capital":"Tokyo",
         "altSpellings":[
            "JP",
            "Nippon",
            "Nihon"
         ],
         "region":"Asia",
         "subregion":"Eastern Asia",
         "population":126960000,
         "latlng":[
            36,
            138
         ],
         "demonym":"Japanese",
         "area":377930,
         "gini":38.1,
         "timezones":[
            "UTC+09:00"
         ],
         "borders":[

         ],
         "nativeName":"日本",
         "numericCode":"392",
         "currencies":[
            {
               "code":"JPY",
               "name":"Japanese yen",
               "symbol":"¥"
            }
         ],
         "languages":[
            {
               "iso639_1":"ja",
               "iso639_2":"jpn",
               "name":"Japanese",
               "nativeName":"日本語 (にほんご)"
            }
         ],
         "translations":{
            "de":"Japan",
            "es":"Japón",
            "fr":"Japon",
            "ja":"日本",
            "it":"Giappone",
            "br":"Japão",
            "pt":"Japão",
            "nl":"Japan",
            "hr":"Japan",
            "fa":"ژاپن"
         },
         "flag":"https://restcountries.eu/data/jpn.svg",
         "regionalBlocs":[

         ],
         "cioc":"JPN"
      }
   ]
}

404

{
  "code":-8,
  "message":"Endpoint not found."
}

500

{
   "code": -23,
   "message": "Something went wrong to countries service."
}

400

{
   "code": -24,
   "message": "Missing query parameter."
}
/capital
Implementation Notes

Gets the country with the specified city as its capital.

Parameters
Parameter Data Type Necessity Location Description
city string required query City name that is a capital of a country. e.g.(city=Tokyo, city=Manila)
Sample Request
curl --request GET \capital
  --url 'https://gateway.qymera.tech/qymera/sb/stocks/v1/capital?city=tokyo' \
  --header 'accept: application/json' \
  --header 'x-ibm-client-id: REPLACE_THIS_VALUE' \
  --header 'x-ibm-client-secret: REPLACE_THIS_VALUE'
Request

GET

https://gateway.qymera.tech/qymera/sb/countries/v1/capital?city=manila

Response

200

{
   "message":"Success.",
   "data":[
      {
         "name":"Philippines",
         "topLevelDomain":[
            ".ph"
         ],
         "alpha2Code":"PH",
         "alpha3Code":"PHL",
         "callingCodes":[
            "63"
         ],
         "capital":"Manila",
         "altSpellings":[
            "PH",
            "Republic of the Philippines",
            "Repúblika ng Pilipinas"
         ],
         "region":"Asia",
         "subregion":"South-Eastern Asia",
         "population":103279800,
         "latlng":[
            13,
            122
         ],
         "demonym":"Filipino",
         "area":342353,
         "gini":43,
         "timezones":[
            "UTC+08:00"
         ],
         "borders":[

         ],
         "nativeName":"Pilipinas",
         "numericCode":"608",
         "currencies":[
            {
               "code":"PHP",
               "name":"Philippine peso",
               "symbol":"₱"
            }
         ],
         "languages":[
            {
               "iso639_1":"en",
               "iso639_2":"eng",
               "name":"English",
               "nativeName":"English"
            }
         ],
         "translations":{
            "de":"Philippinen",
            "es":"Filipinas",
            "fr":"Philippines",
            "ja":"フィリピン",
            "it":"Filippine",
            "br":"Filipinas",
            "pt":"Filipinas",
            "nl":"Filipijnen",
            "hr":"Filipini",
            "fa":"جزایر الندفیلیپین"
         },
         "flag":"https://restcountries.eu/data/phl.svg",
         "regionalBlocs":[
            {
               "acronym":"ASEAN",
               "name":"Association of Southeast Asian Nations",
               "otherAcronyms":[

               ],
               "otherNames":[

               ]
            }
         ],
         "cioc":"PHI"
      }
   ]
}

404

{
  "code":-8,
  "message":"Endpoint not found."
}

500

{
   "code": -23,
   "message": "Something went wrong to countries service."
}

400

{
   "code": -24,
   "message": "Missing query parameter."
}
/region
Implementation Notes

Gets the country within the specified region.

Parameters
Parameter Data Type Necessity Location Description
region string required query World region. Supported values are Africa, Americas, Asia, Europe, and Oceania. e.g.(region=asia)
Sample Request
curl --request GET \region
  --url 'https://gateway.qymera.tech/qymera/sb/stocks/v1/region?region=europe' \
  --header 'accept: application/json' \
  --header 'x-ibm-client-id: REPLACE_THIS_VALUE' \
  --header 'x-ibm-client-secret: REPLACE_THIS_VALUE'
Request

GET

https://gateway.qymera.tech/qymera/sb/countries/v1/region?region=oceania

Response

200

{
   "message":"Success.",
   "data":[
      {
         "name":"American Samoa",
         "topLevelDomain":[
            ".as"
         ],
         "alpha2Code":"AS",
         "alpha3Code":"ASM",
         "callingCodes":[
            "1684"
         ],
         "capital":"Pago Pago",
         "altSpellings":[
            "AS",
            "Amerika Sāmoa",
            "Amelika Sāmoa",
            "Sāmoa Amelika"
         ],
         "region":"Oceania",
         "subregion":"Polynesia",
         "population":57100,
         "latlng":[
            -14.33333333,
            -170
         ],
         "demonym":"American Samoan",
         "area":199,
         "gini":null,
         "timezones":[
            "UTC-11:00"
         ],
         "borders":[

         ],
         "nativeName":"American Samoa",
         "numericCode":"016",
         "currencies":[
            {
               "code":"USD",
               "name":"United State Dollar",
               "symbol":"$"
            }
         ],
         "languages":[
            {
               "iso639_1":"en",
               "iso639_2":"eng",
               "name":"English",
               "nativeName":"English"
            },
            {
               "iso639_1":"sm",
               "iso639_2":"smo",
               "name":"Samoan",
               "nativeName":"gagana fa'a Samoa"
            }
         ],
         "translations":{
            "de":"Amerikanisch-Samoa",
            "es":"Samoa Americana",
            "fr":"Samoa américaines",
            "ja":"アメリカ領サモア",
            "it":"Samoa Americane",
            "br":"Samoa Americana",
            "pt":"Samoa Americana",
            "nl":"Amerikaans Samoa",
            "hr":"Američka Samoa",
            "fa":"ساموآی آمریکا"
         },
         "flag":"https://restcountries.eu/data/asm.svg",
         "regionalBlocs":[

         ],
         "cioc":"ASA"
      },
		//more countries
      {
         "name":"Wallis and Futuna",
         "topLevelDomain":[
            ".wf"
         ],
         "alpha2Code":"WF",
         "alpha3Code":"WLF",
         "callingCodes":[
            "681"
         ],
         "capital":"Mata-Utu",
         "altSpellings":[
            "WF",
            "Territory of the Wallis and Futuna Islands",
            "Territoire des îles Wallis et Futuna"
         ],
         "region":"Oceania",
         "subregion":"Polynesia",
         "population":11750,
         "latlng":[
            -13.3,
            -176.2
         ],
         "demonym":"Wallis and Futuna Islander",
         "area":142,
         "gini":null,
         "timezones":[
            "UTC+12:00"
         ],
         "borders":[

         ],
         "nativeName":"Wallis et Futuna",
         "numericCode":"876",
         "currencies":[
            {
               "code":"XPF",
               "name":"CFP franc",
               "symbol":"Fr"
            }
         ],
         "languages":[
            {
               "iso639_1":"fr",
               "iso639_2":"fra",
               "name":"French",
               "nativeName":"français"
            }
         ],
         "translations":{
            "de":"Wallis und Futuna",
            "es":"Wallis y Futuna",
            "fr":"Wallis-et-Futuna",
            "ja":"ウォリス・フツナ",
            "it":"Wallis e Futuna",
            "br":"Wallis e Futuna",
            "pt":"Wallis e Futuna",
            "nl":"Wallis en Futuna",
            "hr":"Wallis i Fortuna",
            "fa":"والیس و فوتونا"
         },
         "flag":"https://restcountries.eu/data/wlf.svg",
         "regionalBlocs":[

         ],
         "cioc":""
      }
   ]
}

404

{
  "code":-8,
  "message":"Endpoint not found."
}

500

{
   "code": -23,
   "message": "Something went wrong to countries service."
}

400

{
   "code": -24,
   "message": "Missing query parameter."
}
/region
Implementation Notes

Gets the countries that uses the specified currency.

Parameters
Parameter Data Type Necessity Location Description
code string required query ISO 4217 currency code. C e.g.(code=jpy)
Sample Request
curl --request GET \currency
  --url 'https://gateway.qymera.tech/qymera/sb/countries/v1/currency?code=jpy' \
  --header 'accept: application/json' \
  --header 'x-ibm-client-id: REPLACE_THIS_VALUE' \
  --header 'x-ibm-client-secret: REPLACE_THIS_VALUE'
Request

GET

https://gateway.qymera.tech/qymera/sb/countries/v1/currency?code=jpy

Response

200

{
   "message":"Success.",
   "data":[
      {
         "name":"Japan",
         "topLevelDomain":[
            ".jp"
         ],
         "alpha2Code":"JP",
         "alpha3Code":"JPN",
         "callingCodes":[
            "81"
         ],
         "capital":"Tokyo",
         "altSpellings":[
            "JP",
            "Nippon",
            "Nihon"
         ],
         "region":"Asia",
         "subregion":"Eastern Asia",
         "population":126960000,
         "latlng":[
            36,
            138
         ],
         "demonym":"Japanese",
         "area":377930,
         "gini":38.1,
         "timezones":[
            "UTC+09:00"
         ],
         "borders":[

         ],
         "nativeName":"日本",
         "numericCode":"392",
         "currencies":[
            {
               "code":"JPY",
               "name":"Japanese yen",
               "symbol":"¥"
            }
         ],
         "languages":[
            {
               "iso639_1":"ja",
               "iso639_2":"jpn",
               "name":"Japanese",
               "nativeName":"日本語 (にほんご)"
            }
         ],
         "translations":{
            "de":"Japan",
            "es":"Japón",
            "fr":"Japon",
            "ja":"日本",
            "it":"Giappone",
            "br":"Japão",
            "pt":"Japão",
            "nl":"Japan",
            "hr":"Japan",
            "fa":"ژاپن"
         },
         "flag":"https://restcountries.eu/data/jpn.svg",
         "regionalBlocs":[

         ],
         "cioc":"JPN"
      }
   ]
}

404

{
  "code":-8,
  "message":"Endpoint not found."
}

500

{
   "code": -23,
   "message": "Something went wrong to countries service."
}

400

{
   "code": -24,
   "message": "Missing query parameter."
}
/language
Implementation Notes

Gets the countries that uses the specified language.

Parameters
Parameter Data Type Necessity Location Description
code string required query ISO 639-1 language code. C e.g.(code=ja)
Sample Request
curl --request GET \currency
  --url 'https://gateway.qymera.tech/qymera/sb/countries/v1/language?code=ja' \
  --header 'accept: application/json' \
  --header 'x-ibm-client-id: REPLACE_THIS_VALUE' \
  --header 'x-ibm-client-secret: REPLACE_THIS_VALUE'
Request

GET

https://gateway.qymera.tech/qymera/sb/countries/v1/language?code=ja

Response

200

{
   "message":"Success.",
   "data":[
      {
         "name":"Japan",
         "topLevelDomain":[
            ".jp"
         ],
         "alpha2Code":"JP",
         "alpha3Code":"JPN",
         "callingCodes":[
            "81"
         ],
         "capital":"Tokyo",
         "altSpellings":[
            "JP",
            "Nippon",
            "Nihon"
         ],
         "region":"Asia",
         "subregion":"Eastern Asia",
         "population":126960000,
         "latlng":[
            36,
            138
         ],
         "demonym":"Japanese",
         "area":377930,
         "gini":38.1,
         "timezones":[
            "UTC+09:00"
         ],
         "borders":[

         ],
         "nativeName":"日本",
         "numericCode":"392",
         "currencies":[
            {
               "code":"JPY",
               "name":"Japanese yen",
               "symbol":"¥"
            }
         ],
         "languages":[
            {
               "iso639_1":"ja",
               "iso639_2":"jpn",
               "name":"Japanese",
               "nativeName":"日本語 (にほんご)"
            }
         ],
         "translations":{
            "de":"Japan",
            "es":"Japón",
            "fr":"Japon",
            "ja":"日本",
            "it":"Giappone",
            "br":"Japão",
            "pt":"Japão",
            "nl":"Japan",
            "hr":"Japan",
            "fa":"ژاپن"
         },
         "flag":"https://restcountries.eu/data/jpn.svg",
         "regionalBlocs":[

         ],
         "cioc":"JPN"
      }
   ]
}

404

{
  "code":-8,
  "message":"Endpoint not found."
}

500

{
   "code": -23,
   "message": "Something went wrong to countries service."
}

400

{
   "code": -24,
   "message": "Missing query parameter."
}