Markets Historical Data
Use the following API endpoints to obtain historical data for markets.
The historical endpoint contains a time series with fields such as symbol, date, open, high, low, close, and observed value. It allows one to check the evolution of key indicators over time.
To find the symbol you need, you can use:
- Quotes by Category — browse available symbols by market category (e.g., stocks, bonds, commodities).
- Quotes by Country — look up symbols filtered by country.
- Search — search for symbols by name or keyword.
By symbol
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/historical/aapl:us?c={your_api_key}'
data = requests.get(url).json()
print(data)Or using our package:
import tradingeconomics as te
te.login('your_api_key')
te.getHistorical(symbol='aapl:us')Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=${your_api_key}`)
console.log(response.data)
})()Or using our package:
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getHistoricalMarkets(symbol = 'aapl:us').then(function(data){
console.log(data)
});With multi symbols:
data = te.getHistoricalMarkets(symbol = ['aapl:us','gac:com']).then(function(data){
console.log(data)
});Using Requests:
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us?c=your_api_key"))
{
request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");
var response = await httpClient.SendAsync(request);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
}With multi symbols:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=your_api_key");The response data format can be configured by appending the &f= parameter to the URL request.
https://api.tradingeconomics.com/markets/historical/{symbol}?c={your_api_key}&f=json[
{
"Symbol": "AAPL:US",
"Date": "14/04/2026",
"Open": 259.245,
"High": 261.8901,
"Low": 257.1901,
"Close": 258.83
},
{
"Symbol": "AAPL:US",
"Date": "13/04/2026",
"Open": 259.73,
"High": 260.18,
"Low": 256.66,
"Close": 259.2
},
{
"Symbol": "AAPL:US",
"Date": "10/04/2026",
"Open": 259.98,
"High": 262.19,
"Low": 259.0231,
"Close": 260.48
}
]https://api.tradingeconomics.com/markets/historical/{symbol}?c={your_api_key}&f=csvSymbol,Date,Open,High,Low,Close
AAPL:US,14/04/2026,259.2450,261.8901,257.1901,258.8300
AAPL:US,13/04/2026,259.7300,260.1800,256.6600,259.2000
AAPL:US,10/04/2026,259.9800,262.1900,259.0231,260.4800https://api.tradingeconomics.com/markets/historical/{symbol}?c={your_api_key}| Symbol | Date | Open | High | Low | Close |
|---|---|---|---|---|---|
| AAPL:US | 14/04/2026 | 259.2450 | 261.8901 | 257.1901 | 258.8300 |
| AAPL:US | 13/04/2026 | 259.7300 | 260.1800 | 256.6600 | 259.2000 |
| AAPL:US | 10/04/2026 | 259.9800 | 262.1900 | 259.0231 | 260.4800 |
By symbol and date
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/historical/aapl:us?c={your_api_key}&d1=2026-04-01&d2=2026-04-15'
data = requests.get(url).json()
print(data)Or using our package:
import tradingeconomics as te
te.login('your_api_key')
te.fetchMarkets(symbol='aapl:us', initDate='2026-04-01', endDate='2026-04-15')Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/markets/historical/aapl:us?c=${your_api_key}&d1=2026-04-01&d2=2026-04-15`)
console.log(response.data)
})()Or using our package:
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getHistoricalMarkets(symbol = 'aapl:us', start_date = '2026-04-01',
end_date = '2026-04-15').then(function(data){
console.log(data)
});Using Requests:
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us?c=your_api_key&d1=2026-04-01&d2=2026-04-15"))
{
request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");
var response = await httpClient.SendAsync(request);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
}https://api.tradingeconomics.com/markets/historical/{symbol}?c={your_api_key}&d1=yyyy-mm-dd&d2=yyyy-mm-dd&f=json[
{
"Symbol": "AAPL:US",
"Date": "14/04/2026",
"Open": 259.245,
"High": 261.8901,
"Low": 257.1901,
"Close": 258.83
},
{
"Symbol": "AAPL:US",
"Date": "13/04/2026",
"Open": 259.73,
"High": 260.18,
"Low": 256.66,
"Close": 259.2
},
{
"Symbol": "AAPL:US",
"Date": "10/04/2026",
"Open": 259.98,
"High": 262.19,
"Low": 259.0231,
"Close": 260.48
}
]https://api.tradingeconomics.com/markets/historical/{symbol}?c={your_api_key}&d1=yyyy-mm-dd&d2=yyyy-mm-dd&f=csvSymbol,Date,Open,High,Low,Close
AAPL:US,14/04/2026,259.2450,261.8901,257.1901,258.8300
AAPL:US,13/04/2026,259.7300,260.1800,256.6600,259.2000
AAPL:US,10/04/2026,259.9800,262.1900,259.0231,260.4800https://api.tradingeconomics.com/markets/historical/{symbol}?c={your_api_key}&d1=yyyy-mm-dd&d2=yyyy-mm-dd| Symbol | Date | Open | High | Low | Close |
|---|---|---|---|---|---|
| AAPL:US | 14/04/2026 | 259.2450 | 261.8901 | 257.1901 | 258.8300 |
| AAPL:US | 13/04/2026 | 259.7300 | 260.1800 | 256.6600 | 259.2000 |
| AAPL:US | 10/04/2026 | 259.9800 | 262.1900 | 259.0231 | 260.4800 |
By multiple symbols
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c={your_api_key}'
data = requests.get(url).json()
print(data)Or using our package:
import tradingeconomics as te
te.login('your_api_key')
te.getHistorical(symbol='aapl:us')With multi symbols:
te.getHistorical(symbol=['aapl:us','gac:com'])Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=${your_api_key}`)
console.log(response.data)
})()Or using our package:
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getHistoricalMarkets(symbol = 'aapl:us').then(function(data){
console.log(data)
});With multi symbols:
data = te.getHistoricalMarkets(symbol = ['aapl:us','gac:com']).then(function(data){
console.log(data)
});Using Requests:
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us?c=your_api_key"))
{
request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");
var response = await httpClient.SendAsync(request);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
}With multi symbols:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=your_api_key");The response data format can be configured by appending the &f= parameter to the URL request.
https://api.tradingeconomics.com/markets/historical/{symbols}?c={your_api_key}&f=json[
{
"Symbol": "AAPL:US",
"Date": "10/10/2023",
"Open": 178.1,
"High": 179.72,
"Low": 177.95,
"Close": 178.39
},
{
"Symbol": "GAC:COM",
"Date": "10/10/2023",
"Open": 1955.0,
"High": 1980.0,
"Low": 1930.0,
"Close": 1955.0
},
{
"Symbol": "GAC:COM",
"Date": "09/10/2023",
"Open": 1955.0,
"High": 1980.0,
"Low": 1930.0,
"Close": 1955.0
}
]https://api.tradingeconomics.com/markets/historical/{symbols}?c={your_api_key}&f=csvSymbol,Date,Open,High,Low,Close
AAPL:US,10/10/2023,178.1000,179.7200,177.9500,178.3900
GAC:COM,10/10/2023,1955.0000,1980.0000,1930.0000,1955.0000
GAC:COM,09/10/2023,1955.0000,1980.0000,1930.0000,1955.0000https://api.tradingeconomics.com/markets/historical/{symbols}?c={your_api_key}| Symbol | Date | Open | High | Low | Close |
|---|---|---|---|---|---|
| AAPL:US | 12/07/2023 | 189.6800 | 191.7000 | 188.4700 | 189.7600 |
| GAC:COM | 11/07/2023 | 1675.0000 | 1675.0000 | 1675.0000 | 1675.0000 |
| AAPL:US | 11/07/2023 | 189.1600 | 189.3000 | 186.6000 | 188.0800 |
By multiple symbols and date
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c={your_api_key}&d1=2017-08-01&d2=2017-08-08'
data = requests.get(url).json()
print(data)Or using our package:
te.fetchMarkets(symbol= ['aapl:us','gac:com'], initDate='2017-08-01')With end date:
te.fetchMarkets(symbol= ['aapl:us','gac:com'], initDate='2017-08-01',
endDate='2017-08-08')Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=${your_api_key}&d1=2017-08-01&d2=2017-08-08`)
console.log(response.data)
})()Or using our package:
data = te.getHistoricalMarkets(symbol= ['aapl:us','gac:com'], start_date = '2017-08-01').then(function(data){
console.log(data)
});With end date:
data = te.getHistoricalMarkets(symbol= ['aapl:us','gac:com'], start_date = '2017-08-01',
end_date = '2017-08-08').then(function(data){
console.log(data)
});Using Requests:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=your_api_key&d1=2017-08-01");With end date:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=your_api_key&d1=2017-08-01&d2=2017-08-08");https://api.tradingeconomics.com/markets/historical/{symbols}?c={your_api_key}&d1=yyyy-mm-dd&d2=yyyy-mm-dd&f=json[
{
"Symbol": "AAPL:US",
"Date": "10/10/2023",
"Open": 178.1,
"High": 179.72,
"Low": 177.95,
"Close": 178.39
},
{
"Symbol": "GAC:COM",
"Date": "10/10/2023",
"Open": 1955.0,
"High": 1980.0,
"Low": 1930.0,
"Close": 1955.0
},
{
"Symbol": "GAC:COM",
"Date": "09/10/2023",
"Open": 1955.0,
"High": 1980.0,
"Low": 1930.0,
"Close": 1955.0
}
]https://api.tradingeconomics.com/markets/historical/{symbols}?c={your_api_key}&d1=yyyy-mm-dd&d2=yyyy-mm-dd&f=csvSymbol,Date,Open,High,Low,Close
AAPL:US,10/10/2023,178.1000,179.7200,177.9500,178.3900
GAC:COM,10/10/2023,1955.0000,1980.0000,1930.0000,1955.0000
GAC:COM,09/10/2023,1955.0000,1980.0000,1930.0000,1955.0000https://api.tradingeconomics.com/markets/historical/{symbols}?c={your_api_key}&d1=yyyy-mm-dd&d2=yyyy-mm-dd| Symbol | Date | Open | High | Low | Close |
|---|---|---|---|---|---|
| AAPL:US | 12/07/2023 | 189.6800 | 191.7000 | 188.4700 | 189.8200 |
| GAC:COM | 11/07/2023 | 1675.0000 | 1675.0000 | 1675.0000 | 1675.0000 |
| AAPL:US | 11/07/2023 | 189.1600 | 189.3000 | 186.6000 | 188.0800 |
Response fields
| Field | Type | Description | Example |
|---|---|---|---|
| Symbol | string | Unique symbol used by Trading Economics | “AAPL:US” |
| Date | string | Date of the trading session in UTC | “13/04/2023” |
| Open | number | Opening price of the trading session | 161.6300 |
| High | number | Highest price reached during the trading session | 165.6186 |
| Low | number | Lowest price reached during the trading session | 161.4200 |
| Close | number | Closing price of the trading session | 165.5099 |