Retrieving ordered chromosomes with ENSEMBL REST API

It's already almost 2 years that I wrote about the upcoming RESTful times in Bioinformatics. And well, it's already happening...
Just as curiosity, I will explain my recent experience using ENSEMBL REST API.

For a long time I've been taking care of mirroring different popular biological databases in my research centre, such as ENSEMBL. One common task we perform from those data is creating indexes for different alignment programs (e. g., Bowtie). We actually provide indexes that map well-referred canonical chromosome locations, but this is not always the case for the whole genome sequence you can get from a determinate species (e.g. for Human in release 76). For sake of simplicity (and disk space) we only download toplevel files, and then for certain indexers we clean "non-chromosomal" entries.
But, how do we know which chromosomes do a species have and their expected order? This seems a stupid question, but it's not so easy as simply considering an ascending integer succession (as it's partially the case of human). Not only because of sex chromosomes and mithocondria, but also because of different conventions from well-established communities, such as the fruitfly one.

For retrieving this information, I used some ini files which provided this, and even though I was warned that this was a deprecated method, I must admit I was continuing using this since, in the end, it seemed it continued working... And well, it worked for human until the actual ini file was recently updated for new GRCh38 version.

I might have followed the advice above, and recur to remote MySQL, but I found out and alternative way that was far easier in my opinion: to retrieve chromosomes list via ENSEMBL REST API. For instance, for human and fruitfly by just retrieving the karyotype key from the JSON response. However, it must be noted that for some species the returned outcome of this query is rather big and right now I would discourage its direct usage in real-time webservices. Of course, this can always be cached and for mirroring pipelines (which was my issue) is not a problem at all...

I hope this personal anecdote makes you imagine different possibilities about integrating biological REST APIs in your workflows.

BONUS: Get a prettier view of JSON output with JSONView.
{"cc_re__cc_re__cc_by_sa_3_0": ["ld-item even\"><a href=\"/blog/english\">In English</a></div></div></div>\n  <ul class=\"links inline\"><li class=\"blog_usernames_blog first last\"><a href=\"/blog/toni\" title=\"Read toniher&#039;s latest blog entries.\">toniher&#039;s blog</a></li>\n</ul>\n  \n</article>\n          </div>\n\n    <div id=\"navigation\">\n\n      \n      \n    </div>\n\n    \n    \n  </div>\n\n  \n</div>\n\n  <div class=\"region region-bottom\">\n    <div id=\"block-block-5\" class=\"block block-block first last odd\">\n\n      \n  <div class=\"detail\">\n<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img style=\"display:inline-block\" alt=\"Llic\u00e8ncia de Creative Commons by-sa\" src=\"/pics/somerights20.png\" /></a><img src=\"/pics/deed-by.png\" alt=\"deed-by\" style=\"display:inline-block\" /><img src=\"/pics/deed-sa.png\" alt=\"deed-sa\" style=\"display:inline-block\" /><a href=\"http://www.gnu.org/copyleft/fdl.html\"><img style=\"display:inline-block\" src=\"/pics/logos/GNU.png\" alt=\"GFDL\" /></a>\n</div>\n<p style=\"font-size:0.8em;\">\nSi no s'indica el contrari, els continguts de text propis d'<span xmlns:dc=\"htt", "alt=\"deed-by\" style=\"display:inline-block\" /><img src=\"/pics/deed-sa.png\" alt=\"deed-sa\" style=\"display:inline-block\" /><a href=\"http://www.gnu.org/copyleft/fdl.html\"><img style=\"display:inline-block\" src=\"/pics/logos/GNU.png\" alt=\"GFDL\" /></a>\n</div>\n<p style=\"font-size:0.8em;\">\nSi no s'indica el contrari, els continguts de text propis d'<span xmlns:dc=\"http://purl.org/dc/elements/1.1/\" href=\"http://purl.org/dc/dcmitype/Text\" rel=\"dc:type\">aquest web</span> estan llicenciats sota una llic\u00e8ncia <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">Creative Commons Reconeixement - CompartirIgual</a>, com tamb\u00e9 sota una <a href=\"http://www.softcatala.org/llicencies/fdl-ca.html\">Llic\u00e8ncia de documentaci\u00f3 lliure GNU</a>, versi\u00f3 1.2 o qualsevol altra que posteriorment publiqui la <a href=\"http://www.fsf-europe.org/\">Free Software Foundation</a>); sense seccions invariants (Unvariant Sections), textos de portada (Front-Cover Texts), ni textos de contraportada (Back-Cover Texts).</p>\n</div>\n  </div>\n  <script>var _paq = _paq || [];(function("]}