Loading
Loading
Our Flags API provides access to country flags and international organization flags in multiple formats, shapes, and sizes. Retrieve flag images in PNG, WEBP, or SVG format, choose between flat or round flag styles, select from five size options ranging from 16px to 64px, and specify whether you need a country flag or an organization flag.
Our Country Flags API eliminates the need to host, maintain, or manually update a flag image library by giving you instant access to a complete, up-to-date collection of country flags and world organization flags. Use it across country selectors, international dashboards, fintech products, language switchers, and any interface that needs accurate, well-formatted flag icons to represent countries and organizations visually.
Request any country flag using its ISO 3166-1 alpha-2 country code. Get a clean, properly formatted flag image ready to display in any interface without any additional processing.
Beyond country flags, the API also supports flags for international organizations. Retrieve the organization flag by setting the type parameter to organization.
Request flag images in png, webp, or svg format. PNG and WEBP are suitable for standard image rendering while SVG delivers resolution-independent vector flags ideal for high-density displays and scalable interfaces.
Choose between flat rectangular flags and round flag icons using the shape parameter. Round flags are commonly used in profile interfaces, country selectors, and mobile applications while flat flags suit dashboards, tables, and data-heavy layouts.
Flag images are available in five sizes — 16px, 24px, 32px, 48px, and 64px — applicable to PNG and WEBP formats. Pick the size that fits your UI without needing to resize or optimize images on your end.
Retrieve a complete list of all supported country and organization flags with their name, ISO alpha-2, and ISO alpha-3 codes. No parameters are required.
$ pip install requestsimport requests
url = "https://api.apifreaks.com/v1.0/flags/supported"
payload = {}
headers = {
'X-apiKey': 'API-KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Retrieve a flag image for a specified country or organization. Pass the ISO country code, shape, type, and optionally format and size to get a flag in your preferred style and dimensions.
$ pip install requestsimport requests
url = "https://api.apifreaks.com/v1.0/flags?name=PK&type=country&shape=flat&size=32px&format=png"
payload = {}
headers = {
'X-apiKey': 'API-KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Retrieve a complete list of all supported country and organization flags along with their name, ISO alpha-2, and ISO alpha-3 codes.
# Response { "supported_countries": [ { "name": "Luxembourg", "iso2": "LU", "iso3": "LUX" }, { "name": "Suriname", "iso2": "SR", "iso3": "SUR" }, { "name": "Tunisia", "iso2": "TN", "iso3": "TUN" }, { "name": "Colombia", "iso2": "CO", "iso3": "COL" }, { "name": "Pakistan", "iso2": "PK", "iso3": "PAK" } ], "supported_organizations": [ "Commonwealth_of_Independent_States", "Gulf_Cooperation_Council", "Arab_League", "Organization_of_American_States", "African_Union", "European_Union", "United_Nations", "NATO", "Association_of_Southeast_Asian_Nations", "Commonwealth_of_Nations" ] }curl "https://api.apifreaks.com/v1.0/flags/supported?apiKey=YOUR_API_KEY"
Retrieve a flag image by providing the country code, shape, format, size, and type. The API returns binary image data in the specified format.
# Response: binary PNG image data # Save the output to a file using --output flag # Content-Type: image/pngcurl "https://api.apifreaks.com/v1.0/flags?apiKey=YOUR_API_KEY&name=PK&type=country&shape=flat&size=32px&format=png" --output pk-flag.png
type parameter to organization in your request. Use the Supported Flags endpoint first to get a complete list of all supported organizations and their identifiers before making individual flag requests.To use the Flags API, you will need API credits. We only charge for successful queries, defined by a 2xx status code. If your request results in a 4xx or 5xx status code, no credits will be charged, and any deducted credits will be returned.
For each successful request, 1 credit will be charged.
Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.