REST Countries websites provides a free country information API to get details of any country. Just like any other REST API, here you can get some most common type of country information in JSON format. It can return country information like country symbol, population, area, language, currency, top-level domain, time zone, sub region, native name, numeric code, ISD code, capital, latitude, longitude, and some others. You can get all this data in a JSON array and then use that anywhere you like. You can easily integrate this API your desktop and mobile applications. If you want then you can use some JSON to CSV converters to get the data in tabular format.
If you are a developer and for some reasons you need a country information API then the one I have mentioned here will help you. Here you only have to make a simple request to the specified end pint and get the response. There are some filters that you can apply in the API call and you can learn about them in the API docks. Not only this but this API comes implemented in some popular programming languages such as Node.js, Python, C#, and some others. The links to the API libraries are given on its homepage.
Using this Free Country Information API to Get Details of any Country:
Using this API is very simple as you can use it from the command line or you can use the browser. Just make a simple API request and then get the data. The best part is that for now, there is no API key needed in order to fetch the response. Construct the AOI URL and then either cURL it or paste in the browser. Next, you just save the JSON response and then do whatever you want.
There are two main methods to use this API. Here you can either query a country by its full name or partial name. This is helpful because in some cases, you don’t know the full name of a country. The basic syntax of querying about a country is given below.
To query a country by its partial name, you use this syntax:
Syntax: https://restcountries.eu/rest/v2/name/CountryNamePartia
Example: https://restcountries.eu/rest/v2/name/eesti
To query a country by its full name, you can use this syntax:
Syntax: https://restcountries.eu/rest/v2/name/CountryName?fullText=true
Example: https://restcountries.eu/rest/v2/name/aruba?fullText=true
In the above screenshots, you can see how this API works to fetch you data about any country you want. You can query about any country and get the data to use that anywhere you like. The process of making API calls is very simple and you will like it. The syntax of the API is very simple as well and you will be able to implement it in any programming languages you are proficient in.
Closing thoughts
If you are looking for a free API to get information about any country in the word then you have come to the right place. REST Countries is very nice, simple and straightforward API that you can use. The basic usage I have explained i this post and you can go through the docs for the detailed usage which are available on its homepage.