# Country Flags API

> Country Flags is a country flag API that fetches direct download URLs for national flag images using two-letter ISO country codes. Responses return the country name, ISO code, and image link, while paid plans can select SVG or PNG formats and shapes.

**Endpoint:** `GET https://api.apiverve.com/v1/countryflags`  
**Category:** Geography  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/countryflags

## Overview

Send a two-letter ISO country code to retrieve the country name and a direct download link for its national flag image. Paid plans can specify the image format as SVG or PNG, and pick a shape: rectangle (the flag in its official proportions), square (a 1:1 icon) or circle (a round 1:1 icon). The Free plan returns the rectangle PNG, and flags cover every current ISO country code, including territories such as Jersey, Guernsey, Puerto Rico and Kosovo.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/countryflags?country=ZW&format=png&shape=circle" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | string | Yes | The country: a 2 or 3 letter ISO code (e.g. ZW or ZWE; UK is read as GB) or an English name (e.g. Zimbabwe). length 2-60 |
| `format` | string | No | The format of the flag image. Optional; defaults to png.. One of: png, svg. Premium field |
| `shape` | string | No | The shape of the flag image: rectangle (official proportions), square (1:1 icon) or circle (round 1:1 icon). Optional; defaults to rectangle.. One of: rectangle, square, circle. Premium field |

## Response fields

- `country` — string · Full name of the country
- `countryCode` — string · 2-letter ISO country code for the nation
- `shape` — string · Shape format of returned flag image
- `format` — string · Image file format of returned flag
- `downloadUrl` — string · Direct download URL for country flag image

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "country": "Zimbabwe",
    "countryCode": "ZW",
    "shape": "circle",
    "format": "png",
    "downloadUrl": "https://storage.googleapis.com/apiverve/APIResources/countryflags/circle/png/zw.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766096512&Signature=EfbtYmSr82YpFvV%2FYWRrlA66wKW4j2%2F2n6EDLGnpwhxd9pXvzBQm4xhNVnwRy3tHCvDTWNQTQUaP9kndqcqm5NBlsfzgJlHpBLPLNt3xRBgXwAm5vmPMfoQY%2B%2BHwmYkxBH1H%2BnIkoWeXEsDLoh1MdwUfvTKKP9PDlCyc2FQUJyZoqXxdshHE9l%2Fv019N9z3AipL7jpmeJQnMTDtos8aCa2I9dm%2FzgpMvi2fdMiRfMCNsjlbyug0h0w6wO1W3FLc3K477psnT4BcXARBmn3dYq4hSSLdmhPnKMpCrYXFnhdxZq0VHXNHid1FwLYuMcp%2FPHIJ1%2Fj2OvqMUPEpip%2Fq%2FpA%3D%3D"
  }
}
```

## Use cases

- **Checkout Shipping Selectors** — Display buyer country flags next to currency dropdowns during checkout using ISO codes detected from shipping addresses.
- **Multi-Currency Wallet Views** — Fintech dashboards pair foreign balances with national flags when users switch between international account views.
- **User Profile Personalization** — To enrich community forums, social platforms fetch flag icons based on member nationality settings to display badges on profile headers.
- **Global Flight Search** — When presenting international itineraries, travel booking engines embed flag graphics next to departure and arrival country codes.

## SDKs

- **npm** — `npm install @apiverve/countryflags` (https://www.npmjs.com/package/@apiverve/countryflags)
- **PyPI** — `pip install apiverve-countryflags` (https://pypi.org/project/apiverve-countryflags/)
- **NuGet** — `dotnet add package APIVerve.API.CountryFlags` (https://www.nuget.org/packages/APIVerve.API.CountryFlags)
- **Source** — https://github.com/apiverve/countryflags-api

## More

- Full reference: https://docs.apiverve.com/ref/countryflags
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
