Search the API
You can search by keyword, term, or category. If you do not know which category to look for, just use the search/{term} endpoint option.
Note: The response fields returned will depend on the search results
By term
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/search/gold?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.getSearch(term = 'gold')
Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/search/gold?c=${your_api_key}`)
console.log(response.data)
})()
Or using our package:
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getSearch(term = 'gold').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/search/gold?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);
}
}
}
The response data format can be configured by appending the &f= parameter to the URL request.
https://api.tradingeconomics.com/search/{term}?c={your_api_key}&f=json
[
{
"Symbol": "CHINAGOLRES"
},
{
"Symbol": "EUROAREAGOLRES"
},
{
"Symbol": "GERMANYGOLRES"
},
{
"Symbol": "XAUUSD:CUR"
}
]
https://api.tradingeconomics.com/search/{term}?c={your_api_key}&f=csv
CHINAGOLRES,Gold Reserves,China,2113.46,Quarterly,Tonnes,,China Gold Reserves,/china/gold-reserves,Economic,13,Aug 7 2023 9:48AM
EUROAREAGOLRES,Gold Reserves,Euro Area,506.52,Quarterly,Tonnes,,Euro Area Gold Reserves,/euro-area/gold-reserves,Economic,13,Aug 14 2023 11:21AM
GERMANYGOLRES,Gold Reserves,Germany,3352.65,Quarterly,Tonnes,,Germany Gold Reserves,/germany/gold-reserves,Economic,13,Aug 8 2023 1:52AM
XAUUSD:CUR,commodity,commodity,1856.100000000000,Live,USD/t.oz, ,commodity commodity,/commodity/gold,markets,6,Oct 10 2023 1:50PM
https://api.tradingeconomics.com/search/{term}?c={your_api_key}
| Symbol | Category | Country | LatestValue | Frequency | Unit | Currency | Title | Url | Type | Importance | LastUpdate |
|---|---|---|---|---|---|---|---|---|---|---|---|
| CHINAGOLRES | Gold Reserves | China | 2068.36 | Quarterly | Tonnes | China Gold Reserves | /china/gold-reserves | Economic | 13 | May 5 2023 9:35PM | |
| EUROAREAGOLRES | Gold Reserves | Euro Area | 506.52 | Quarterly | Tonnes | Euro Area Gold Reserves | /euro-area/gold-reserves | Economic | 13 | May 5 2023 9:35PM | |
| GERMANYGOLRES | Gold Reserves | Germany | 3354.89 | Quarterly | Tonnes | Germany Gold Reserves | /germany/gold-reserves | Economic | 13 | May 5 2023 9:35PM |
List of categories
List all categories available for searching
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/search/categories?c={your_api_key}'
data = requests.get(url).json()
print(data)
Or using our package:
te.getSearch()
Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/search/categories?c=${your_api_key}`)
console.log(response.data)
})()
Or using our package:
data = te.getSearch().then(function(data){
console.log(data)
});
Using Requests:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/search/categories?c=your_api_key");
https://api.tradingeconomics.com/search/categories?c={your_api_key}&f=json
[
{
"Categories": "Markets"
},
{
"Categories": "Commodity"
},
{
"Categories": "Currency"
},
{
"Categories": "Index"
},
{
"Categories": "Economic"
},
{
"Categories": "Comtrade"
},
{
"Categories": "Worldbank - wb"
},
{
"Categories": "Federal Reserve - fred"
}
]
https://api.tradingeconomics.com/search/categories?c={your_api_key}&f=csv
Markets
Commodity
Currency
Index
https://api.tradingeconomics.com/search/categories?c={your_api_key}
| Categories |
|---|
| Markets |
| Commodity |
| Currency |
| Index |
| Economic |
| Comtrade |
| Worldbank - wb |
| Federal Reserve - fred |
By term and category
Using Requests:
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/search/japan?category=markets&c={your_api_key}'
data = requests.get(url).json()
print(data)
Or using our package:
te.getSearch(term = 'japan', category = 'markets')
Using Requests:
const axios = require('axios');
(async () => {
const your_api_key = 'your_api_key'
const response = await axios.get(`https://api.tradingeconomics.com/search/japan?category=markets&c=${your_api_key}`)
console.log(response.data)
})()
Or using our package:
data = te.getSearch(term = 'japan', category = 'markets').then(function(data){
console.log(data)
});
Using Requests:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/search/japan?category=markets&c=your_api_key");
https://api.tradingeconomics.com/search/{term}?c={your_api_key}&category={category}&f=json
[
{
"Symbol": "GJGB10:IND",
"Ticker": "GJGB10",
"Name": "Japan 10Y",
"Country": "Japan",
"Date": "2023-10-10T13:59:37",
"Type": "bond",
"decimals": null,
"state": null,
"Last": null,
"Close": null,
"CloseDate": null,
"MarketCap": null,
"URL": "/japan/government-bond-yield",
"Importance": null,
"DailyChange": null,
"DailyPercentualChange": null,
"WeeklyChange": null,
"WeeklyPercentualChange": null,
"MonthlyChange": null,
"MonthlyPercentualChange": null,
"YearlyChange": null,
"YearlyPercentualChange": null,
"YTDChange": null,
"YTDPercentualChange": null,
"day_high": null,
"day_low": null
}
]
https://api.tradingeconomics.com/search/{term}?c={your_api_key}&category={category}&f=csv
GJGB10:IND,GJGB10,Japan 10Y,Japan,10/10/2023 1:59:37 PM,bond,,,,,,,/japan/government-bond-yield,,,,,,,,,,,,,,,,,,,,,Delayed,
GJGB1M:IND,GJGB1M,Japan 1M,Japan,10/10/2023 12:00:00 AM,bond,,,,,,,/japan/1-month-bill-yield,,,,,,,,,,,,,,,,,,,,,Daily,
GJGB1Y:IND,GJGB1Y,Japan 52W,Japan,10/10/2023 11:05:27 AM,bond,,,,,,,/japan/52-week-bill-yield,,,,,,,,,,,,,,,,,,,,,Delayed,
https://api.tradingeconomics.com/search/{term}?c={your_api_key}&category={category}
| Symbol | Ticker | Name | Country | Date | Type | decimals | state | Last | Close | CloseDate | MarketCap | URL | Importance | DailyChange | DailyPercentualChange | WeeklyChange | WeeklyPercentualChange | MonthlyChange | MonthlyPercentualChange | YearlyChange | YearlyPercentualChange | YTDChange | YTDPercentualChange | day_high | day_low | yesterday | lastWeek | lastMonth | lastYear | startYear | ISIN | unit | frequency | LastUpdate |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GJGB10:IND | GJGB10 | Japan 10Y | Japan | 7/14/2023 12:20:13 PM | bond | /japan/government-bond-yield | Delayed | |||||||||||||||||||||||||||
| GJGB1M:IND | GJGB1M | Japan 1M | Japan | 7/14/2023 12:00:00 AM | bond | /japan/1-month-bill-yield | Daily | |||||||||||||||||||||||||||
| GJGB1Y:IND | GJGB1Y | Japan 52W | Japan | 7/14/2023 12:19:42 PM | bond | /japan/52-week-bill-yield | Delayed |