← back to the blog


World Bank API as data source

Posted in Data by Admin

Connecting World Bank data is very easy.

The API structure is explained here:

http://data.worldbank.org/developers/api-overview/basic-call-structure

The example we use in the app is the population growth indicator SP.POP.TOTL for China (cn)

http://api.worldbank.org/countries/cn/indicators/SP.POP.TOTL?format=json&per_page=100

This call returns a structure as the following:

[
{"page":1,"pages":1,"per_page":"100","total":56},
[
{"indicator":{"id":"SP.POP.TOTL","value":"Population, total"},"country":{"id":"CN","value":"China"},"value":null,"decimal":"0","date":"2015"},

{"indicator":{"id":"SP.POP.TOTL","value":"Population, total"},"country":{"id":"CN","value":"China"},"value":"1364270000","decimal":"0","date":"2014"},

{"indicator":{"id":"SP.POP.TOTL","value":"Population, total"},"country":{"id":"CN","value":"China"},"value":"1357380000","decimal":"0","date":"2013"},

...
]
]

If you connect this API to Quips as data0 for example, you can build a table in Jade for example using data0[1] and loop through it.

Easy, try it out.