Free country API: no key, no rate limit
A free JSON API for all 250 countries and territories: flag, capital, currency, calling code, ISO 3166-1 codes, languages, land borders, area and population, plus a public-domain SVG flag for every one. No API key, no rate limit, no sign up, no account. The endpoints are static files on a CDN, CORS is open to any origin, and the data is licensed for commercial use.
GET https://flagdex.net/api/v1/country/fr.json works right now, from anywhere, with no headers.
How it compares
The obvious alternatives, checked on 5 August 2026. Each row states what that service itself documents; follow the links and verify before you commit to one.
| Service | API key | Rate limit | Commercial use, free tier | Data licence |
|---|---|---|---|---|
| Flagdex | None | None | Yes | ODbL 1.0 and CC BY 4.0 |
| restcountries.com | Required, bearer token | Tiered, by plan | Depends on plan | Not stated on the homepage |
| countries.dev | None | Not documented | Yes | CC BY 4.0, GeoNames |
| api-ninjas.com | Required, header | Monthly quota by plan | No, paid plan required | Not stated |
Flagdex is not trying to be the richest country API. It is a static reference site that publishes the dataset it runs on. If you need cities, postal codes or IP geolocation, one of the others is the better fit.
Endpoints
All endpoints are plain JSON files served over HTTPS from https://flagdex.net. The versioned paths are the ones to build on.
All countries (full)
GET /api/v1/countries.json
Dataset metadata plus an array of every country with all fields.
All countries (lite)
GET /api/v1/countries-lite.json
A compact array with name, ISO codes, capital, region and flag. Small and fast, which is what an autocomplete or a dropdown needs.
A single country
GET /api/v1/country/{iso2}.jsonOne country by its lowercase ISO 3166-1 alpha-2 code, for example /api/v1/country/fr.json or /api/v1/country/jp.json.
Metadata
GET /api/v1/meta.json
Dataset vintage, the endpoint list, the licence and the stability policy.
Flags
GET /flags/{iso2}.svg
e.g. https://flagdex.net/flags/fr.svgA public-domain SVG per country, with CORS open, so you can use it inside your own application and not only in an img tag.
OpenAPI
A machine-readable description lives at /openapi.json, so the API can be loaded into tooling or listed in a directory without anyone hand-writing a spec.
Versioning and stability
/api/v1/ is the stable namespace. Fields present in v1 are never removed or retyped within v1; new fields may be added. A breaking change would ship as /api/v2/ and the v1 paths would keep working. The unversioned paths (/api/countries.json and the rest) still work and will keep working, but pin to v1 for anything you care about.
The dataset is rebuilt periodically. The current vintage is 2026-07-02, and meta.json always states it. Responses carry a long Cache-Control, so cache them rather than refetching.
Example response
GET /api/v1/country/fr.json
{
"iso2": "FR",
"iso3": "FRA",
"name": "France",
"officialName": "French Republic",
"capital": ["Paris"],
"region": "Europe",
"currencies": [{ "code": "EUR", "name": "Euro", "symbol": "\u20ac" }],
"callingCodes": ["+33"],
"flagEmoji": "\ud83c\uddeb\ud83c\uddf7",
"population": 68720337
}Quick start
const res = await fetch("https://flagdex.net/api/v1/country/br.json");
const brazil = await res.json();
console.log(brazil.capital[0]); // "Brasilia"curl -s https://flagdex.net/api/v1/country/br.json | jq .capital
import requests
data = requests.get("https://flagdex.net/api/v1/countries-lite.json").json()
by_iso = {c["iso2"]: c for c in data}
print(by_iso["BR"]["capital"])import { useEffect, useState } from "react";
export function CountrySelect({ value, onChange }) {
const [countries, setCountries] = useState([]);
useEffect(() => {
fetch("https://flagdex.net/api/v1/countries-lite.json")
.then((r) => r.json())
.then((list) => setCountries(list.sort((a, b) => a.name.localeCompare(b.name))));
}, []);
return (
<select value={value} onChange={(e) => onChange(e.target.value)}>
{countries.map((c) => (
<option key={c.iso2} value={c.iso2}>
{c.flagEmoji} {c.name}
</option>
))}
</select>
);
}Common use cases
- A country dropdown with flags.
countries-lite.jsoncarries the emoji and the SVG path, so you need no icon library. - A dialling-code selector. Read
callingCodesfrom the full dataset and sort by country name. - An ISO code validator. Build a set from
iso2andiso3in the lite file and check against it offline. - A currency dropdown. Take the distinct
currencies[].codevalues from the full dataset. - A quiz or geography game. The lite file plus
/flags/{iso2}.svgis everything you need, and small enough to ship inside the app.
Licence and attribution
Base country data comes from the mledoze/countries dataset under the Open Database License 1.0. Population figures come from the World Bank under CC BY 4.0. The flag SVGs are public domain. Both licences permit commercial use and both require attribution, so here is a snippet you can paste as it stands:
<a href="https://flagdex.net">Country data from Flagdex</a> (ODbL 1.0, CC BY 4.0)
Country data from Flagdex (https://flagdex.net), ODbL 1.0 and CC BY 4.0.
Attribution is a condition of the underlying licences, not a favour to us. Full sources and vintage are on the data page.
Frequently asked questions
Do I need an API key?
Is there a rate limit?
Can I use it from the browser?
Can I use it commercially?
Will the response shape change?
Who builds this
Flagdex is built and maintained by FusionStudios. We build fast, privacy-first web tools, with no ads and no tracking. If you need something similar, get in touch.
The API serves the same dataset the site itself is built on, so anything you read on a country page is in the JSON. Full sources and vintage on the data page. Last updated . Report a correction.