Skip to content
GET /v1/flag

Flag by country or code

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/flags-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/flags-api/v1/flag" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/flags-api/v1/flag", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/flags-api/v1/flag");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/flags-api/v1/flag",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "flag": {
            "code": "DE",
            "emoji": "🇩🇪",
            "country": "Germany FRG",
            "image_png": "https://flagcdn.com/w320/de.png",
            "image_svg": "https://flagcdn.com/de.svg",
            "attributes": {
                "bars": 0,
                "icon": false,
                "text": false,
                "stars": 0,
                "colors": [
                    "red",
                    "gold",
                    "black"
                ],
                "animate": false,
                "circles": 0,
                "colours": 3,
                "crosses": 0,
                "mainhue": "black",
                "stripes": 3,
                "topleft": "black",
                "botright": "gold",
                "crescent": false,
                "quarters": 0,
                "saltires": 0,
                "triangle": false
            }
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:10.023Z",
        "request_id": "03c7c2ed-902f-4aca-8a63-1bca8936ff78"
    },
    "status": "ok",
    "message": "Flag retrieved successfully",
    "success": true
}