Search

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
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/search/gold?c={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 api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/search/gold?c=${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.

/search/{term}

SymbolCategoryCountryLatestValueFrequencyUnitCurrencyTitleUrlTypeImportanceLastUpdate
CHINAGOLRESGold ReservesChina2068.36QuarterlyTonnesChina Gold Reserves/china/gold-reservesEconomic13May 5 2023 9:35PM
EUROAREAGOLRESGold ReservesEuro Area506.52QuarterlyTonnesEuro Area Gold Reserves/euro-area/gold-reservesEconomic13May 5 2023 9:35PM
GERMANYGOLRESGold ReservesGermany3354.89QuarterlyTonnesGermany Gold Reserves/germany/gold-reservesEconomic13May 5 2023 9:35PM

/search/{term}?f=json

[{"Symbol":"CHINAGOLRES"},{"Symbol":"EUROAREAGOLRES"},{"Symbol":"GERMANYGOLRES"},{"Symbol":"XAUUSD:CUR"}]

/search/{term}?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

List of categories

List all categories available for searching

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/search/categories?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

te.getSearch()

Using Requests:

const axios = require('axios');
(async () => {
    const api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/search/categories?c=${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");

/search/categories

Categories
Markets
Commodity
Currency
Index
Economic
Comtrade
Worldbank - wb
Federal Reserve - fred

/search/categories?f=json

[{"Categories":"Markets"},{"Categories":"Commodity"},{"Categories":"Currency"},{"Categories":"Index"},{"Categories":"Economic"},{"Categories":"Comtrade"},{"Categories":"Worldbank - wb"},{"Categories":"Federal Reserve - fred"}]

/search/categories?f=csv

Markets
Commodity
Currency
Index

By term and category

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/search/japan?category=markets&c={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 api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/search/japan?category=markets&c=${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");

/search/{term}?category={category}

SymbolTickerNameCountryDateTypedecimalsstateLastCloseCloseDateMarketCapURLImportanceDailyChangeDailyPercentualChangeWeeklyChangeWeeklyPercentualChangeMonthlyChangeMonthlyPercentualChangeYearlyChangeYearlyPercentualChangeYTDChangeYTDPercentualChangeday_highday_lowyesterdaylastWeeklastMonthlastYearstartYearISINunitfrequencyLastUpdate
GJGB10:INDGJGB10Japan 10YJapan7/14/2023 12:20:13 PMbond/japan/government-bond-yieldDelayed
GJGB1M:INDGJGB1MJapan 1MJapan7/14/2023 12:00:00 AMbond/japan/1-month-bill-yieldDaily
GJGB1Y:INDGJGB1YJapan 52WJapan7/14/2023 12:19:42 PMbond/japan/52-week-bill-yieldDelayed

/search/{term}?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}]

/search/{term}?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,

/search/{term}?category={category}?f=xml

<ArrayOfanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<anyType xmlns:d2p1="http://schemas.datacontract.org/2004/07/APILib.DB" i:type="d2p1:Markets.MarketSnapItem">
<d2p1:Close i:nil="true"/>
<d2p1:CloseDate i:nil="true"/>
<d2p1:Country>Japan</d2p1:Country>
<d2p1:DailyChange i:nil="true"/>
<d2p1:DailyPercentualChange i:nil="true"/>
<d2p1:Date>2023-10-10T13:59:37</d2p1:Date>
<d2p1:ISIN/>
<d2p1:Importance i:nil="true"/>
<d2p1:Last i:nil="true"/>
<d2p1:LastUpdate i:nil="true"/>
<d2p1:MarketCap i:nil="true"/>
<d2p1:MonthlyChange i:nil="true"/>
<d2p1:MonthlyPercentualChange i:nil="true"/>
<d2p1:Name>Japan 10Y</d2p1:Name>
<d2p1:Symbol>GJGB10:IND</d2p1:Symbol>
<d2p1:Ticker>GJGB10</d2p1:Ticker>
<d2p1:Type>bond</d2p1:Type>
<d2p1:URL>/japan/government-bond-yield</d2p1:URL>
<d2p1:WeeklyChange i:nil="true"/>
<d2p1:WeeklyPercentualChange i:nil="true"/>
<d2p1:YTDChange i:nil="true"/>
<d2p1:YTDPercentualChange i:nil="true"/>
<d2p1:YearlyChange i:nil="true"/>
<d2p1:YearlyPercentualChange i:nil="true"/>
<d2p1:day_high i:nil="true"/>
<d2p1:day_low i:nil="true"/>
<d2p1:decimals i:nil="true"/>
<d2p1:frequency>Delayed</d2p1:frequency>
<d2p1:lastMonth i:nil="true"/>
<d2p1:lastWeek i:nil="true"/>
<d2p1:lastYear i:nil="true"/>
<d2p1:startYear i:nil="true"/>
<d2p1:state i:nil="true"/>
<d2p1:unit i:nil="true"/>
<d2p1:yesterday i:nil="true"/>
</anyType>
<anyType xmlns:d2p1="http://schemas.datacontract.org/2004/07/APILib.DB" i:type="d2p1:Markets.MarketSnapItem">
<d2p1:Close i:nil="true"/>
<d2p1:CloseDate i:nil="true"/>
<d2p1:Country>Japan</d2p1:Country>
<d2p1:DailyChange i:nil="true"/>
<d2p1:DailyPercentualChange i:nil="true"/>
<d2p1:Date>2023-10-10T00:00:00</d2p1:Date>
<d2p1:ISIN/>
<d2p1:Importance i:nil="true"/>
<d2p1:Last i:nil="true"/>
<d2p1:LastUpdate i:nil="true"/>
<d2p1:MarketCap i:nil="true"/>
<d2p1:MonthlyChange i:nil="true"/>
<d2p1:MonthlyPercentualChange i:nil="true"/>
<d2p1:Name>Japan 1M</d2p1:Name>
<d2p1:Symbol>GJGB1M:IND</d2p1:Symbol>
<d2p1:Ticker>GJGB1M</d2p1:Ticker>
<d2p1:Type>bond</d2p1:Type>
<d2p1:URL>/japan/1-month-bill-yield</d2p1:URL>
<d2p1:WeeklyChange i:nil="true"/>
<d2p1:WeeklyPercentualChange i:nil="true"/>
<d2p1:YTDChange i:nil="true"/>
<d2p1:YTDPercentualChange i:nil="true"/>
<d2p1:YearlyChange i:nil="true"/>
<d2p1:YearlyPercentualChange i:nil="true"/>
<d2p1:day_high i:nil="true"/>
<d2p1:day_low i:nil="true"/>
<d2p1:decimals i:nil="true"/>
<d2p1:frequency>Daily</d2p1:frequency>
<d2p1:lastMonth i:nil="true"/>
<d2p1:lastWeek i:nil="true"/>
<d2p1:lastYear i:nil="true"/>
<d2p1:startYear i:nil="true"/>
<d2p1:state i:nil="true"/>
<d2p1:unit i:nil="true"/>
<d2p1:yesterday i:nil="true"/>
</anyType>
<anyType xmlns:d2p1="http://schemas.datacontract.org/2004/07/APILib.DB" i:type="d2p1:Markets.MarketSnapItem">
<d2p1:Close i:nil="true"/>
<d2p1:CloseDate i:nil="true"/>
<d2p1:Country>Japan</d2p1:Country>
<d2p1:DailyChange i:nil="true"/>
<d2p1:DailyPercentualChange i:nil="true"/>
<d2p1:Date>2023-10-10T11:05:27</d2p1:Date>
<d2p1:ISIN/>
<d2p1:Importance i:nil="true"/>
<d2p1:Last i:nil="true"/>
<d2p1:LastUpdate i:nil="true"/>
<d2p1:MarketCap i:nil="true"/>
<d2p1:MonthlyChange i:nil="true"/>
<d2p1:MonthlyPercentualChange i:nil="true"/>
<d2p1:Name>Japan 52W</d2p1:Name>
<d2p1:Symbol>GJGB1Y:IND</d2p1:Symbol>
<d2p1:Ticker>GJGB1Y</d2p1:Ticker>
<d2p1:Type>bond</d2p1:Type>
<d2p1:URL>/japan/52-week-bill-yield</d2p1:URL>
<d2p1:WeeklyChange i:nil="true"/>
<d2p1:WeeklyPercentualChange i:nil="true"/>
<d2p1:YTDChange i:nil="true"/>
<d2p1:YTDPercentualChange i:nil="true"/>
<d2p1:YearlyChange i:nil="true"/>
<d2p1:YearlyPercentualChange i:nil="true"/>
<d2p1:day_high i:nil="true"/>
<d2p1:day_low i:nil="true"/>
<d2p1:decimals i:nil="true"/>
<d2p1:frequency>Delayed</d2p1:frequency>
<d2p1:lastMonth i:nil="true"/>
<d2p1:lastWeek i:nil="true"/>
<d2p1:lastYear i:nil="true"/>
<d2p1:startYear i:nil="true"/>
<d2p1:state i:nil="true"/>
<d2p1:unit i:nil="true"/>
<d2p1:yesterday i:nil="true"/>
</anyType>
</ArrayOfanyType>