Country data. One API.

Flags, phone prefixes, currencies, languages. Free. Fast. No auth.

Quick start

GET /api/countries/it

Try it

Search any country to see the API response.

Endpoints

GET/api/countries

Get all countries. Supports ?search= query.

Example: /api/countries?search=italy
GET/api/countries/[code]

Get a single country by ISO code (case-insensitive).

Example: /api/countries/it
GET/api/flags/[code]

Redirects to the flag image on flagcdn.com.

Example: /api/flags/it
GET/api/prefixes/[code]

Get the phone prefix for a country.

Example: /api/prefixes/it

Response 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/jp
JavaScript
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

Free

$0 forever

  • 1,000 requests/day
  • 60 requests/min
  • All endpoints
  • No auth required
Get started
Popular

Pro

$5 /month

  • 50,000 requests/day
  • 300 requests/min
  • All endpoints
  • API key auth
  • Priority support