REST Countries API
Overview
REST Countries is a free API that provides detailed information about every country in the world, including population, capital, currencies, languages, flags, and bordering countries. No API key is needed, and you can filter results by country name, code, region, or language. It is one of the most beginner-friendly and practical geography APIs available.
Beginner Tip
Use the /name/{country} endpoint for easy lookups by name, and add ?fields=name,capital,population to limit the response to only the fields you need, keeping responses fast and clean.
Available Data
Example Response
{
"name": "Japan",
"capital": "Tokyo",
"population": 125800000,
"region": "Asia",
"languages": [
"Japanese"
],
"flag": "https://flagcdn.com/jp.svg",
"currencies": [
{
"code": "JPY",
"name": "Japanese yen"
}
]
} Field Reference
name Country name with common and official variants, plus native language names. capital List of capital city names (some countries have multiple capitals). population Total population of the country. region Broad geographic region such as Asia, Europe, or Africa. currencies Object keyed by ISO currency code with name and symbol for each currency. flags URLs to the country flag image in PNG and SVG formats. Implementation Example
const url = "https://restcountries.com/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →administrative-divisons-db
⭐ Beginner's PickThe Administrative Divisions DB API provides a structured list of all administrative divisions (states, provinces, regions, cities) for countries around the world.
adresse.data.gouv.fr
adresse.data.gouv.fr provides programmatic access to address database of france, geocoding and reverse via REST API.
Airtel IP
⭐ Beginner's PickAirtel IP is a free, no-auth IP geolocation API that aggregates data from multiple sources to return the country associated with any given IP address.
bng2latlong
⭐ Beginner's Pickbng2latlong is a simple, free API that converts British National Grid (OSGB36) easting and northing coordinates into standard WGS84 latitude and longitude.
Cartes.io
⭐ Beginner's PickCartes.io is a free API that lets you create maps and add custom markers without signing up.