9

I was just wondering if anyone knew of a source of standard ISO data in xml format, such as ISO 3166 (Country codes/names), ISO 4217 (Currency Codes) or ISO 639 (Languages)?

If it was in any way 'official' and maintained with any changes to the standards that would be great!

UPDATE: I can't use files with non-commercial use restrictions.

UPDATE 2: Please, if you feel it necessary to vote this down, or vote it closed as a dupe, point me in the direction of the existing question with a suitable answer.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
UpTheCreek
  • 31,444
  • 34
  • 152
  • 221
  • one of many: http://stackoverflow.com/questions/463459/does-there-exist-a-publicly-accessible-parsable-country-country-code-list – Mitch Wheat Sep 20 '09 at 10:40
  • 1
    Not really a dupe of 463459 - I looked there but no answers were quite what I was looking for. – UpTheCreek Sep 20 '09 at 11:11
  • Since ISO codes are maintained by the ISO, I would think this was quite easy to find... – Wim ten Brink Sep 20 '09 at 11:13
  • @alex yes, you would think so wouldn't you. But seemingly not, as I am having to post a question about it. Thanks for your input. – UpTheCreek Sep 20 '09 at 11:42
  • Btw, this Q isn't completely programming-related so you might have some success with getting answers at SuperUser. This is very generic data that you're asking for. – Wim ten Brink Sep 20 '09 at 15:39
  • Didn't upvote or downvote, but do realise that those codes are managed by ISO and they're the official distributors. Anyone else who might share those codes might also be in breach of contract! The ISO is making business by selling documents explaining these standards and they are actively defending these copyrights. Therefore, other distributors of these codes can end up in big legal problems! – Wim ten Brink Sep 20 '09 at 15:42
  • See also **[ISO Country/Currency data](http://stackoverflow.com/questions/246459/iso-country-currency-data)** – hippietrail Jul 31 '12 at 12:23

7 Answers7

5

The CLDR - Unicode Common Locale Data Repository may be of interest.

The Unicode CLDR provides key building blocks for software to support the world's languages, with the largest and most extensive standard repository of locale data available. This data is used by a wide spectrum of companies for their software internationalization and localization, adapting software to the conventions of different languages for such common software tasks as:

  • formatting of dates, times, and time zones,
  • formatting numbers and currency values
  • sorting text
  • choosing languages or countries by name

CLDR uses the XML format provided by UTS #35: Locale Data Markup Language (LDML). LDML is a format used not only for CLDR, but also for general interchange of locale data, such as in Microsoft's .NET.

http://cldr.unicode.org/

Doug Domeny
  • 4,410
  • 2
  • 33
  • 49
4

A good place to start is the ISO website (perhaps with the help of Google). The country codes are quite easy to find.

Neither the currency codes nor the language codes appear to be available in XML, plus the ISO charges to download them.

You can download a demlited version of ISO language codes from the Library of Congress. It would be easy enough to turn that list into XML. You could scrape this page from the ISO web site to get the currency codes.

If you are interested in other ISO codes you haven't list the ISO FAQ includes a list of commonly used ones.

So that's it for "official".

Edit

With regards to your request for sites without commercial use restrictions: if you get the Codes from some other site then that site is in breach of ISO Copyright. They do not have the right to waive the ISO's non-commercial clause. So you still cannot legally use that information in a commercial context.

APC
  • 144,005
  • 19
  • 170
  • 281
  • Yes, I've looked here. The 3166 list is pretty basic (alpha 2 codes only), and is restricted to non commercial use. And as you say, there's no xml data for the other lists. -1 for attitude. – UpTheCreek Sep 20 '09 at 11:08
  • 2
    I didn't actually mark you down. But "Did it occur to you to look at the ISO website (perhaps with the help of Google)?" is a real a-hole way to start an answer. You have added info since then and I appreciate that. – UpTheCreek Sep 20 '09 at 11:45
  • Fair point - I have toned down the opening sentence. – APC Sep 20 '09 at 12:18
  • I think the currency codes XML and XLS are now accessible for free via the ISO website. The same can apparently not be said about the country codes though, which I can't find as a downlaod on the ISO site. https://www.iso.org/iso-4217-currency-codes.html – El Mac Mar 01 '21 at 19:01
3

ISO does not distribute its standards, save a few exceptions. Sometimes, the data is available from another source such as the maintenance agency (SIL for ISO 639-3) but not always in a machine-readable form. Remember that the ISO dinosaur has a very different culture, millions of years away from the Internet world of Perl scripts, mash-ups and RDF.

For languages and country-codes, these standards are distributed by the IANA in the language subtag registry. A non-official XML version is available at langtag.net.

Another source is the Debian package iso-codes whose description says "This package provides the ISO 639 language code list, the ISO 4217 currency code list, the ISO 3166 territory code list, the ISO 3166-2 sub-territory list, and the ISO 15924 script code list." It apparently does not include a XML form but, since it is machine-readable, you can always do it yourself.

bortzmeyer
  • 34,164
  • 12
  • 67
  • 91
3

The Debian package site which bortzmeyer links to above has a link to the FTP release distribution site. ftp://pkg-isocodes.alioth.debian.org/pub/pkg-isocodes/ The latest version 3.13 available there does include XML form. From the README:

"Furthermore, this package provides the ISO standards as XML files to be used by other applications as well. All those XML files are stored in the directory "/usr/share/xml/iso-codes"."

Hope this helps someone in the future.

stargood
  • 31
  • 2
  • This has moved within the last year or so; the updated location of this repository is http://anonscm.debian.org/gitweb/?p=iso-codes/iso-codes.git;a=tree. – Brian Cline May 01 '12 at 15:32
3

This source probably didn't exist in the time when this question was made, but I was looking for the same thing and got this one: http://peric.github.io/GetCountries/

Not only it has XML, but SQL and JSON formats as well, and you can choose from a list of fields you want included. It's also fetched from a source which is not official but I'd say it's as good.

2

I was searching for this too, and I found it here. It is only the currency iso codes and is in XML format.

However, it can only be used for personal/information purposes only.

margie
  • 431
  • 4
  • 7
2

The XML version for the ISO 4217 Currency codes and other standards can be found in different places, including this site:

http://www.tm-xml.org/TM-XML/TM-XML_xml/TM-XML_Standards.xml

(more specifically http://www.tm-xml.org/TM-XML/TM-XML_xml/ISOCurrencyCode.xml)

You can then press Ctrl+U to see the source, which is in xml, or you can just save the page.

OlliS
  • 171
  • 6