Economic Indicators
The Trading Economics API provides comprehensive access to data from more than 196 countries, featuring thousands of key economic indicators and financial market metrics. To accommodate a diverse user base, our API platform is compatible with multiple programming languages, enabling seamless data retrieval for analysts, researchers, and developers. Below, we offer examples for accessing economic indicators using Python, JavaScript, and C#, though our system is flexible enough to support any programming language of your choice.
The Snapshot endpoint offers a momentary view of data, capturing specific information at a particular point in time. It generally includes details such as date, units, and general information, providing a static representation of current data.
Data by country
Using Requests:
import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/country/mexico?c={api_key}'
data = requests.get(url).json()
print(data)
Or using our package:
import tradingeconomics as te
te.login('your_api_key')
te.getIndicatorData(country='mexico')
With multi countries:
te.getIndicatorData(country=['mexico', 'sweden'])
Using Requests:
const axios = require('axios');
(async () => {
const api_key = 'YOUR_API_KEY'
const response = await axios.get(`https://api.tradingeconomics.com/country/mexico?c=${api_key}`)
console.log(response.data)
})()
Or using our package:
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getIndicatorData(country = 'mexico').then(function(data){
console.log(data)
});
With multi countries:
data = te.getIndicatorData(country = ['mexico', 'sweden']).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/country/mexico?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 countries:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/country/mexico,sweden?c=your_api_key");
The response data format can be configured by appending the &f= parameter to the URL request.
| Country | Category | Title | LatestValueDate | LatestValue | Source | SourceURL | Unit | URL | CategoryGroup | Adjustment | Frequency | HistoricalDataSymbol | CreateDate | FirstValueDate | PreviousValue | PreviousValueDate |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mexico | Auto Exports | Mexico Auto Exports | 6/30/2023 12:00:00 AM | 286.29 | Instituto Nacional de Estadística y Geografía (INEGI) | https://www.inegi.org.mx/ | Thousand Units | /mexico/auto-exports | Trade | NSA | Monthly | MEXICOAUTEXP | 7/23/2019 12:20:00 PM | 1/31/1988 12:00:00 AM | 279.27 | 5/31/2023 12:00:00 AM |
| Mexico | Balance of Trade | Mexico Balance of Trade | 5/31/2023 12:00:00 AM | -74.00 | Instituto Nacional de Estadística y Geografía (INEGI) | https://www.inegi.org.mx/ | USD Million | /mexico/balance-of-trade | Trade | NSA | Monthly | MXTBBAL | 7/25/2014 2:01:00 PM | 1/31/1980 12:00:00 AM | -1509.00 | 4/30/2023 12:00:00 AM |
| Mexico | Banks Balance Sheet | Mexico Banks Balance Sheet | 4/30/2023 12:00:00 AM | 10335903.02 | Banco de México | https://www.banxico.org.mx | MXN Million | /mexico/banks-balance-sheet | Trade | NSA | Monthly | MEXICOBANBALSHE | 9/8/2014 3:29:00 PM | 12/31/2000 12:00:00 AM | 10169075.64 | 3/31/2023 12:00:00 AM |
[{"Country":"Mexico","Category":"Auto Exports","Title":"Mexico Auto Exports","LatestValueDate":"2023-08-31T00:00:00","LatestValue":287.85,"Source":"Instituto Nacional de Estadística y Geografía (INEGI)","SourceURL":"https://www.inegi.org.mx/","Unit":"Thousand Units","URL":"/mexico/auto-exports","CategoryGroup":"Trade","Adjustment":"NSA","Frequency":"Monthly","HistoricalDataSymbol":"MEXICOAUTEXP","CreateDate":"2019-07-23T12:20:00","FirstValueDate":"1988-01-31T00:00:00","PreviousValue":275.77,"PreviousValueDate":"2023-07-31T00:00:00"},{"Country":"Mexico","Category":"Balance of Trade","Title":"Mexico Balance of Trade","LatestValueDate":"2023-08-31T00:00:00","LatestValue":-1377.09,"Source":"Instituto Nacional de Estadística y Geografía (INEGI)","SourceURL":"https://www.inegi.org.mx/","Unit":"USD Million","URL":"/mexico/balance-of-trade","CategoryGroup":"Trade","Adjustment":"NSA","Frequency":"Monthly","HistoricalDataSymbol":"MXTBBAL","CreateDate":"2014-07-25T14:01:00","FirstValueDate":"1980-01-31T00:00:00","PreviousValue":-881.20,"PreviousValueDate":"2023-07-31T00:00:00"},{"Country":"Mexico","Category":"Banks Balance Sheet","Title":"Mexico Banks Balance Sheet","LatestValueDate":"2023-07-31T00:00:00","LatestValue":10602555.40,"Source":"Banco de México","SourceURL":"http://www.banxico.org.mx","Unit":"MXN Million","URL":"/mexico/banks-balance-sheet","CategoryGroup":"Money","Adjustment":"NSA","Frequency":"Monthly","HistoricalDataSymbol":"MEXICOBANBALSHE","CreateDate":"2014-09-08T15:29:00","FirstValueDate":"2000-12-31T00:00:00","PreviousValue":10485011.08,"PreviousValueDate":"2023-06-30T00:00:00"}]
Country,Category,Title,LatestValueDate,LatestValue,Source,SourceURL,Unit,URL,CategoryGroup,Adjustment,Frequency,HistoricalDataSymbol,CreateDate,FirstValueDate,PreviousValue,PreviousValueDate
Mexico,Auto Exports,Mexico Auto Exports,8/31/2023 12:00:00 AM,287.85,Instituto Nacional de Estadística y Geografía (INEGI),https://www.inegi.org.mx/,Thousand Units,/mexico/auto-exports,Trade,NSA,Monthly,MEXICOAUTEXP,7/23/2019 12:20:00 PM,1/31/1988 12:00:00 AM,275.77,7/31/2023 12:00:00 AM
Mexico,Balance of Trade,Mexico Balance of Trade,8/31/2023 12:00:00 AM,-1377.09,Instituto Nacional de Estadística y Geografía (INEGI),https://www.inegi.org.mx/,USD Million,/mexico/balance-of-trade,Trade,NSA,Monthly,MXTBBAL,7/25/2014 2:01:00 PM,1/31/1980 12:00:00 AM,-881.20,7/31/2023 12:00:00 AM
Mexico,Banks Balance Sheet,Mexico Banks Balance Sheet,7/31/2023 12:00:00 AM,10602555.40,Banco de México,http://www.banxico.org.mx,MXN Million,/mexico/banks-balance-sheet,Money,NSA,Monthly,MEXICOBANBALSHE,9/8/2014 3:29:00 PM,12/31/2000 12:00:00 AM,10485011.08,6/30/2023 12:00:00 AM
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ArrayOfCountryIndicator xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<CountryIndicator>
<Adjustment>NSA</Adjustment>
<Category>Auto Exports</Category>
<CategoryGroup>Trade</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2019-07-23T12:20:00</CreateDate>
<FirstValueDate>1988-01-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MEXICOAUTEXP</HistoricalDataSymbol>
<LatestValue>287.85</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<PreviousValue>275.77</PreviousValue>
<PreviousValueDate>2023-07-31T00:00:00</PreviousValueDate>
<Source>Instituto Nacional de Estadística y Geografía (INEGI)</Source>
<SourceURL>https://www.inegi.org.mx/</SourceURL>
<Title>Mexico Auto Exports</Title>
<URL>/mexico/auto-exports</URL>
<Unit>Thousand Units</Unit>
</CountryIndicator>
<CountryIndicator>
<Adjustment>NSA</Adjustment>
<Category>Balance of Trade</Category>
<CategoryGroup>Trade</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2014-07-25T14:01:00</CreateDate>
<FirstValueDate>1980-01-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MXTBBAL</HistoricalDataSymbol>
<LatestValue>-1377.09</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<PreviousValue>-881.20</PreviousValue>
<PreviousValueDate>2023-07-31T00:00:00</PreviousValueDate>
<Source>Instituto Nacional de Estadística y Geografía (INEGI)</Source>
<SourceURL>https://www.inegi.org.mx/</SourceURL>
<Title>Mexico Balance of Trade</Title>
<URL>/mexico/balance-of-trade</URL>
<Unit>USD Million</Unit>
</CountryIndicator>
<CountryIndicator>
<Adjustment>NSA</Adjustment>
<Category>Banks Balance Sheet</Category>
<CategoryGroup>Money</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2014-09-08T15:29:00</CreateDate>
<FirstValueDate>2000-12-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MEXICOBANBALSHE</HistoricalDataSymbol>
<LatestValue>10602555.40</LatestValue>
<LatestValueDate>2023-07-31T00:00:00</LatestValueDate>
<PreviousValue>10485011.08</PreviousValue>
<PreviousValueDate>2023-06-30T00:00:00</PreviousValueDate>
<Source>Banco de México</Source>
<SourceURL>http://www.banxico.org.mx</SourceURL>
<Title>Mexico Banks Balance Sheet</Title>
<URL>/mexico/banks-balance-sheet</URL>
<Unit>MXN Million</Unit>
</CountryIndicator>
</ArrayOfCountryIndicator>
Please consider that not all indicators are displayed and if you want a comprehensive list of all indicators that we have available you will need pass a category group argument as displayed in an example below.
Data by Country and Category Group
Category groups = (health, markets, taxes, gdp, housing, trade, climate, labour, overview, prices, government, consumer, business, money)
Using Requests:
import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/country/mexico?c={api_key}&group=gdp'
data = requests.get(url).json()
print(data)
Or using our package:
te.getIndicatorByCategoryGroup(country='mexico', category_group='gdp')
Using Requests:
const axios = require('axios');
(async () => {
const api_key = 'YOUR_API_KEY'
const response = await axios.get(`https://api.tradingeconomics.com/country/mexico?c=${api_key}&group=gdp`)
console.log(response.data)
})()
Or using our package:
data = te.getIndicatorData(country = 'mexico', group = 'gdp' ).then(function(data){
console.log(data)
});
Using Requests:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/country/mexico?c=your_api_key&group=gdp");
/country/{country}?c=your_api_key&group={group}
| Country | Category | Title | LatestValueDate | LatestValue | Source | SourceURL | Unit | URL | CategoryGroup | Adjustment | Frequency | HistoricalDataSymbol | CreateDate | FirstValueDate | PreviousValue | PreviousValueDate |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mexico | Full Year GDP Growth | Mexico Full Year Gdp Growth | 12/31/2022 12:00:00 AM | 3.10 | Instituto Nacional de Estadística y Geografía (INEGI) | https://www.inegi.org.mx | percent | /mexico/full-year-gdp-growth | GDP | NSA | Yearly | MEXFYGG | 1/31/2022 6:49:00 PM | 12/31/1994 12:00:00 AM | 5.00 | 12/31/2021 12:00:00 AM |
| Mexico | GDP | Mexico GDP | 12/31/2022 12:00:00 AM | 1414.19 | World Bank | https://www.worldbank.org/ | USD Billion | /mexico/gdp | GDP | Current USD | Yearly | WGDPMEXI | 7/3/2014 3:32:00 PM | 12/31/1960 12:00:00 AM | 1272.84 | 12/31/2021 12:00:00 AM |
| Mexico | GDP Aggregate Demand QoQ | Mexico GDP Aggregate Demand QoQ | 3/31/2023 12:00:00 AM | 1.80 | Instituto Nacional de Estadística y Geografía (INEGI) | https://www.inegi.org.mx | percent | /mexico/gdp-aggregate-demand-qoq | GDP | SA | Quarterly | MEXGADQ | 11/3/2021 1:25:00 PM | 6/30/1993 12:00:00 AM | 0.00 | 12/31/2022 12:00:00 AM |
/country/{country}?c=your_api_key&group={group}?f=json
[{"Country":"Mexico","Category":"Full Year GDP Growth","Title":"Mexico Full Year Gdp Growth","LatestValueDate":"2022-12-31T00:00:00","LatestValue":3.10,"Source":"Instituto Nacional de Estadística y Geografía (INEGI)","SourceURL":"https://www.inegi.org.mx","Unit":"percent","URL":"/mexico/full-year-gdp-growth","CategoryGroup":"GDP","Adjustment":"NSA","Frequency":"Yearly","HistoricalDataSymbol":"MEXFYGG","CreateDate":"2022-01-31T18:49:00","FirstValueDate":"1994-12-31T00:00:00","PreviousValue":5.00,"PreviousValueDate":"2021-12-31T00:00:00"},{"Country":"Mexico","Category":"GDP","Title":"Mexico GDP","LatestValueDate":"2022-12-31T00:00:00","LatestValue":1414.19,"Source":"World Bank","SourceURL":"https://www.worldbank.org/","Unit":"USD Billion","URL":"/mexico/gdp","CategoryGroup":"GDP","Adjustment":"Current USD","Frequency":"Yearly","HistoricalDataSymbol":"WGDPMEXI","CreateDate":"2014-07-03T15:32:00","FirstValueDate":"1960-12-31T00:00:00","PreviousValue":1272.84,"PreviousValueDate":"2021-12-31T00:00:00"},{"Country":"Mexico","Category":"GDP Aggregate Demand QoQ","Title":"Mexico GDP Aggregate Demand QoQ","LatestValueDate":"2023-06-30T00:00:00","LatestValue":1.30,"Source":"Instituto Nacional de Estadística y Geografía (INEGI)","SourceURL":"https://www.inegi.org.mx","Unit":"percent","URL":"/mexico/gdp-aggregate-demand-qoq","CategoryGroup":"GDP","Adjustment":"SA","Frequency":"Quarterly","HistoricalDataSymbol":"MEXGADQ","CreateDate":"2021-11-03T13:25:00","FirstValueDate":"1993-06-30T00:00:00","PreviousValue":1.50,"PreviousValueDate":"2023-03-31T00:00:00"}]
/country/{country}?c=your_api_key&group={group}?f=csv
Country,Category,Title,LatestValueDate,LatestValue,Source,SourceURL,Unit,URL,CategoryGroup,Adjustment,Frequency,HistoricalDataSymbol,CreateDate,FirstValueDate,PreviousValue,PreviousValueDate
Mexico,Full Year GDP Growth,Mexico Full Year Gdp Growth,12/31/2022 12:00:00 AM,3.10,Instituto Nacional de Estadística y Geografía (INEGI),https://www.inegi.org.mx,percent,/mexico/full-year-gdp-growth,GDP,NSA,Yearly,MEXFYGG,1/31/2022 6:49:00 PM,12/31/1994 12:00:00 AM,5.00,12/31/2021 12:00:00 AM
Mexico,GDP,Mexico GDP,12/31/2022 12:00:00 AM,1414.19,World Bank,https://www.worldbank.org/,USD Billion,/mexico/gdp,GDP,Current USD,Yearly,WGDPMEXI,7/3/2014 3:32:00 PM,12/31/1960 12:00:00 AM,1272.84,12/31/2021 12:00:00 AM
Mexico,GDP Aggregate Demand QoQ,Mexico GDP Aggregate Demand QoQ,6/30/2023 12:00:00 AM,1.30,Instituto Nacional de Estadística y Geografía (INEGI),https://www.inegi.org.mx,percent,/mexico/gdp-aggregate-demand-qoq,GDP,SA,Quarterly,MEXGADQ,11/3/2021 1:25:00 PM,6/30/1993 12:00:00 AM,1.50,3/31/2023 12:00:00 AM
/country/{country}?c=your_api_key&group={group}?f=xml
<ArrayOfCountryIndicator xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<CountryIndicator>
<Adjustment>NSA</Adjustment>
<Category>Full Year GDP Growth</Category>
<CategoryGroup>GDP</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2022-01-31T18:49:00</CreateDate>
<FirstValueDate>1994-12-31T00:00:00</FirstValueDate>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>MEXFYGG</HistoricalDataSymbol>
<LatestValue>3.10</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<PreviousValue>5.00</PreviousValue>
<PreviousValueDate>2021-12-31T00:00:00</PreviousValueDate>
<Source>Instituto Nacional de Estadística y Geografía (INEGI)</Source>
<SourceURL>https://www.inegi.org.mx</SourceURL>
<Title>Mexico Full Year Gdp Growth</Title>
<URL>/mexico/full-year-gdp-growth</URL>
<Unit>percent</Unit>
</CountryIndicator>
<CountryIndicator>
<Adjustment>Current USD</Adjustment>
<Category>GDP</Category>
<CategoryGroup>GDP</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2014-07-03T15:32:00</CreateDate>
<FirstValueDate>1960-12-31T00:00:00</FirstValueDate>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>WGDPMEXI</HistoricalDataSymbol>
<LatestValue>1414.19</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<PreviousValue>1272.84</PreviousValue>
<PreviousValueDate>2021-12-31T00:00:00</PreviousValueDate>
<Source>World Bank</Source>
<SourceURL>https://www.worldbank.org/</SourceURL>
<Title>Mexico GDP</Title>
<URL>/mexico/gdp</URL>
<Unit>USD Billion</Unit>
</CountryIndicator>
<CountryIndicator>
<Adjustment>SA</Adjustment>
<Category>GDP Aggregate Demand QoQ</Category>
<CategoryGroup>GDP</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2021-11-03T13:25:00</CreateDate>
<FirstValueDate>1993-06-30T00:00:00</FirstValueDate>
<Frequency>Quarterly</Frequency>
<HistoricalDataSymbol>MEXGADQ</HistoricalDataSymbol>
<LatestValue>1.30</LatestValue>
<LatestValueDate>2023-06-30T00:00:00</LatestValueDate>
<PreviousValue>1.50</PreviousValue>
<PreviousValueDate>2023-03-31T00:00:00</PreviousValueDate>
<Source>Instituto Nacional de Estadística y Geografía (INEGI)</Source>
<SourceURL>https://www.inegi.org.mx</SourceURL>
<Title>Mexico GDP Aggregate Demand QoQ</Title>
<URL>/mexico/gdp-aggregate-demand-qoq</URL>
<Unit>percent</Unit>
</CountryIndicator>
</ArrayOfCountryIndicator>
Countries by Indicator
Using Requests:
import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/country/all/gdp?c={api_key}'
data = requests.get(url).json()
print(data)
Or using our package:
te.getIndicatorData(indicators='gdp')
Using Requests:
const axios = require('axios');
(async () => {
const api_key = 'YOUR_API_KEY'
const response = await axios.get(`https://api.tradingeconomics.com/country/all/gdp?c=${api_key}`)
console.log(response.data)
})()
Or using our package:
data = te.getIndicatorData(indicator = 'gdp').then(function(data){
console.log(data)
});
Using Requests:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/country/all/gdp?c=your_api_key");
| Country | Category | Title | LatestValueDate | LatestValue | Source | SourceURL | Unit | URL | CategoryGroup | Adjustment | Frequency | HistoricalDataSymbol | CreateDate | FirstValueDate | PreviousValue | PreviousValueDate |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Afghanistan | GDP | Afghanistan GDP | 12/31/2021 12:00:00 AM | 14.58 | World Bank | https://www.worldbank.org/ | USD Billion | /afghanistan/gdp | GDP | Current USD | Yearly | AFGSTANGDP | 11/7/2012 2:06:00 PM | 12/31/1960 12:00:00 AM | 20.14 | 12/31/2020 12:00:00 AM |
| Albania | GDP | Albania GDP | 12/31/2022 12:00:00 AM | 18.88 | World Bank | https://www.worldbank.org/ | USD Billion | /albania/gdp | GDP | Current USD | Yearly | ALBANIAGDP | 10/8/2012 1:36:00 PM | 12/31/1984 12:00:00 AM | 17.93 | 12/31/2021 12:00:00 AM |
| Algeria | GDP | Algeria GDP | 12/31/2022 12:00:00 AM | 191.91 | World Bank | https://algeria/gdp | USD Billion | /afghanistan/gdp | GDP | Current USD | Yearly | AlgeriaGDP | 6/27/2011 12:00:00 AM | 12/31/1960 12:00:00 AM | 163.47 | 12/31/2021 12:00:00 AM |
/country/all/{indicator}?f=json
[{"Country":"Afghanistan","Category":"GDP","Title":"Afghanistan GDP","LatestValueDate":"2021-12-31T00:00:00","LatestValue":14.58,"Source":"World Bank","SourceURL":"https://www.worldbank.org/","Unit":"USD Billion","URL":"/afghanistan/gdp","CategoryGroup":"GDP","Adjustment":"Current USD","Frequency":"Yearly","HistoricalDataSymbol":"AFGSTANGDP","CreateDate":"2012-11-07T14:06:00","FirstValueDate":"1960-12-31T00:00:00","PreviousValue":20.14,"PreviousValueDate":"2020-12-31T00:00:00"},{"Country":"Albania","Category":"GDP","Title":"Albania GDP","LatestValueDate":"2022-12-31T00:00:00","LatestValue":18.88,"Source":"World Bank","SourceURL":"https://www.worldbank.org/","Unit":"USD Billion","URL":"/albania/gdp","CategoryGroup":"GDP","Adjustment":"Current USD","Frequency":"Yearly","HistoricalDataSymbol":"ALBANIAGDP","CreateDate":"2012-10-08T13:36:00","FirstValueDate":"1984-12-31T00:00:00","PreviousValue":17.93,"PreviousValueDate":"2021-12-31T00:00:00"},{"Country":"Algeria","Category":"GDP","Title":"Algeria GDP","LatestValueDate":"2022-12-31T00:00:00","LatestValue":191.91,"Source":"World Bank","SourceURL":"https://www.worldbank.org/","Unit":"USD Billion","URL":"/algeria/gdp","CategoryGroup":"GDP","Adjustment":"Current USD","Frequency":"Yearly","HistoricalDataSymbol":"AlgeriaGDP","CreateDate":"2011-06-27T00:00:00","FirstValueDate":"1960-12-31T00:00:00","PreviousValue":163.47,"PreviousValueDate":"2021-12-31T00:00:00"}]
/country/all/{indicator}?f=csv
Country,Category,Title,LatestValueDate,LatestValue,Source,SourceURL,Unit,URL,CategoryGroup,Adjustment,Frequency,HistoricalDataSymbol,CreateDate,FirstValueDate,PreviousValue,PreviousValueDate
Afghanistan,GDP,Afghanistan GDP,12/31/2021 12:00:00 AM,14.58,World Bank,https://www.worldbank.org/,USD Billion,/afghanistan/gdp,GDP,Current USD,Yearly,AFGSTANGDP,11/7/2012 2:06:00 PM,12/31/1960 12:00:00 AM,20.14,12/31/2020 12:00:00 AM
Albania,GDP,Albania GDP,12/31/2022 12:00:00 AM,18.88,World Bank,https://www.worldbank.org/,USD Billion,/albania/gdp,GDP,Current USD,Yearly,ALBANIAGDP,10/8/2012 1:36:00 PM,12/31/1984 12:00:00 AM,17.93,12/31/2021 12:00:00 AM
Algeria,GDP,Algeria GDP,12/31/2022 12:00:00 AM,191.91,World Bank,https://www.worldbank.org/,USD Billion,/algeria/gdp,GDP,Current USD,Yearly,AlgeriaGDP,6/27/2011 12:00:00 AM,12/31/1960 12:00:00 AM,163.47,12/31/2021 12:00:00 AM
/country/all/{indicator}?f=xml
<ArrayOfCountryIndicator xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<CountryIndicator>
<Adjustment>Current USD</Adjustment>
<Category>GDP</Category>
<CategoryGroup>GDP</CategoryGroup>
<Country>Afghanistan</Country>
<CreateDate>2012-11-07T14:06:00</CreateDate>
<FirstValueDate>1960-12-31T00:00:00</FirstValueDate>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>AFGSTANGDP</HistoricalDataSymbol>
<LatestValue>14.58</LatestValue>
<LatestValueDate>2021-12-31T00:00:00</LatestValueDate>
<PreviousValue>20.14</PreviousValue>
<PreviousValueDate>2020-12-31T00:00:00</PreviousValueDate>
<Source>World Bank</Source>
<SourceURL>https://www.worldbank.org/</SourceURL>
<Title>Afghanistan GDP</Title>
<URL>/afghanistan/gdp</URL>
<Unit>USD Billion</Unit>
</CountryIndicator>
<CountryIndicator>
<Adjustment>Current USD</Adjustment>
<Category>GDP</Category>
<CategoryGroup>GDP</CategoryGroup>
<Country>Albania</Country>
<CreateDate>2012-10-08T13:36:00</CreateDate>
<FirstValueDate>1984-12-31T00:00:00</FirstValueDate>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>ALBANIAGDP</HistoricalDataSymbol>
<LatestValue>18.88</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<PreviousValue>17.93</PreviousValue>
<PreviousValueDate>2021-12-31T00:00:00</PreviousValueDate>
<Source>World Bank</Source>
<SourceURL>https://www.worldbank.org/</SourceURL>
<Title>Albania GDP</Title>
<URL>/albania/gdp</URL>
<Unit>USD Billion</Unit>
</CountryIndicator>
<CountryIndicator>
<Adjustment>Current USD</Adjustment>
<Category>GDP</Category>
<CategoryGroup>GDP</CategoryGroup>
<Country>Algeria</Country>
<CreateDate>2011-06-27T00:00:00</CreateDate>
<FirstValueDate>1960-12-31T00:00:00</FirstValueDate>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>AlgeriaGDP</HistoricalDataSymbol>
<LatestValue>191.91</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<PreviousValue>163.47</PreviousValue>
<PreviousValueDate>2021-12-31T00:00:00</PreviousValueDate>
<Source>World Bank</Source>
<SourceURL>https://www.worldbank.org/</SourceURL>
<Title>Algeria GDP</Title>
<URL>/algeria/gdp</URL>
<Unit>USD Billion</Unit>
</CountryIndicator>
</ArrayOfCountryIndicator>
By ticker
Using Requests:
import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/country/ticker/usurtot?c={api_key}'
data = requests.get(url).json()
print(data)
Or using our package:
te.getIndicatorByTicker(ticker='usurtot')
Using Requests:
const axios = require('axios');
(async () => {
const api_key = 'YOUR_API_KEY'
const response = await axios.get(`https://api.tradingeconomics.com/country/ticker/usurtot?c=${api_key}`)
console.log(response.data)
})()
Or using our package:
data = te.getIndicatorData(ticker = 'usurtot').then(function(data){
console.log(data)
});
Using Requests:
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/country/ticker/usurtot?c=your_api_key");
| Country | Category | Title | LatestValueDate | LatestValue | Source | SourceURL | Unit | URL | CategoryGroup | Adjustment | Frequency | HistoricalDataSymbol | CreateDate | FirstValueDate | PreviousValue | PreviousValueDate |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| United States | Unemployment Rate | United States Unemployment Rate | 6/30/2023 12:00:00 AM | 3.60 | U.S. Bureau of Labor Statistics | https://www.bls.gov/ | percent | /united-states/unemployment-rate | Labour | Monthly | USURTOT | 2/23/2012 11:41:00 AM | 1/31/1948 12:00:00 AM | 3.70 | 5/31/2023 12:00:00 AM |
/country/ticker/{ticker}?f=json
[{"Country":"United States","Category":"Unemployment Rate","Title":"United States Unemployment Rate","LatestValueDate":"2023-09-30T00:00:00","LatestValue":3.80,"Source":"U.S. Bureau of Labor Statistics","SourceURL":"http://www.bls.gov/","Unit":"percent","URL":"/united-states/unemployment-rate","CategoryGroup":"Labour","Adjustment":"","Frequency":"Monthly","HistoricalDataSymbol":"USURTOT","CreateDate":"2012-02-23T11:41:00","FirstValueDate":"1948-01-31T00:00:00","PreviousValue":3.80,"PreviousValueDate":"2023-08-31T00:00:00"}]
/country/ticker/{ticker}?f=csv
Country,Category,Title,LatestValueDate,LatestValue,Source,SourceURL,Unit,URL,CategoryGroup,Adjustment,Frequency,HistoricalDataSymbol,CreateDate,FirstValueDate,PreviousValue,PreviousValueDate
United States,Unemployment Rate,United States Unemployment Rate,9/30/2023 12:00:00 AM,3.80,U.S. Bureau of Labor Statistics,http://www.bls.gov/,percent,/united-states/unemployment-rate,Labour,,Monthly,USURTOT,2/23/2012 11:41:00 AM,1/31/1948 12:00:00 AM,3.80,8/31/2023 12:00:00 AM
/country/ticker/{ticker}?f=xml
<ArrayOfCountryIndicator xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<CountryIndicator>
<Adjustment/>
<Category>Unemployment Rate</Category>
<CategoryGroup>Labour</CategoryGroup>
<Country>United States</Country>
<CreateDate>2012-02-23T11:41:00</CreateDate>
<FirstValueDate>1948-01-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>USURTOT</HistoricalDataSymbol>
<LatestValue>3.80</LatestValue>
<LatestValueDate>2023-09-30T00:00:00</LatestValueDate>
<PreviousValue>3.80</PreviousValue>
<PreviousValueDate>2023-08-31T00:00:00</PreviousValueDate>
<Source>U.S. Bureau of Labor Statistics</Source>
<SourceURL>http://www.bls.gov/</SourceURL>
<Title>United States Unemployment Rate</Title>
<URL>/united-states/unemployment-rate</URL>
<Unit>percent</Unit>
</CountryIndicator>
</ArrayOfCountryIndicator>
Response fields
| Field | Type | Description | Example |
|---|---|---|---|
| Country | string | Name of the country associated with the indicator. | “Algeria” |
| Category | string | Name of the economic indicator or data category. | “Auto Exports”, |
| Title | string | Combined label of country and category. | “Mexico Auto Exports” |
| LatestValueDate | string | Date of the most recently released value, in UTC. | “2023-03-31T00:00:00” |
| LatestValue | number | Most recent published value for the indicator. | 272.69 |
| Source | string | Name of the organization or authority that provided the data. | “Instituto Nacional de Estadística y Geografía (INEGI)” |
| SourceURL | string | Direct URL link to the original data source (if available). | “https://www.inegi.org.mx/” |
| Unit | string | Unit of measurement for the value. | “Thousand Units” |
| URL | string | Hyperlink to the indicator page on Trading Economics. | “/mexico/auto-exports” |
| CategoryGroup | string | Broad classification group for the indicator. | “Trade” |
| Adjustment | string | Description of any adjustments. | “Current USD |
| Frequency | string | Frequency of data release. | “Daily” |
| HistoricalDataSymbol | string | Unique identifier used by Trading Economics for the data series. | “MEXICOAUTEXP” |
| CreateDate | string | Date and time when the indicator was added to the database | “2019-07-23T12:20:00” |
| FirstValueDate | string | Date of the earliest available historical value. | “1988-01-31T00:00:00” |
| PreviousValue | number | Value released prior to the latest one. | 230.48 |
| PreviousValueDate | string | Release date of the previous value. | “2023-02-28T00:00:00” |