This repository contains scripts to download TLD information hosted on iana.org and convert it into JSON. Unfortunately, for some reason this information doesn't appear to be available in machine-readable form.
You can download the final JSON file at https://hlandau.github.io/tldinfo/tlds.json (.gz).
Alternatively, the file can be loaded via a CDN: https://cdn.rawgit.com/hlandau/tldinfo/gh-pages/tlds.json (.gz).
To build yourself, clone the repository and run make
.
The contents of this repository are released into the public domain.