Loading
Loading
Retrieve country and international organization flag images in PNG, WEBP, or SVG format with flat or round shapes in five size options.
Returns a binary flag image. The name, type, and shape parameters are required.
Authorize every request with your API key, passed either as a header or as a query parameter:
X-apiKeyapiKeyThis is version v1.0 of the API.
The name, type, and shape parameters are required. format and size are optional.
namerequiredStringCountry code in ISO 3166-1 alpha-2 format for country flags, or organization identifier for organization flags. Example: US, GB, PK.
typerequiredStringType of flag to retrieve. Available values: country, organization.
shaperequiredStringShape of the flag image. Available values: flat, round.
formatoptionalStringdefault: pngImage format. Available values: png, webp, svg.
sizeoptionalStringdefault: 64pxSize of the flag image in pixels. Available values: 16px, 24px, 32px, 48px, 64px. Applicable to PNG and WEBP formats only.
A successful request returns a 200 OK response with binary image data. The Content-Type header reflects the requested format (image/png, image/webp, or image/svg+xml).
(binary)The flag image returned as binary data in the specified format (PNG, WEBP, or SVG). The Content-Type header reflects the format (image/png, image/webp, image/svg+xml).
Besides the response body, every response carries custom headers you can use to track credit usage, and concurrency usage on endpoints that enforce a concurrency limit. See the Custom Response Headers documentation and the endpoints with concurrency limits for more details.
X-Concurrent-Threadsheaderconcurrency-limited endpointsSpecifies the maximum number of concurrent requests allowed.
X-Concurrent-Threads-Activeheaderconcurrency-limited endpointsIndicates the number of active concurrent requests being processed.
X-AF-Credits-Costheaderall responsesSpecifies the number of credits consumed by the current request.
See the HTTP Status Codes documentation for a complete reference of common API errors and HTTP status codes.
Invalid country name or code.