Skip to content
Docs
Get API key
Eurostat

Eurostat Historical Data

Use the following API endpoints to obtain Eurostat historical data.

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

By ID

Using Requests:

Python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/eurostat/historical/24804?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.getHistoricalEurostat(ID = '24804')

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

Text
https://api.tradingeconomics.com/eurostat/historical/{id}?c={your_api_key}&f=json
JSON
[
  {
    "ID": 24804,
    "Date": "2020-12-31T00:00:00",
    "Value": 2.4,
    "LastUpdate": "2021-04-20T23:16:00"
  },
  {
    "ID": 24804,
    "Date": "2019-12-31T00:00:00",
    "Value": 1.8,
    "LastUpdate": "2020-07-02T17:46:00"
  },
  {
    "ID": 24804,
    "Date": "2018-12-31T00:00:00",
    "Value": 2.1,
    "LastUpdate": "2020-07-02T17:46:00"
  }
]

By ID and date

Using Requests:

Python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/eurostat/historical/24804?d1=2015-01-01&c={your_api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

Python
te.getHistoricalEurostat(ID = '24804', initDate = '2015-01-01')

With end date:

Python
te.getHistoricalEurostat(ID = '24804', initDate = '2016-01-01',
 endDate = '2020-01-01')
Text
https://api.tradingeconomics.com/eurostat/historical/{id}?c={your_api_key}&d1={yyyy-mm-dd}&f=json
JSON
[
  {
    "ID": 24804,
    "Date": "2020-12-31T00:00:00",
    "Value": 2.4,
    "LastUpdate": "2021-04-20T23:16:00"
  },
  {
    "ID": 24804,
    "Date": "2019-12-31T00:00:00",
    "Value": 1.8,
    "LastUpdate": "2020-07-02T17:46:00"
  },
  {
    "ID": 24804,
    "Date": "2018-12-31T00:00:00",
    "Value": 2.1,
    "LastUpdate": "2020-07-02T17:46:00"
  }
]

Response fields

FieldTypeDescriptionExample
IDnumberTrading Economics unique identifier24804
DatestringRelease date and time in UTC“2020-12-31T00:00:00”
ValuenumberReported value of the indicator2.4000
LastUpdatestringTimestamp when the data was last inserted or updated“2021-04-20T23:16:00”