Jump to content

Countries list


SiNNuT
 Share

Recommended Posts

- Not sure where to post this-

I just made a country list and i thought it might be useful to someone so i put it on github. You could use this for example with the importpagescsv module to easily create country pages for use in your site, forms etc. For now it's English only ( i could add other languages if someone needed it)


README.md

About

This is a complete ISO 3166-1 encoding list. It is listed in alphabetical order by the English short country name used by the ISO 3166/MA. There are currently 249 ISO 3166-1 countries. England, Northern-Ireland, Scotland and Wales are added to that because they are used by FIFA. It also contains the corresponding IOC and FIFA three letter codes and the filenames of the country flag image(s).

  • Total countries: 253
  • Fileformat: txt file separated bij tabs

Data is taken from:

http://en.wikipedia....wiki/ISO_3166-1

and

http://en.wikipedia....6_country_codes

Flag icons

I included the flag icons from http://icondrawer.com/free.php

See the link for details and terms of use.

You can also get the flags in a wide range of sizes and flavors from this awesome project:

https://github.com/koppi/iso-country-flags-svg-collection

For the least amount of hassle: https://github.com/koppi/iso-country-flags-svg-collection#download-the-icon-sets

  • Like 6
Link to comment
Share on other sites

I love everything about this post but also wanted to say I'd not seen such lovely icons for flags in different sizes before as the ones you've linked to at icondrawer - nice! :D

Link to comment
Share on other sites

The README contents in the topicstart are outdated. I've added Dutch country names to the list. For future reference check out the github page because i'm not gonna keep the topicstart up to date.

@Pete I also love the icondrawer flags but there are some restrictions to it's use if you honor their wishes (i.e. put a link on a site)

The other flags i mentioned are pretty neat as well and are unrestricted as far as i can tell.

Link to comment
Share on other sites

  • 1 year later...
  • 6 years later...

Just stumbled across this old thread. I found a very good source for a well maintained world countries list!

Available in multiple languages, in CSV, JSON and SQL formats, with associated alpha-2, alpha-3, and numeric codes as defined by the ISO 3166 standard, and with national flags included:

http://stefangabos.github.io/world_countries/

  • Like 5
Link to comment
Share on other sites

Thing about country info is that it changes all the time.

I find https://www.geonames.org/export/ws-overview.html a good resource for getting up-to-date country information. They have a JSON and an XML API. And the country info also available as CSV.
You can query for all countries JSON with http://api.geonames.org/countryInfoJSON?formatted=true&username=gebeer&style=full (note my username. You'd have to create your own)

I used this on a custom address field type that pulls in location data in real time while filling in an address https://github.com/gebeer/FieldtypeAddressGeonames 
Developed it for a course directory site where 1000+ users login from all over the world, to make sure the address info is as uniform as possible.

  • Like 2
Link to comment
Share on other sites

1 hour ago, gebeer said:

Thing about country info is that it changes all the time.

I find https://www.geonames.org/export/ws-overview.html a good resource for getting up-to-date country information. They have a JSON and an XML API. And the country info also available as CSV.
You can query for all countries JSON with http://api.geonames.org/countryInfoJSON?formatted=true&username=gebeer&style=full (note my username. You'd have to create your own)

I used this on a custom address field type that pulls in location data in real time while filling in an address https://github.com/gebeer/FieldtypeAddressGeonames 
Developed it for a course directory site where 1000+ users login from all over the world, to make sure the address info is as uniform as possible.

Thank you for your input! Seems to be a nice resource so far!

BTW - geonames.org site seem to be 20 years old. They use tables for layout...
And I can't find information about how how up-to-date the data is.

Link to comment
Share on other sites

10 minutes ago, Gadgetto said:

Do you know, if they have also pre-translated sources?

Yes, they do. You can pass a lang parameter to your query to get results in a specific language. Just tested this with Russian http://api.geonames.org/countryInfoJSON?formatted=true&lang=ru&username=gebeer&style=full

Information on the webservices they offer: http://www.geonames.org/export/web-services.html

Documentation is a bit sparse...

Link to comment
Share on other sites

Oh, I just see, that you need an account to get geonames. No public API. So this isn't suitable for my SnipWire plugin.

Edit:

And I just found the limits:

  • 20'000 credits daily limit per application (identified by the parameter 'username'), the hourly limit is 1000 credits. A credit is a web service request hit for most services. An exception is thrown when the limit is exceeded.
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...