Data Calls

The World Bank API provides three data calls. 

  • wb.data.get
  • wb.data.sources.get
  • wb.indicators.get

These data calls tap into the following sources of World Bank Data:

  • The Little Data Book - based on the World Development Indicators, the World Bank's primary database for cross-country comparable development data, the Little Data Book includes 54 basic indicators going back 60 years.
    See: Little Data Book site | Glossary of Indicators
  • World Governance Indicators - includes aggregate and individual governance indicators for 212 countries and territories over the period 1996–2007, for six dimensions of governance
    See: Governance Indicators site | Glossary of Indicators
  • Doing Business - includes objective measures of business regulations and their enforcement across 178 countries and selected cities at the subnational and regional level.
    See: Doing Business site | Data Notes & Methodology

 

wb.data.get

Gets information about data.

Arguments

api_key (Required)
    Your API key.
country (Optional)
    The three letter ISO code of the country.
indicator (Optional)
    The id of the indicator to search for.
date (Optional)
    The date to search for (See the Date Format page for more information).
page (Optional)
    The page of results to return. If this argument is omitted, it defaults to 1.
per_page (Optional)
    The number of data points to return per page.  If this argument is omitted, it defaults to 10.  The maximum allowed value is 100.

Example Response

  1. <rsp stat="ok">  
  2.   <data page="1" pages="1" per_page="10" total="1">  
  3.     <datapoint>  
  4.        <country id="IND">India</country>  
  5.        <indicator id="NY.GDP.MKTP.CD">GDP (current US$)</indicator>  
  6.        <date>1990</date>  
  7.        <value>317466607616</value>  
  8.      </datapoint>  
  9.   </data>  
  10. </rsp>  

Error Codes

90: Invalid date “xxx” provided
            The date provided cannot be interpreted
91: Invalid date range “xxx” provided
           
The date range provided cannot be interpreted
100: Invalid API Key
           
The API key passed was not valid or has expired.
105: Service currently unavailable
           
The requested service is temporarily unavailable.
110: API version “xxx” not found
           
The requested API version was not found.
111: Format “xxx” not found
           
The requested response format was not found.
112: Method “xxx” not found
           
The requested method was not found.
115: Missing required parameter
           
Parameters which are required have not been sent.
120: Parameter “xxx” has an invalid value
            The provided parameter is not valid.

 

wb.datasources.get

Gets information about a data source.

Arguments

api_key (Required)
    Your API key.
id (Optional)
    The id of the source.
page (Optional)
    The page of results to return. If this argument is omitted, it defaults to 1.
per_page (Optional)
    The number of sources to return per page.  If this argument is omitted, it defaults to 10.  The maximum allowed value is 100.

Example Response

  1. <rsp stat="ok">  
  2.   <sources page="1" pages="1" per_page="10" total="1">  
  3.     <source id="1">  
  4.       <name>Doing Business</name>  
  5.       <description>Doing Business is a guide for evaluating regulations that directly impact economic growth, downloading underlying laws, making cross-country comparisons, and identifying good practice reforms.</description>  
  6.       <url>http://www.doingbusiness.org</url>  
  7.     </source>  
  8.   </sources>  
  9. </rsp>  

Error Codes

100: Invalid API Key
           
The API key passed was not valid or has expired.
105: Service currently unavailable
           
The requested service is temporarily unavailable.
110: API version “xxx” not found
           
The requested API version was not found.
111: Format “xxx” not found
           
The requested response format was not found.
112: Method “xxx” not found
           
The requested method was not found.
115: Missing required parameter
           
Parameters which are required have not been sent.
120: Parameter “xxx” has an invalid value
            The provided parameter is not valid.


wb.indicators.get

Gets information about an indicator.

Arguments

api_key (Required)
    Your API key.
id (Optional)
    The id of the region.
source (Optional)
    The id of the indicator source.
topic (Optional)
    The id of the topic.
page (Optional)
    The page of results to return. If this argument is omitted, it defaults to 1.
per_page (Optional)
    The number of indicators to return per page.  If this argument is omitted, it defaults to 10.  The maximum allowed value is 100.

Example Response

  1. <rsp stat="ok">  
  2.   <indicators page="1" pages="1" per_page="10" total="1">  
  3.     <indicator id="AG.LND.AGRI.ZS">  
  4.     <name>Agricultural land (% of land area)</name>  
  5.     <source id="2">World Development Indicators</source>  
  6.       <sourcenote>Agricultural land refers to ...</sourcenote>  
  7.       <topics>  
  8.         <topic id="644290">Agriculture</topic>  
  9.         <topic id="644284">Communities and Human Settlements</topic>  
  10.       </topics>  
  11.     </indicator>  
  12.   </indicators>  
  13. </rsp>  

Error Codes

100: Invalid API Key
           
The API key passed was not valid or has expired.
105: Service currently unavailable
           
The requested service is temporarily unavailable.
110: API version “xxx” not found
           
The requested API version was not found.
111: Format “xxx” not found
           
The requested response format was not found.
112: Method “xxx” not found
           
The requested method was not found.
115: Missing required parameter
           
Parameters which are required have not been sent.
120: Parameter “xxx” has an invalid value
            The provided parameter is not valid.