Country data. One API.
Flags, phone prefixes, currencies, languages. Free. Fast. No auth.
Quick start
GET /api/countries/itTry it
Search any country to see the API response.
Endpoints
GET
/api/countriesGet all countries. Supports ?search= query.
Example: /api/countries?search=italyGET
/api/countries/[code]Get a single country by ISO code (case-insensitive).
Example: /api/countries/itGET
/api/flags/[code]Redirects to the flag image on flagcdn.com.
Example: /api/flags/itGET
/api/prefixes/[code]Get the phone prefix for a country.
Example: /api/prefixes/itResponse format
{
"code": "IT",
"name": "Italy",
"phonePrefix": "+39",
"flag": "🇮🇹",
"flagUrl": "https://flagcdn.com/w320/it.png",
"currency": "EUR",
"language": "Italian",
"continent": "Europe"
}Code examples
curl
curl https://flags.ochiwa.com/api/countries/it
curl https://flags.ochiwa.com/api/countries?search=germany
curl -L https://flags.ochiwa.com/api/flags/jpJavaScript
const res = await fetch('https://flags.ochiwa.com/api/countries/it');
const country = await res.json();
console.log(country.phonePrefix); // "+39"Python
import requests
r = requests.get('https://flags.ochiwa.com/api/countries/it')
country = r.json()
print(country['phonePrefix']) # "+39"Simple Pricing
Popular
Pro
$5 /month
- 50,000 requests/day
- 300 requests/min
- All endpoints
- API key auth
- Priority support