A country flags API (emoji and SVG)

Get a country's flag as a Unicode emoji or an SVG/PNG image from its ISO code — no key, no sprite sheets, no hard-coded asset list.

Back

You need a flag next to a country name. Two ways to get one, depending on whether you want text or an image.

Flag emoji (no requests)

Every country comes with a Unicode flag:

curl https://countries.dev/alpha/FR
{ "name": "France", "alpha2Code": "FR", "flag": "🇫🇷",
  "flags": { "svg": "https://upload.wikimedia.org/.../Flag_of_France.svg", "png": "https://.../France.png" } }

The emoji is plain text — no image request, no sprite sheet, and it scales with the surrounding font:

<span>🇫🇷 France</span>

One catch: Windows still renders flag emoji as the two-letter code, not a flag. If a chunk of your users are on Windows, use the image instead.

Flag image (SVG/PNG)

When you want a real rendered flag, or consistency across every platform, use the flags URLs from the response:

img.src = country.flags.svg; // or .png
img.alt = country.name;

All of them at once

Building a list or a picker? Ask for just the flag fields:

curl "https://countries.dev/countries?fields=name,alpha2Code,flag,flags"

Country data docs →

Written by

Dov Azencot

At

Tue Jun 23 2026