•   almost 13 years ago

Effective data fetching by country in API

I'm trying to fetch data in as few requests as possible. So for fetching data for all countries for a given indicator the API for example supports the request:
But I have not found a similar way to fetch all the indicator data for a given country, e.g.:
or maybe limited by topic so we dont get a too large result set:
I see a need for this functionality in order to get the full picture for a country in one (maybe per topic) request. At least I would have need for it :).
The alternative is to make say 200 requests (one per country) to gather the data.
If not already there, will it be supported in the future?
Thanks for an exiting challange!


  • Manager   •   almost 13 years ago

    Hi Centaurus, we'll make sure the WB data team sees this and gets back to you soon.
    Thanks. -Brandon

  •   •   almost 13 years ago

    Hi Centaurus,

     Thanks for the feedback on the API. We are working to improve the API and we will certainly look into your suggestions. For now, you can get the list of indicators under a topic with a single API call, but for the indicator data you have to make individual calls. Find below a possible way for obtaining the data.

    1) To get a list of all Topics, make the following call

    <topic id>/indicators. For example, if the user wants list of all indicators under "Aid Effectiveness" Topic id "2" as obtained in the previous query, the API call will be http://api.worldbank.org/topics/2/indicators

    3) This will list all the indicator name and id under the topic. Then loop through all the indicators and obtain data for all the indicators.
    There is also an existing page giving general guidance, on how to use the API's
     Hope that helps.

    . This will provide a list of all available topics.
    2) To get a list of indicators for a particular Topic, the API call will look like this http://api.worldbank.org/topics/


Comments are closed.