Indicators Snapshot of Latest Values

The endpoints below return a snapshot table with the current values representing the latest figures for economic indicators across 196+ countries.

Data by country | Data by Country and Category Group | Countries by Indicator | By ticker | Credit Ratings | Response fields

Data by country

Using Requests:

import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/country/mexico?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.getIndicatorData(country='mexico')

With multi countries:

te.getIndicatorData(country=['mexico', 'sweden'])

Using Requests:

const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/country/mexico?c=${your_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.

https://api.tradingeconomics.com/country/{country}?c={your_api_key}&f=json
[
  {
    "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.2,
    "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.4,
    "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"
  }
]
https://api.tradingeconomics.com/country/{country}?c={your_api_key}&f=csv
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
https://api.tradingeconomics.com/country/{country}?c={your_api_key}&f=xml
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>
https://api.tradingeconomics.com/country/{country}?c={your_api_key}
CountryCategoryTitleLatestValueDateLatestValueSourceSourceURLUnitURLCategoryGroupAdjustmentFrequencyHistoricalDataSymbolCreateDateFirstValueDatePreviousValuePreviousValueDate
MexicoAuto ExportsMexico Auto Exports6/30/2023 12:00:00 AM286.29Instituto Nacional de Estadística y Geografía (INEGI)https://www.inegi.org.mx/Thousand Units/mexico/auto-exportsTradeNSAMonthlyMEXICOAUTEXP7/23/2019 12:20:00 PM1/31/1988 12:00:00 AM279.275/31/2023 12:00:00 AM
MexicoBalance of TradeMexico Balance of Trade5/31/2023 12:00:00 AM-74.00Instituto Nacional de Estadística y Geografía (INEGI)https://www.inegi.org.mx/USD Million/mexico/balance-of-tradeTradeNSAMonthlyMXTBBAL7/25/2014 2:01:00 PM1/31/1980 12:00:00 AM-1509.004/30/2023 12:00:00 AM
MexicoBanks Balance SheetMexico Banks Balance Sheet4/30/2023 12:00:00 AM10335903.02Banco de Méxicohttps://www.banxico.org.mxMXN Million/mexico/banks-balance-sheetTradeNSAMonthlyMEXICOBANBALSHE9/8/2014 3:29:00 PM12/31/2000 12:00:00 AM10169075.643/31/2023 12:00:00 AM

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
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/country/mexico?c={your_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 your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/country/mexico?c=${your_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");
https://api.tradingeconomics.com/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.1,
    "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.0,
    "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.3,
    "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.5,
    "PreviousValueDate": "2023-03-31T00:00:00"
  }
]
https://api.tradingeconomics.com/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
https://api.tradingeconomics.com/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>
https://api.tradingeconomics.com/country/{country}?c={your_api_key}&group={group}
CountryCategoryTitleLatestValueDateLatestValueSourceSourceURLUnitURLCategoryGroupAdjustmentFrequencyHistoricalDataSymbolCreateDateFirstValueDatePreviousValuePreviousValueDate
MexicoFull Year GDP GrowthMexico Full Year Gdp Growth12/31/2022 12:00:00 AM3.10Instituto Nacional de Estadística y Geografía (INEGI)https://www.inegi.org.mxpercent/mexico/full-year-gdp-growthGDPNSAYearlyMEXFYGG1/31/2022 6:49:00 PM12/31/1994 12:00:00 AM5.0012/31/2021 12:00:00 AM
MexicoGDPMexico GDP12/31/2022 12:00:00 AM1414.19World Bankhttps://www.worldbank.org/USD Billion/mexico/gdpGDPCurrent USDYearlyWGDPMEXI7/3/2014 3:32:00 PM12/31/1960 12:00:00 AM1272.8412/31/2021 12:00:00 AM
MexicoGDP Aggregate Demand QoQMexico GDP Aggregate Demand QoQ3/31/2023 12:00:00 AM1.80Instituto Nacional de Estadística y Geografía (INEGI)https://www.inegi.org.mxpercent/mexico/gdp-aggregate-demand-qoqGDPSAQuarterlyMEXGADQ11/3/2021 1:25:00 PM6/30/1993 12:00:00 AM0.0012/31/2022 12:00:00 AM

Countries by Indicator

Using Requests:

import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/country/all/gdp?c={your_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 your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/country/all/gdp?c=${your_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");
https://api.tradingeconomics.com/country/all/{indicator}?c={your_api_key}&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"
  }
]
https://api.tradingeconomics.com/country/all/{indicator}?c={your_api_key}&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
https://api.tradingeconomics.com/country/all/{indicator}?c={your_api_key}&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>
https://api.tradingeconomics.com/country/all/{indicator}?c={your_api_key}
CountryCategoryTitleLatestValueDateLatestValueSourceSourceURLUnitURLCategoryGroupAdjustmentFrequencyHistoricalDataSymbolCreateDateFirstValueDatePreviousValuePreviousValueDate
AfghanistanGDPAfghanistan GDP12/31/2021 12:00:00 AM14.58World Bankhttps://www.worldbank.org/USD Billion/afghanistan/gdpGDPCurrent USDYearlyAFGSTANGDP11/7/2012 2:06:00 PM12/31/1960 12:00:00 AM20.1412/31/2020 12:00:00 AM
AlbaniaGDPAlbania GDP12/31/2022 12:00:00 AM18.88World Bankhttps://www.worldbank.org/USD Billion/albania/gdpGDPCurrent USDYearlyALBANIAGDP10/8/2012 1:36:00 PM12/31/1984 12:00:00 AM17.9312/31/2021 12:00:00 AM
AlgeriaGDPAlgeria GDP12/31/2022 12:00:00 AM191.91World Bankhttps://algeria/gdpUSD Billion/afghanistan/gdpGDPCurrent USDYearlyAlgeriaGDP6/27/2011 12:00:00 AM12/31/1960 12:00:00 AM163.4712/31/2021 12:00:00 AM

By ticker

Using Requests:

import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/country/ticker/usurtot?c={your_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 your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/country/ticker/usurtot?c=${your_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");
https://api.tradingeconomics.com/country/ticker/{ticker}?c={your_api_key}&f=json
[
  {
    "Country": "United States",
    "Category": "Unemployment Rate",
    "Title": "United States Unemployment Rate",
    "LatestValueDate": "2023-09-30T00:00:00",
    "LatestValue": 3.8,
    "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.8,
    "PreviousValueDate": "2023-08-31T00:00:00"
  }
]
https://api.tradingeconomics.com/country/ticker/{ticker}?c={your_api_key}&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
https://api.tradingeconomics.com/country/ticker/{ticker}?c={your_api_key}&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>
https://api.tradingeconomics.com/country/ticker/{ticker}?c={your_api_key}
CountryCategoryTitleLatestValueDateLatestValueSourceSourceURLUnitURLCategoryGroupAdjustmentFrequencyHistoricalDataSymbolCreateDateFirstValueDatePreviousValuePreviousValueDate
United StatesUnemployment RateUnited States Unemployment Rate6/30/2023 12:00:00 AM3.60U.S. Bureau of Labor Statisticshttps://www.bls.gov/percent/united-states/unemployment-rateLabourMonthlyUSURTOT2/23/2012 11:41:00 AM1/31/1948 12:00:00 AM3.705/31/2023 12:00:00 AM

Credit Ratings

Sovereign credit ratings as reported by major credit rating agencies. For historical ratings and more details, see the dedicated Credit Ratings page.

Using Requests:

import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/credit-ratings?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.getCreditRatings()

With multi countries

te.getCreditRatings(country=['mexico','sweden'])

Using Requests:

const axios = require("axios");
(async () => {
  const your_api_key = "your_api_key";
  const response = await axios.get(
    `https://api.tradingeconomics.com/credit-ratings?c=${your_api_key}`
  );
  console.log(response.data);
})();

Or using our package:

const te = require("tradingeconomics");
te.login("your_api_key");
data = te.getCreditRatings().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/credit-ratings?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/credit-ratings/country/mexico,sweden?c=your_api_key");
https://api.tradingeconomics.com/credit-ratings?c={your_api_key}&f=json
[
  {
    "Country": "Kazakhstan",
    "Date": "10/27/2023",
    "Agency": "Moody's",
    "Rating": "Baa2",
    "Outlook": "Positive"
  },
  {
    "Country": "Isle of Man",
    "Date": "10/27/2023",
    "Agency": "Moody's",
    "Rating": "Aa3",
    "Outlook": "Stable"
  },
  {
    "Country": "Costa Rica",
    "Date": "10/27/2023",
    "Agency": "S&P",
    "Rating": "BB-",
    "Outlook": "Stable"
  }
]
https://api.tradingeconomics.com/credit-ratings?c={your_api_key}&f=csv
Country,Date,Agency,Rating,Outlook
Kazakhstan,10/27/2023,Moody's,Baa2,Positive
Isle of Man,10/27/2023,Moody's,Aa3,Stable
Costa Rica,10/27/2023,S&P,BB-,Stable
https://api.tradingeconomics.com/credit-ratings?c={your_api_key}&f=xml
<ArrayOfRatingsData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<RatingsHistoricalData>
<Agency>Moody's</Agency>
<Country>Kazakhstan</Country>
<Date>10/27/2023</Date>
<Outlook>Positive</Outlook>
<Rating>Baa2</Rating>
</RatingsHistoricalData>
<RatingsHistoricalData>
<Agency>Moody's</Agency>
<Country>Isle of Man</Country>
<Date>10/27/2023</Date>
<Outlook>Stable</Outlook>
<Rating>Aa3</Rating>
</RatingsHistoricalData>
<RatingsHistoricalData>
<Agency>S&P</Agency>
<Country>Costa Rica</Country>
<Date>10/27/2023</Date>
<Outlook>Stable</Outlook>
<Rating>BB-</Rating>
</RatingsHistoricalData>
</ArrayOfRatingsData>
https://api.tradingeconomics.com/credit-ratings?c={your_api_key}
CountryDateAgencyRatingOutlook
Kazakhstan10/27/2023Moody’sBaa2Positive
Isle of Man10/27/2023Moody’sAa3Stable
Costa Rica10/27/2023S&PBB-Stable

Response fields

FieldTypeDescriptionExample
CountrystringName of the country associated with the indicator.“Algeria”
CategorystringName of the economic indicator or data category.“Auto Exports”,
TitlestringCombined label of country and category.“Mexico Auto Exports”
LatestValueDatestringDate of the most recently released value, in UTC.“2023-03-31T00:00:00”
LatestValuenumberMost recent published value for the indicator.272.69
SourcestringName of the organization or authority that provided the data.“Instituto Nacional de Estadística y Geografía (INEGI)”
SourceURLstringDirect URL link to the original data source (if available).“https://www.inegi.org.mx/”
UnitstringUnit of measurement for the value.“Thousand Units”
URLstringHyperlink to the indicator page on Trading Economics.“/mexico/auto-exports”
CategoryGroupstringBroad classification group for the indicator.“Trade”
AdjustmentstringDescription of any adjustments.“Current USD
FrequencystringFrequency of data release.“Daily”
HistoricalDataSymbolstringUnique identifier used by Trading Economics for the data series.“MEXICOAUTEXP”
CreateDatestringDate and time when the indicator was added to the database“2019-07-23T12:20:00”
FirstValueDatestringDate of the earliest available historical value.“1988-01-31T00:00:00”
PreviousValuenumberValue released prior to the latest one.230.48
PreviousValueDatestringRelease date of the previous value.“2023-02-28T00:00:00”