Historical
Markets historical is also provided by the API. Please consider that all market-related methods are beta and under heavy development.
By symbol
Get market historical data by a specific symbol
import tradingeconomics as te
te.login('your_api_key')
te.getHistorical(symbol='aapl:us')
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getHistoricalMarkets(symbol = 'aapl:us').then(function(data){
console.log(data)
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us?c=guest:guest");
Symbol | Date | Open | High | Low | Close |
---|---|---|---|---|---|
AAPL:US | 12/07/2023 | 189.68000 | 191.70000 | 188.47000 | 189.75000 |
AAPL:US | 11/07/2023 | 189.16000 | 189.30000 | 186.60000 | 188.08000 |
AAPL:US | 10/07/2023 | 189.26000 | 189.99000 | 187.03500 | 188.61000 |
te.getHistorical(symbol=['aapl:us','gac:com'])
data = te.getHistoricalMarkets(symbol = ['aapl:us','gac:com']).then(function(data){
console.log(data)
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=guest:guest");
Symbol | Date | Open | High | Low | Close |
---|---|---|---|---|---|
AAPL:US | 12/07/2023 | 189.680000000000 | 191.700000000000 | 188.470000000000 | 189.760000000000 |
GAC:COM | 11/07/2023 | 1675.000000000000 | 1675.000000000000 | 1675.000000000000 | 1675.000000000000 |
AAPL:US | 11/07/2023 | 189.160000000000 | 189.300000000000 | 186.600000000000 | 188.080000000000 |
By symbol and date
Get market historical data by a specific symbol and date interval.
/markets/historical/{symbol}?d1=yyyy-mm-dd
te.fetchMarkets(symbol='aapl:us', initDate='2017-08-01')
data = te.getHistoricalMarkets(symbol = 'aapl:us', start_date = '2017-08-01').then(function(data){
console.log(data)
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us?c=guest:guest&d1=2017-08-01");
Symbol | Date | Open | High | Low | Close |
---|---|---|---|---|---|
AAPL:US | 12/07/2023 | 189.68000 | 191.70000 | 188.47000 | 189.84000 |
AAPL:US | 11/07/2023 | 189.16000 | 189.30000 | 186.60000 | 188.08000 |
AAPL:US | 10/07/2023 | 189.26000 | 189.99000 | 187.03500 | 188.61000 |
/markets/historical/{symbol}?d1=yyyy-mm-dd&d2=yyyy-mm-dd
te.fetchMarkets(symbol='aapl:us', initDate='2017-08-01',
endDate='2017-08-08')
data = te.getHistoricalMarkets(symbol = 'aapl:us', start_date = '2017-08-01',
end_date = '2017-08-08').then(function(data){
console.log(data)
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us?c=guest:guest&d1=2017-08-01&d2=2017-08-08");
Symbol | Date | Open | High | Low | Close |
---|---|---|---|---|---|
AAPL:US | 12/07/2023 | 189.68000 | 191.70000 | 188.47000 | 189.89000 |
AAPL:US | 11/07/2023 | 189.16000 | 189.30000 | 186.60000 | 188.08000 |
AAPL:US | 10/07/2023 | 189.26000 | 189.99000 | 187.03500 | 188.61000 |
/markets/historical/{symbols}?d1=yyyy-mm-dd&d2=yyyy-mm-dd
te.fetchMarkets(symbol= ['aapl:us','gac:com'], initDate='2017-08-01',
endDate='2017-08-08')
data = te.getHistoricalMarkets(symbol = ['aapl:us','gac:com'],
start_date = '2017-08-01', end_date = '2017-08-08').then(function(data){
console.log(data)
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=guest:guest&d1=2017-08-01&d2=2017-08-08");
Symbol | Date | Open | High | Low | Close |
---|---|---|---|---|---|
AAPL:US | 12/07/2023 | 189.680000000000 | 191.700000000000 | 188.470000000000 | 189.820000000000 |
GAC:COM | 11/07/2023 | 1675.000000000000 | 1675.000000000000 | 1675.000000000000 | 1675.000000000000 |
AAPL:US | 11/07/2023 | 189.160000000000 | 189.300000000000 | 186.600000000000 | 188.080000000000 |
Response fields
Field | Type | Description | Example |
---|---|---|---|
Symbol | string | Unique symbol used by Trading Economics | “AAPL:US” |
Date | string | Release time and date in UTC | “13/04/2023” |
Open | number | Open value | 161.63000 |
High | number | High value | 165.61860 |
Low | number | Low value | 161.42000 |
Close | number | Close value | 165.50999 |