Skip to content
Docs
Get API key
World Bank

World Bank Historical Data

Use the following API endpoints to obtain World Bank historical data.

The historical endpoint contains a time series with an indicator identifier, the reference date and the observed value. It allows one to check the evolution of key indicators over time.

By series code

Using Requests:

Python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/worldbank/historical?s=usa.fr.inr.rinr&c={your_api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

Python
import tradingeconomics as te
te.login('your_api_key')
te.getWBHistorical(series_code = 'usa.fr.inr.rinr')

With multi series codes:

Python
te.getWBHistorical(series_code = 'usa.fr.inr.rinr, prt.ag.con.fert.pt.zs')

The response data format can be configured by appending the &f= parameter to the URL request.

Text
https://api.tradingeconomics.com/worldbank/historical?c={your_api_key}&s=(series_code)&f=json
JSON
[
  {
    "symbol": "usa.fr.inr.rinr",
    "date": "1961-06-15T00:00:00",
    "value": 3.10788
  },
  {
    "symbol": "usa.fr.inr.rinr",
    "date": "1962-06-15T00:00:00",
    "value": 3.21535
  },
  {
    "symbol": "usa.fr.inr.rinr",
    "date": "1963-06-15T00:00:00",
    "value": 3.37488
  }
]

Response fields

FieldTypeDescriptionExample
SymbolstringWorld Bank series code or Trading Economics symbol“usa.fr.inr.rinr”
DatestringRelease date and time in UTC for the historical value“1961-06-15T00:00:00”
ValuenumberValue of the historical data3.10788