API: Indicator Queries
About Indicator Queries
Indicators represent data like total population, gross national income, energy use, and many more. The following information is available for each indicator:
- Code
- Name
- Source ID
- Source Note
- Topic ID
- Topic Name
Request Format
http://api.worldbank.org/indicators and http://api.worldbank.org/indicators/NY.GDP.MKTP.CDwhere the first request will return a list of all indicators and the second request where "NY.GDP.MKTP.CD" is a specific indicator.
Response Format
For the request http://api.worldbank.org/indicators/NY.GDP.MKTP.CD
XML
<wb:indicators page="1" pages="1" per_page="50" total="1">
−
<wb:indicator id="NY.GDP.MKTP.CD">
<wb:name>GDP (current US$)</wb:name>
<wb:source id="2">World Development Indicators</wb:source>
−
<wb:sourceNote>
GDP at purchaser's prices is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Data are in current U.S. dollars. Dollar figures for GDP are converted from domestic currencies using single year official exchange rates. For a few countries where the official exchange rate does not reflect the rate effectively applied to actual foreign exchange transactions, an alternative conversion factor is used. Source: World Bank national accounts data, and OECD National Accounts data files.
</wb:sourceNote>
−
<wb:topics>
<wb:topic id="3">Economic Policy and External Debt</wb:topic>
</wb:topics>
</wb:indicator>
</wb:indicators>JSON
[
{
"page":1,
"pages":1,
"per_page":50,
"total":1
},
[
{
"id":"NY.GDP.MKTP.CD",
"name":"GDP (current US$)",
"source":{
"id":"2",
"value":"World Development Indicators"
},
"sourceNote":"GDP at purchaser's prices is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Data are in current U.S. dollars. Dollar figures for GDP are converted from domestic currencies using single year official exchange rates. For a few countries where the official exchange rate does not reflect the rate effectively applied to actual foreign exchange transactions, an alternative conversion factor is used. Source: World Bank national accounts data, and OECD National Accounts data files.",
"topics":[
{
"id":"3",
"value":"Economic Policy and External Debt"
}
]
}
]
]Examples
It is common to use the API to get indicator data related to countries.
Return a list of all indicators
http://api.worldbank.org/indicators
Return information about GDP in current US dollars
http://api.worldbank.org/indicators/NY.GDP.MKTP.CD
Return the definition of the indicator SP.POP.TOTL, in this case, total population
http://api.worldbank.org/indicators/SP.POP.TOTL
Display all indicators for the source: Doing Business referred by numeric ID
http://api.worldbank.org/source/1/indicators
Return the GDP (in current US$) for Brazil (this call also accepts the 3 letter ISO code)
http://api.worldbank.org/countries/br/indicators/NY.GDP.MKTP.CD
Return the GDP for ALL countries (please note the "all" special keyword) in 2002
http://api.worldbank.org/countries/all/indicators/NY.GDP.MKTP.CD?date=2002:2002
In order to get one indicator for a country - for example GNI per capita for Brazil in current US$ using the Atlas method
http://api.worldbank.org/countries/br/indicators/NY.GNP.PCAP.CD/?date=2006:2006
By default, the GNI call above gives all the data available. If you want just the GNI data from, say, 1960 to 1970
http://api.worldbank.org/countries/br/indicators/NY.GNP.PCAP.CD?date=1960:1970
See Also
Read about Aggregates - Regions and Income Levels to learn how you can substitute ISO codes for codes that represent region and income levels in order to obtain aggregate data values based on regions and income level groups.