Flag Feed API Documentation

Simple REST API for serving high-quality circled flag images of countries worldwide

Overview

Flag Feed provides a simple and reliable way to access high-quality PNG flag images for countries around the world. All flags are served via REST endpoints using standard ISO 3166-1 alpha-2 country codes.

Key Features

  • • High-quality circled flag images
  • • PNG format for optimal web performance
  • • ISO 3166-1 alpha-2 country code support
  • • CDN caching for fast delivery

Base URL

https://flagfeed.com

Endpoints

GET /flags/{country-code}

Returns a high-quality PNG flag image for the specified country code.

Parameters

  • country-code (path): 2-letter ISO 3166-1 alpha-2 country code (lowercase)

Examples

curl https://flagfeed.com/flags/us
curl https://flagfeed.com/flags/gb
curl https://flagfeed.com/flags/jp

Response

  • Content-Type: image/png
  • X-Country-Code: Country code in uppercase

GET /api/info

Returns information about the API including version and available endpoints.

Example Response

{
  "name": "Flag Feed API",
  "version": "1.0.0",
  "description": "Simple REST API for world flag images",
  "endpoints": {
    "GET /flags/{country-code}": "Returns PNG flag image for the specified ISO 3166-1 alpha-2 country code"
  }
}

GET /health

Health check endpoint to verify API availability.

Example Response

{
  "status": "ok",
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Country Codes

Flag Feed uses ISO 3166-1 alpha-2 country codes. These are two-letter codes that uniquely identify countries and dependent territories.

Note: Country codes must be lowercase (e.g., "us", "gb", "jp").

Popular Examples

US Flag
us
United States
GB Flag
gb
United Kingdom
JP Flag
jp
Japan
DE Flag
de
Germany

View all supported countries →

Error Responses

400 Bad Request

Invalid country code format

{
  "error": "Invalid country code. Please use 2-letter ISO country codes (e.g., 'us', 'gb', 'fr')"
}

404 Not Found

Flag not available for country code

{
  "error": "Flag not found for country code: XX",
  "message": "This flag is not available in our database yet."
}

Usage Examples

HTML <img> Tag

<img src="https://flagfeed.com/flags/us"
     alt="United States Flag"
     width="64" height="64">

JavaScript Fetch

fetch('https://flagfeed.com/flags/us')
  .then(response => response.blob())
  .then(blob => {
    const img = document.createElement('img');
    img.src = URL.createObjectURL(blob);
    document.body.appendChild(img);
  });

React Component

function CountryFlag({ countryCode }) {
  return (
    <img
      src={`https://flagfeed.com/flags/${countryCode}`}
      alt={`${countryCode.toUpperCase()} Flag`}
      width={64}
      height={64}
    />
  );
}

Rate Limits

Reasonable rate limits apply to prevent abuse.

Support

Need help or have questions about the Flag Feed API?

API Status All Countries
☝️