The Country Flags API

Need to display country flags in your web app?

Use this image API to make it a breeze!

Features

  • Support for many formats (us, en_US, en-US, en, etc.)
  • HTTPS enabled
  • Different image sizes

Usage

Simply use the API as an image in HTML. This will return a PNG image, ready to be embedded in your web app.
<img src="https://flags.swcdn.org/small/en_US">

The URL should always be structured like this:
https://flags.swcdn.org/{size}/{country_code}
Replace size with either tiny, small, or large to determine the image size. Then, include your country code at country_code.

Credits

This service uses flag images from flagpedia.net.

It was developed by Sebastian Walker, because he needed something like this for one of his own projects and couldn't find something similar.

You can find the source code of this site on Github.