stefangabos / world_countries

Constantly updated lists of world countries and their associated alpha-2, alpha-3 and numeric country codes as defined by the ISO 3166 standard, available in CSV, JSON , PHP, SQL and XML formats, in multiple languages and with national flags included; also available are the ISO 3166-2 codes of provinces/ states associated with the countries
http://stefangabos.github.io/world_countries/
Other
1.34k stars 374 forks source link

JSON with data URI flags #41

Closed rolandtoth closed 2 years ago

rolandtoth commented 3 years ago

Many thanks for this stuff, it came really handy to me.

It would be nice if you could provide a JSON file that would contain flags as data URI strings, or perhaps just an additional JSON with alpha2 + data URI properties. This way they could be downloaded in one request instead of many. For example, in a current project we needed a country dropdown with flags and that would mean 193 individual image request.

image

I manually created such JSON in a web controller and added to a cache, but an "official" version would be nice.

stefangabos commented 3 years ago

can you please send me that JSON you created, so I can use it as a starting point? thanks!

rolandtoth commented 3 years ago

Hi,

actually I just finished writing a crawler that gets country data from these places:

https://restcountries.eu/rest/v2/all https://www.countryflags.io/

I need multilanguage country names so I think I'll use the country codes and lookup localized values.

countries.json.txt

stefangabos commented 3 years ago

awesome, thank you!

rolandtoth commented 3 years ago

Btw I could do several JSON files like this per language, but that would be too large.

stefangabos commented 2 years ago

This is now available since 2.3.0 I'd love some feedback if that's possible. Thanks!

rolandtoth commented 2 years ago

Hi,

many thanks for the update, unfortunately I'm not working on any project where I can could this. But will definitely try this out when there'll be one.