An Overview of the REST Countries API
Get introduced to the REST Countries API, and learn about its uses.
We'll cover the following
In today’s world, where businesses are expanding globally, information is critical. A country’s information is beneficial not only for companies but also for tourists. Developers can empower their clients by creating applications and websites that provide their target audience with the information they require. This goal can be accomplished with the help of the REST Countries API.
What is the REST Countries API?
The REST Countries API is a basic REST API that delivers information about the countries in JSON format. Each country’s data offers essential information, such as the capital city, population, languages, currencies, regions, and country code.
Uses of the REST Countries API
Using the REST Countries API, we can:
- Develop registration or sign-up forms, and display currencies for hotel booking websites and payment applications.
- Create an application for shipping companies, which need a lot of information about countries they ship to.
- Create a database of countries’ information that is searchable anytime.
Response of the REST Countries API
When we call an endpoint of the REST Countries API, it returns a JSON response with information about a country. Some endpoints return information about a single country, while others return a list of information about multiple countries.
The following table shows the information we can get about a country.
Response Fields
Field | Type | Description |
| Object | The name of the country |
| String | The top level domain of the country |
| String | The two-letter country code that the International Organization for Standardization (ISO) assigned to identify the country |
| Integer | The three-digit country code that the International Organization for Standardization (ISO) assigned to identify the country |
| String | The three-letter country code that the International Organization for Standardization (ISO) assigned to identify the country |
| String | The three-letter country code that the International Olympic Committee (IOC) assigned to identify the country |
| Boolean | Indicates whether or not the country is independent |
| String | The assignment status of the country |
| Boolean | Indicates whether or not the country is a member of the United Nations |
| Object | The information about the currency of the country |
| Object | Contains information about international direct dialing for the country |
| String | The capital city of the country |
| String | The alternative spellings of the country's name |
| String | The region in which the country is situated |
| String | The subregion in which the country is situated |
| Object | A list of official languages of the country |
| Object | A list of the country's name written in different languages |
| Float | The latitude and longitude of the country |
| Boolean | Indicates whether or not the country has a coastline or direct access to a major body of water, such as an ocean or sea |
| String | A list of countries that are connected to the country through borders |
| Float | The area of the country in square kilometers |
| String | The origin of the people of the country |
| String | Unicode string for the emoji of the flag of the country |
| String | Contains links to the country's OpenStreetMap and Google Maps |
| Integer | The population of the country |
| Object | The gini ratio of the country, which is a measure of economic inequality in a country |
| String | The FIFA code for the country |
| Object | Contains information about the traffic signs and the drive side for the country |
| String | The time zone of the country |
| String | The continent in which the country is situated |
| Object | A link to an image of the country’s flag |
| Object | A link to an image of the country’s coat of arms |
| String | The day when the week starts in the country |
| Object | The latitude and longitude of the capital city of the country |
| Object | The format of the postal code of the country |