Peers

In terms of economic data, peers are typically countries or regions that share similar economic characteristics, such as GDP growth rates, industry composition, demographic profiles, or policy frameworks.

By ticker

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/peers/CPI%20YOY?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

import tradingeconomics as te
te.login('your_api_key')
te.getPeers(ticker='CPI YOY')

Using Requests:

const axios = require('axios');
(async () => {
    const api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/peers/CPI%20YOY?c=${api_key}`)
    console.log(response.data)
})()

Or using our package:

const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getPeers(ticker = 'CPI YOY').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/peers/CPI%20YOY?c=guest:guest"))
    {
        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.

/peers/(ticker)

TickerPeerRelationshipCountryCategoryTitleLatestValueDateLatestValueSourceSourceURLUnitURLCategoryGroupAdjustmentFrequencyHistoricalDataSymbolCreateDateFirstValueDatePreviousValuePreviousValueDate
CPI YOYTEDSTACONPRIINDCP0United StatesConsumer Price Index CPIUnited States Consumer Price Index (CPI)5/31/2023 12:00:00 AM304.13U.S. Bureau of Labor Statisticshttp://www.bls.govpoints/united-states/consumer-price-index-cpiPrices“1982-1984=100, NSA”MonthlyUNITEDSTACONPRIINDCP6/11/2014 9:44:00 AM1/31/1950 12:00:00 AM303.364/30/2023 12:00:00 AM
CPI YOYUNITEDSTACORCONPRI0United StatesCore Consumer PricesUnited States Core Consumer Prices5/31/2023 12:00:00 AM307.82U.S. Bureau of Labor Statisticshttp://www.bls.govpoints/united-states/core-consumer-pricesPrices“1982-1984=100, SA”MonthlyUNITEDSTACORCONPRI6/18/2013 4:46:00 PM1/31/1957 12:00:00 AM306.494/30/2023 12:00:00 AM
CPI YOYUSACORECPIRATE1United StatesCore Inflation RateUnited States Core Inflation Rate5/31/2023 12:00:00 AM5.30U.S. Bureau of Labor Statisticshttps://www.bls.govpercent/united-states/core-inflation-ratePrices“1982-1984=100, NSA”MonthlyUSACORECPIRATE10/2/2012 2:16:00 PM2/28/1957 12:00:00 AM5.504/30/2023 12:00:00 AM

/peers/(ticker)?f=json

[{"Ticker":"CPI YOY","Peer":"UNITEDSTACONPRIINDCP","Relationship":0,"Country":"United States","Category":"Consumer Price Index CPI","Title":"United States Consumer Price Index (CPI)","LatestValueDate":"2023-08-31T00:00:00","LatestValue":307.03,"Source":"U.S. Bureau of Labor Statistics","SourceURL":"http://www.bls.gov","Unit":"points","URL":"/united-states/consumer-price-index-cpi","CategoryGroup":"Prices","Adjustment":"1982-1984=100, NSA","Frequency":"Monthly","HistoricalDataSymbol":"UNITEDSTACONPRIINDCP","CreateDate":"2014-06-11T09:44:00","FirstValueDate":"1950-01-31T00:00:00","PreviousValue":305.69,"PreviousValueDate":"2023-07-31T00:00:00"},{"Ticker":"CPI YOY","Peer":"UNITEDSTACORCONPRI","Relationship":0,"Country":"United States","Category":"Core Consumer Prices","Title":"United States Core Consumer Prices","LatestValueDate":"2023-08-31T00:00:00","LatestValue":309.66,"Source":"U.S. Bureau of Labor Statistics","SourceURL":"http://www.bls.gov","Unit":"points","URL":"/united-states/core-consumer-prices","CategoryGroup":"Prices","Adjustment":"1982-1984=100, SA","Frequency":"Monthly","HistoricalDataSymbol":"UNITEDSTACORCONPRI","CreateDate":"2013-06-18T16:46:00","FirstValueDate":"1957-01-31T00:00:00","PreviousValue":308.80,"PreviousValueDate":"2023-07-31T00:00:00"},{"Ticker":"CPI YOY","Peer":"USACORECPIRATE","Relationship":1,"Country":"United States","Category":"Core Inflation Rate","Title":"United States Core Inflation Rate","LatestValueDate":"2023-08-31T00:00:00","LatestValue":4.30,"Source":"U.S. Bureau of Labor Statistics","SourceURL":"https://www.bls.gov","Unit":"percent","URL":"/united-states/core-inflation-rate","CategoryGroup":"Prices","Adjustment":"1982-1984=100, NSA","Frequency":"Monthly","HistoricalDataSymbol":"USACORECPIRATE","CreateDate":"2012-10-02T14:16:00","FirstValueDate":"1957-02-28T00:00:00","PreviousValue":4.70,"PreviousValueDate":"2023-07-31T00:00:00"}]

/peers/(ticker)?f=csv

Ticker,Peer,Relationship,Country,Category,Title,LatestValueDate,LatestValue,Source,SourceURL,Unit,URL,CategoryGroup,Adjustment,Frequency,HistoricalDataSymbol,CreateDate,FirstValueDate,PreviousValue,PreviousValueDate
CPI YOY,UNITEDSTACONPRIINDCP,0,United States,Consumer Price Index CPI,United States Consumer Price Index (CPI),8/31/2023 12:00:00 AM,307.03,U.S. Bureau of Labor Statistics,http://www.bls.gov,points,/united-states/consumer-price-index-cpi,Prices,"1982-1984=100, NSA",Monthly,UNITEDSTACONPRIINDCP,6/11/2014 9:44:00 AM,1/31/1950 12:00:00 AM,305.69,7/31/2023 12:00:00 AM
CPI YOY,UNITEDSTACORCONPRI,0,United States,Core Consumer Prices,United States Core Consumer Prices,8/31/2023 12:00:00 AM,309.66,U.S. Bureau of Labor Statistics,http://www.bls.gov,points,/united-states/core-consumer-prices,Prices,"1982-1984=100, SA",Monthly,UNITEDSTACORCONPRI,6/18/2013 4:46:00 PM,1/31/1957 12:00:00 AM,308.80,7/31/2023 12:00:00 AM
CPI YOY,USACORECPIRATE,1,United States,Core Inflation Rate,United States Core Inflation Rate,8/31/2023 12:00:00 AM,4.30,U.S. Bureau of Labor Statistics,https://www.bls.gov,percent,/united-states/core-inflation-rate,Prices,"1982-1984=100, NSA",Monthly,USACORECPIRATE,10/2/2012 2:16:00 PM,2/28/1957 12:00:00 AM,4.70,7/31/2023 12:00:00 AM

/peers/(ticker)?f=xml

<ArrayOfCountryIndicatorPeers xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<CountryIndicatorPeers>
<Adjustment>1982-1984=100, NSA</Adjustment>
<Category>Consumer Price Index CPI</Category>
<CategoryGroup>Prices</CategoryGroup>
<Country>United States</Country>
<CreateDate>2014-06-11T09:44:00</CreateDate>
<FirstValueDate>1950-01-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>UNITEDSTACONPRIINDCP</HistoricalDataSymbol>
<LatestValue>307.03</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<Peer>UNITEDSTACONPRIINDCP</Peer>
<PreviousValue>305.69</PreviousValue>
<PreviousValueDate>2023-07-31T00:00:00</PreviousValueDate>
<Relationship>0</Relationship>
<Source>U.S. Bureau of Labor Statistics</Source>
<SourceURL>http://www.bls.gov</SourceURL>
<Ticker>CPI YOY</Ticker>
<Title>United States Consumer Price Index (CPI)</Title>
<URL>/united-states/consumer-price-index-cpi</URL>
<Unit>points</Unit>
</CountryIndicatorPeers>
<CountryIndicatorPeers>
<Adjustment>1982-1984=100, SA</Adjustment>
<Category>Core Consumer Prices</Category>
<CategoryGroup>Prices</CategoryGroup>
<Country>United States</Country>
<CreateDate>2013-06-18T16:46:00</CreateDate>
<FirstValueDate>1957-01-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>UNITEDSTACORCONPRI</HistoricalDataSymbol>
<LatestValue>309.66</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<Peer>UNITEDSTACORCONPRI</Peer>
<PreviousValue>308.80</PreviousValue>
<PreviousValueDate>2023-07-31T00:00:00</PreviousValueDate>
<Relationship>0</Relationship>
<Source>U.S. Bureau of Labor Statistics</Source>
<SourceURL>http://www.bls.gov</SourceURL>
<Ticker>CPI YOY</Ticker>
<Title>United States Core Consumer Prices</Title>
<URL>/united-states/core-consumer-prices</URL>
<Unit>points</Unit>
</CountryIndicatorPeers>
<CountryIndicatorPeers>
<Adjustment>1982-1984=100, NSA</Adjustment>
<Category>Core Inflation Rate</Category>
<CategoryGroup>Prices</CategoryGroup>
<Country>United States</Country>
<CreateDate>2012-10-02T14:16:00</CreateDate>
<FirstValueDate>1957-02-28T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>USACORECPIRATE</HistoricalDataSymbol>
<LatestValue>4.30</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<Peer>USACORECPIRATE</Peer>
<PreviousValue>4.70</PreviousValue>
<PreviousValueDate>2023-07-31T00:00:00</PreviousValueDate>
<Relationship>1</Relationship>
<Source>U.S. Bureau of Labor Statistics</Source>
<SourceURL>https://www.bls.gov</SourceURL>
<Ticker>CPI YOY</Ticker>
<Title>United States Core Inflation Rate</Title>
<URL>/united-states/core-inflation-rate</URL>
<Unit>percent</Unit>
</CountryIndicatorPeers>
</ArrayOfCountryIndicatorPeers>

By country and category

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/peers/country/mexico/inflation%20rate?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

te.getPeers(country='mexico', category='inflation rate')

Using Requests:

const axios = require('axios');
(async () => {
    const api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/peers/country/mexico/inflation%20rate?c=${api_key}`)
    console.log(response.data)
})()

Or using our package:

data = te.getPeers(country = 'mexico', category = 'inflation rate').then(function(data){
  console.log(data)       
});

Using Requests:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/peers/country/mexico/inflation%20rate?c=guest:guest");

/peers/country/(country)/(category)

TickerPeerRelationshipCountryCategoryTitleLatestValueDateLatestValueSourceSourceURLUnitURLCategoryGroupAdjustmentFrequencyHistoricalDataSymbolCreateDateFirstValueDatePreviousValuePreviousValueDate
MEXFRINRDPSTMEXFRINRDPST-1MexicoDeposit Interest RateDeposit Interest Rate in Mexico3/31/2023 12:00:00 AM4.57IMFhttp://www.imf.orgpercent/mexico/deposit-interest-rateinflation rateMonthlyMEXFRINRDPST12/3/2015 2:37:00 PM1/31/1976 12:00:00 AM4.432/28/2023 12:00:00 AM
MEXICOBANBALSHEMEXICOBANBALSHE-1MexicoBanks Balance SheetMexico Banks Balance Sheet4/30/2023 12:00:00 AM10335903.02Banco de Méxicohttp://www.banxico.org.mxMXN Million/mexico/banks-balance-sheetinflation rateNSAMonthlyMEXICOBANBALSHE9/8/2014 3:29:00 PM12/31/2000 12:00:00 AM10169075.643/31/2023 12:00:00 AM
MEXICOBANBALSHEMEXICOCENBANBALSHE0MexicoCentral Bank Balance SheetMexico Central Bank Balance Sheet5/31/2023 12:00:00 AM4537124968.00Banco de Méxicohttp://www.banxico.org.mx/MXN Thousand/mexico/central-bank-balance-sheetinflation rateNSAMonthlyMEXICOCENBANBALSHE8/14/2014 5:50:00 PM12/31/1985 12:00:00 AM4515771451.004/30/2023 12:00:00 AM

/peers/country/(country)/(category)?f=json

[{"Ticker":"MEXFRINRDPST","Peer":"MEXFRINRDPST","Relationship":-1,"Country":"Mexico","Category":"Deposit Interest Rate","Title":"Deposit Interest Rate in Mexico","LatestValueDate":"2023-07-31T00:00:00","LatestValue":4.95,"Source":"IMF","SourceURL":"https://www.imf.org","Unit":"percent","URL":"/mexico/deposit-interest-rate","CategoryGroup":"inflation rate","Adjustment":"","Frequency":"Monthly","HistoricalDataSymbol":"MEXFRINRDPST","CreateDate":"2015-12-03T14:37:00","FirstValueDate":"1976-01-31T00:00:00","PreviousValue":4.63,"PreviousValueDate":"2023-06-30T00:00:00"},{"Ticker":"MEXICOBANBALSHE","Peer":"MEXICOBANBALSHE","Relationship":-1,"Country":"Mexico","Category":"Banks Balance Sheet","Title":"Mexico Banks Balance Sheet","LatestValueDate":"2023-08-31T00:00:00","LatestValue":10702998.84,"Source":"Banco de México","SourceURL":"http://www.banxico.org.mx","Unit":"MXN Million","URL":"/mexico/banks-balance-sheet","CategoryGroup":"inflation rate","Adjustment":"NSA","Frequency":"Monthly","HistoricalDataSymbol":"MEXICOBANBALSHE","CreateDate":"2014-09-08T15:29:00","FirstValueDate":"2000-12-31T00:00:00","PreviousValue":10608854.67,"PreviousValueDate":"2023-07-31T00:00:00"},{"Ticker":"MEXICOBANBALSHE","Peer":"MEXICOCENBANBALSHE","Relationship":0,"Country":"Mexico","Category":"Central Bank Balance Sheet","Title":"Mexico Central Bank Balance Sheet","LatestValueDate":"2023-09-30T00:00:00","LatestValue":4204904816.00,"Source":"Banco de México","SourceURL":"https://www.banxico.org.mx/","Unit":"MXN Thousand","URL":"/mexico/central-bank-balance-sheet","CategoryGroup":"inflation rate","Adjustment":"NSA","Frequency":"Monthly","HistoricalDataSymbol":"MEXICOCENBANBALSHE","CreateDate":"2014-08-14T17:50:00","FirstValueDate":"1985-12-31T00:00:00","PreviousValue":4001809952.00,"PreviousValueDate":"2023-08-31T00:00:00"}]

/peers/country/(country)/(category)?f=csv

Ticker,Peer,Relationship,Country,Category,Title,LatestValueDate,LatestValue,Source,SourceURL,Unit,URL,CategoryGroup,Adjustment,Frequency,HistoricalDataSymbol,CreateDate,FirstValueDate,PreviousValue,PreviousValueDate
MEXFRINRDPST,MEXFRINRDPST,-1,Mexico,Deposit Interest Rate,Deposit Interest Rate in Mexico,7/31/2023 12:00:00 AM,4.95,IMF,https://www.imf.org,percent,/mexico/deposit-interest-rate,inflation rate,,Monthly,MEXFRINRDPST,12/3/2015 2:37:00 PM,1/31/1976 12:00:00 AM,4.63,6/30/2023 12:00:00 AM
MEXICOBANBALSHE,MEXICOBANBALSHE,-1,Mexico,Banks Balance Sheet,Mexico Banks Balance Sheet,8/31/2023 12:00:00 AM,10702998.84,Banco de México,http://www.banxico.org.mx,MXN Million,/mexico/banks-balance-sheet,inflation rate,NSA,Monthly,MEXICOBANBALSHE,9/8/2014 3:29:00 PM,12/31/2000 12:00:00 AM,10608854.67,7/31/2023 12:00:00 AM
MEXICOBANBALSHE,MEXICOCENBANBALSHE,0,Mexico,Central Bank Balance Sheet,Mexico Central Bank Balance Sheet,9/30/2023 12:00:00 AM,4204904816.00,Banco de México,https://www.banxico.org.mx/,MXN Thousand,/mexico/central-bank-balance-sheet,inflation rate,NSA,Monthly,MEXICOCENBANBALSHE,8/14/2014 5:50:00 PM,12/31/1985 12:00:00 AM,4001809952.00,8/31/2023 12:00:00 AM

/peers/country/(country)/(category)?f=xml

<ArrayOfCountryIndicatorPeers xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<CountryIndicatorPeers>
<Adjustment/>
<Category>Deposit Interest Rate</Category>
<CategoryGroup>inflation rate</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2015-12-03T14:37:00</CreateDate>
<FirstValueDate>1976-01-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MEXFRINRDPST</HistoricalDataSymbol>
<LatestValue>4.95</LatestValue>
<LatestValueDate>2023-07-31T00:00:00</LatestValueDate>
<Peer>MEXFRINRDPST</Peer>
<PreviousValue>4.63</PreviousValue>
<PreviousValueDate>2023-06-30T00:00:00</PreviousValueDate>
<Relationship>-1</Relationship>
<Source>IMF</Source>
<SourceURL>https://www.imf.org</SourceURL>
<Ticker>MEXFRINRDPST</Ticker>
<Title>Deposit Interest Rate in Mexico</Title>
<URL>/mexico/deposit-interest-rate</URL>
<Unit>percent</Unit>
</CountryIndicatorPeers>
<CountryIndicatorPeers>
<Adjustment>NSA</Adjustment>
<Category>Banks Balance Sheet</Category>
<CategoryGroup>inflation rate</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>10702998.84</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<Peer>MEXICOBANBALSHE</Peer>
<PreviousValue>10608854.67</PreviousValue>
<PreviousValueDate>2023-07-31T00:00:00</PreviousValueDate>
<Relationship>-1</Relationship>
<Source>Banco de México</Source>
<SourceURL>http://www.banxico.org.mx</SourceURL>
<Ticker>MEXICOBANBALSHE</Ticker>
<Title>Mexico Banks Balance Sheet</Title>
<URL>/mexico/banks-balance-sheet</URL>
<Unit>MXN Million</Unit>
</CountryIndicatorPeers>
<CountryIndicatorPeers>
<Adjustment>NSA</Adjustment>
<Category>Central Bank Balance Sheet</Category>
<CategoryGroup>inflation rate</CategoryGroup>
<Country>Mexico</Country>
<CreateDate>2014-08-14T17:50:00</CreateDate>
<FirstValueDate>1985-12-31T00:00:00</FirstValueDate>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MEXICOCENBANBALSHE</HistoricalDataSymbol>
<LatestValue>4204904816.00</LatestValue>
<LatestValueDate>2023-09-30T00:00:00</LatestValueDate>
<Peer>MEXICOCENBANBALSHE</Peer>
<PreviousValue>4001809952.00</PreviousValue>
<PreviousValueDate>2023-08-31T00:00:00</PreviousValueDate>
<Relationship>0</Relationship>
<Source>Banco de México</Source>
<SourceURL>https://www.banxico.org.mx/</SourceURL>
<Ticker>MEXICOBANBALSHE</Ticker>
<Title>Mexico Central Bank Balance Sheet</Title>
<URL>/mexico/central-bank-balance-sheet</URL>
<Unit>MXN Thousand</Unit>
</CountryIndicatorPeers>
</ArrayOfCountryIndicatorPeers>

Response fields

FieldTypeDescriptionExample
TickerstringTicker code“CPI YOY”
PeerstringRelated ticker“MEXFRINRDPST”
Relationshipnumber-1 - itself, 0 - related, 1 - component, 2 - parent, 3 - derivative0
CountrystringCountry name“Mexico”
CategorystringCategory name“Deposit Interest Rate”
TitlestringCombination of country/category“Deposit Interest Rate in Mexico”
LatestValueDatestringDate of the last released value“2023-01-31T00:00:00”
LatestValuenumberLast released value4.19
SourcestringSource of the data“IMF”
SourceURLstringURL link of the source“https://www.imf.org”
UnitstringUnit of the value“percent”
URLstringHyperlink at Trading Economics“/mexico/deposit-interest-rate”
CategoryGroupstringCategory group name“inflation rate”
AdjustmentstringData description, for example: base period, price adjustment, seasonality“1982-1984=100, NSA”
FrequencystringFrequency of the indicator“Monthly”
HistoricalDataSymbolstringUnique symbol used by Trading Economics“UNITEDSTACONPRIINDCP”
CreateDatestringTime when an indicator was inserted“2014-06-11T09:44:00”
FirstValueDatestringDate of the first value in the historical series“1950-01-31T00:00:00”
PreviousValuenumberPreviously released value300.84
PreviousValueDatestringDate of the previously released value“2023-02-28T00:00:00”