Historical

By symbol

Get federal reserve historical data by symbol

/fred/historical/{symbol}

import tradingeconomics as te
te.login('your_api_key')
te.getHistorical(symbol='racedisparity005007:fred')
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getFred(historical_symbol = 'RACEDISPARITY005007').then(function(data){
    console.log(data)     
});
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/fred/historical/RACEDISPARITY005007?c=guest:guest");

/fred/historical/{symbols}

te.getFedRHistorical(symbol = ['racedisparity005007', '2020ratio002013'])   
data = te.getFred(historical_symbol = ['racedisparity005007',
 '2020ratio002013']).then(function(data){
    console.log(data)     
});
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/fred/historical/RACEDISPARITY005007,2020RATIO002013?c=guest:guest");

By symbol and a date

Get federal reserve historical by symbol and date range

/fred/historical/{symbols}?d1=yyyy-mm-dd

te.getFedRHistorical(symbol = 'BAMLC0A1CAAAEY', initDate = '2018-05-01') 
data = te.getFred(historical_symbol = 'BAMLC0A1CAAAEY',
 start_date = '2018-05-01').then(function(data){
    console.log(data)     
});
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/fred/historical/BAMLC0A1CAAAEY?c=guest:guest&d1=2018-05-01");

/fred/historical/{symbols}?d1=yyyy-mm-dd&d2=yyyy-mm-dd

te.getFedRHistorical(symbol = 'BAMLC0A1CAAAEY', initDate = '2017-05-01',
 endDate = '2019-01-01')
te.getFedRHistorical(symbol = ['racedisparity005007', '2020ratio002013'],
 initDate = '2017-05-01', endDate  = '2019-01-01')
data = te.getFred(historical_symbol = 'BAMLC0A1CAAAEY', start_date = '2017-05-01',
 end_date = '2019-01-01').then(function(data){
    console.log(data)     
});
data = te.getFred(historical_symbol = ['racedisparity005007', '2020ratio002013'],
 start_date = '2017-05-01', end_date = '2019-01-01').then(function(data){
    console.log(data)     
});
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/fred/historical/BAMLC0A1CAAAEY?c=guest:guest&d1=2017-05-01&d2=2019-01-01");
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/fred/historical/racedisparity005007,2020ratio002013?c=guest:guest&d1=2017-05-01&d2=2019-01-01");

Response fields

FieldTypeDescriptionExample
SymbolstringUnique symbol used by Trading Economics“racedisparity005007”
DatestringRelease time and date in UTC“2009-01-01T00:00:00”
ValuenumberReleased value33.60301