A list of countries with url links to a svg image which you can simply use in your web application
$ npm install country-flags-svg
or
$ yarn add country-flags-svg
import { findFlagUrlByNationality } from "country-flags-svg";
const flagUrl = findFlagUrlByNationality("Australian");
// => "http://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%28converted%29.svg"
import { countries } from "country-flags-svg";
const australia = countries[0];
console.log(australia);
/* => {
name: "Australia",
demonym: "Australian",
flag: "http://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%28converted%29.svg",
iso2: "AU",
iso3: "AUS",
}
*/
Returns all available information.
Returns SVG link of the official flag for a specified country (according to countryName) or empty string if is not exist
Returns SVG link of the official flag for a specified country (according to nationality) or empty string if is not exist
Returns SVG link of the official flag for a specified country (according to ISO 3166-1 alpha-2 code) or empty string if is not exist
Returns SVG link of the official flag for a specified country (according to ISO 3166-1 alpha-3 code) or empty string if is not exist
Licensed under MIT.