Forecast

Trading Economics forecasts are built using a proprietary global macro model that takes into account our analysts’ expectations, correlations between countries, and a set of logical relationships between different indicators.

By country

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/forecast/country/mexico,sweden?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

import tradingeconomics as te
te.login('your_api_key')
te.getForecastData(country='mexico')

With multi countries:

te.getForecastData(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/forecast/country/mexico,sweden?c=${api_key}`)
    console.log(response.data)
})()

Or using our package:

const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getForecasts(country = 'mexico').then(function(data){
    console.log(data)     
});

With multi countries:

data = te.getForecasts(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/forecast/country/mexico?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);
        }
    }
}

With multi countries:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/country/mexico,sweden?c=guest:guest");

The response data format can be configured by appending the &f= parameter to the URL request.

/forecast/country/{countries}

CategoryTitleLatestValueLatestValueDateForecastValue1QForecastValue2QForecastValue3QForecastValue4QForecastValue1ForecastValue2ForecastValue3q1_dateq2_dateq3_dateq4_dateFrequencyUnitHistoricalDataSymbol
Auto ExportsMexico Auto Exports286.296/30/2023 12:00:00 AM269.00256.00272.00255.00256.00242.00232.009/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMMonthlyThousand UnitsMEXICOAUTEXP
Balance of TradeMexico Balance of Trade-74.095/31/2023 12:00:00 AM-713.001379.001104.00-2330.001379.001691.00407.009/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMMonthlyUSD MillionMXTBBAL
Balance of TradeSweden Balance of Trade-300.005/31/2023 12:00:00 AM-1700.00-2600.00900.004700.00-2600.00-2000.00-2800.009/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMMonthlySEK MillionSWTBAL

/forecast/country/{countries}?f=json

[{"Country":"Mexico","Category":"Auto Exports","Title":"Mexico Auto Exports","LatestValue":301.34,"LatestValueDate":"2023-09-30T00:00:00","q1":256.00,"q2":272.00,"q3":255.00,"q4":245.00,"YearEnd":256.00,"YearEnd2":242.00,"YearEnd3":232.00,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Monthly","Unit":"Thousand Units","HistoricalDataSymbol":"MEXICOAUTEXP"},{"Country":"Mexico","Category":"Balance of Trade","Title":"Mexico Balance of Trade","LatestValue":-1377.09,"LatestValueDate":"2023-08-31T00:00:00","q1":1379.00,"q2":1104.00,"q3":-2330.00,"q4":-2330.00,"YearEnd":1379.00,"YearEnd2":1691.00,"YearEnd3":407.00,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Monthly","Unit":"USD Million","HistoricalDataSymbol":"MXTBBAL"},{"Country":"Sweden","Category":"Balance of Trade","Title":"Sweden Balance of Trade","LatestValue":-8400.00,"LatestValueDate":"2023-08-31T00:00:00","q1":-2600.00,"q2":5900.00,"q3":14700.00,"q4":5300.00,"YearEnd":-2600.00,"YearEnd2":-2000.00,"YearEnd3":-2800.00,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Monthly","Unit":"SEK Million","HistoricalDataSymbol":"SWTBAL"}]

/forecast/country/{countries}?f=csv

Category,Title,LatestValue,LatestValueDate,ForecastValue1Q,ForecastValue2Q,ForecastValue3Q,ForecastValue4Q,ForecastValue1,ForecastValue2,ForecastValue3,q1_date,q2_date,q3_date,q4_date,Frequency,Unit,HistoricalDataSymbol
Auto Exports,Mexico Auto Exports,301.34,9/30/2023 12:00:00 AM,256.00,272.00,255.00,245.00,256.00,242.00,232.00,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Monthly,Thousand Units,MEXICOAUTEXP
Balance of Trade,Mexico Balance of Trade,-1377.09,8/31/2023 12:00:00 AM,1379.00,1104.00,-2330.00,-2330.00,1379.00,1691.00,407.00,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Monthly,USD Million,MXTBBAL
Balance of Trade,Sweden Balance of Trade,-8400.00,8/31/2023 12:00:00 AM,-2600.00,5900.00,14700.00,5300.00,-2600.00,-2000.00,-2800.00,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Monthly,SEK Million,SWTBAL

/forecast/country/{countries}?f=xml

<ArrayOfForecastItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<ForecastItem>
<Category>Auto Exports</Category>
<Country>Mexico</Country>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MEXICOAUTEXP</HistoricalDataSymbol>
<LatestValue>301.34</LatestValue>
<LatestValueDate>2023-09-30T00:00:00</LatestValueDate>
<Title>Mexico Auto Exports</Title>
<Unit>Thousand Units</Unit>
<YearEnd>256.00</YearEnd>
<YearEnd2>242.00</YearEnd2>
<YearEnd3>232.00</YearEnd3>
<q1>256.00</q1>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2>272.00</q2>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3>255.00</q3>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4>245.00</q4>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>Balance of Trade</Category>
<Country>Mexico</Country>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>MXTBBAL</HistoricalDataSymbol>
<LatestValue>-1377.09</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<Title>Mexico Balance of Trade</Title>
<Unit>USD Million</Unit>
<YearEnd>1379.00</YearEnd>
<YearEnd2>1691.00</YearEnd2>
<YearEnd3>407.00</YearEnd3>
<q1>1379.00</q1>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2>1104.00</q2>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3>-2330.00</q3>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4>-2330.00</q4>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>Balance of Trade</Category>
<Country>Sweden</Country>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>SWTBAL</HistoricalDataSymbol>
<LatestValue>-8400.00</LatestValue>
<LatestValueDate>2023-08-31T00:00:00</LatestValueDate>
<Title>Sweden Balance of Trade</Title>
<Unit>SEK Million</Unit>
<YearEnd>-2600.00</YearEnd>
<YearEnd2>-2000.00</YearEnd2>
<YearEnd3>-2800.00</YearEnd3>
<q1>-2600.00</q1>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2>5900.00</q2>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3>14700.00</q3>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4>5300.00</q4>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
</ArrayOfForecastItem>

By indicator

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/forecast/indicator/gdp,population?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

te.getForecastData(indicator= 'gdp')

With multi indicators:

te.getForecastData(indicator= ['gdp', 'population'])

Using Requests:

const axios = require('axios');
(async () => {
    const api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/forecast/indicator/gdp,population?c=${api_key}`)
    console.log(response.data)
})()

Or using our package:

data = te.getForecasts(indicator = 'gdp').then(function(data){
    console.log(data)     
});

With multi indicators:

data = te.getForecasts(indicator = ['gdp','population']).then(function(data){
    console.log(data)     
});

Using Requests:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/indicator/gdp?c=guest:guest");

With multi indicators:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/indicator/gdp,population?c=guest:guest");

/forecast/indicator/{indicators}

CategoryTitleLatestValueLatestValueDateForecastValue1QForecastValue2QForecastValue3QForecastValue4QForecastValue1ForecastValue2ForecastValue3q1_dateq2_dateq3_dateq4_dateFrequencyUnitHistoricalDataSymbol
GDPAfghanistan GDP14.5812/31/2021 12:00:00 AM14.0313.6614.009/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyUSD BillionAFGSTANGDP
PopulationAfghanistan Population34.3012/31/2022 12:00:00 AM33.4032.8032.309/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyMillionAFGSTANPOPLATION
GDPAlbania GDP18.8812/31/2022 12:00:00 AM19.3720.0520.659/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyUSD BillionALBANIAGDP

/forecast/indicator/{indicators}?f=json

[{"Country":"Afghanistan","Category":"GDP","Title":"Afghanistan GDP","LatestValue":14.58,"LatestValueDate":"2021-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":14.03,"YearEnd2":13.66,"YearEnd3":14.00,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"USD Billion","HistoricalDataSymbol":"AFGSTANGDP"},{"Country":"Afghanistan","Category":"Population","Title":"Afghanistan Population","LatestValue":34.30,"LatestValueDate":"2022-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":33.40,"YearEnd2":32.80,"YearEnd3":32.30,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"Million","HistoricalDataSymbol":"AFGSTANPOPLATION"},{"Country":"Albania","Category":"GDP","Title":"Albania GDP","LatestValue":18.88,"LatestValueDate":"2022-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":19.37,"YearEnd2":19.99,"YearEnd3":20.59,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"USD Billion","HistoricalDataSymbol":"ALBANIAGDP"}]

/forecast/indicator/{indicators}?f=csv

Category,Title,LatestValue,LatestValueDate,ForecastValue1Q,ForecastValue2Q,ForecastValue3Q,ForecastValue4Q,ForecastValue1,ForecastValue2,ForecastValue3,q1_date,q2_date,q3_date,q4_date,Frequency,Unit,HistoricalDataSymbol
GDP,Afghanistan GDP,14.58,12/31/2021 12:00:00 AM,,,,,14.03,13.66,14.00,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,USD Billion,AFGSTANGDP
Population,Afghanistan Population,34.30,12/31/2022 12:00:00 AM,,,,,33.40,32.80,32.30,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,Million,AFGSTANPOPLATION
GDP,Albania GDP,18.88,12/31/2022 12:00:00 AM,,,,,19.37,19.99,20.59,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,USD Billion,ALBANIAGDP

/forecast/indicator/{indicators}?f=xml

<ArrayOfForecastItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<ForecastItem>
<Category>GDP</Category>
<Country>Afghanistan</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>AFGSTANGDP</HistoricalDataSymbol>
<LatestValue>14.58</LatestValue>
<LatestValueDate>2021-12-31T00:00:00</LatestValueDate>
<Title>Afghanistan GDP</Title>
<Unit>USD Billion</Unit>
<YearEnd>14.03</YearEnd>
<YearEnd2>13.66</YearEnd2>
<YearEnd3>14.00</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>Population</Category>
<Country>Afghanistan</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>AFGSTANPOPLATION</HistoricalDataSymbol>
<LatestValue>34.30</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<Title>Afghanistan Population</Title>
<Unit>Million</Unit>
<YearEnd>33.40</YearEnd>
<YearEnd2>32.80</YearEnd2>
<YearEnd3>32.30</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>GDP</Category>
<Country>Albania</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>ALBANIAGDP</HistoricalDataSymbol>
<LatestValue>18.88</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<Title>Albania GDP</Title>
<Unit>USD Billion</Unit>
<YearEnd>19.37</YearEnd>
<YearEnd2>19.99</YearEnd2>
<YearEnd3>20.59</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
</ArrayOfForecastItem>

By country and indicator

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/forecast/country/mexico,sweden/indicator/gdp,population?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

te.getForecastData(country= ['mexico','sweden'],
 indicator= ['gdp','population'])

Using Requests:

const axios = require('axios');
(async () => {
    const api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/forecast/country/mexico,sweden/indicator/gdp,population?c=${api_key}`)
    console.log(response.data)
})()

Or using our package:

data = te.getForecasts(country = ['mexico','sweden'],
 indicator = ['gdp','population']).then(function(data){
    console.log(data)     
});

Using Requests:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/country/mexico,sweden/indicator/gdp,population?c=guest:guest");

/forecast/country/{countries}/indicator/{indicators}

CategoryTitleLatestValueLatestValueDateForecastValue1QForecastValue2QForecastValue3QForecastValue4QForecastValue1ForecastValue2ForecastValue3q1_dateq2_dateq3_dateq4_dateFrequencyUnitHistoricalDataSymbol
GDPMexico GDP1414.1912/31/2022 12:00:00 AM1450.001473.001499.009/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyUSD BillionWGDPMEXI
GDPSweden GDP585.9412/31/2022 12:00:00 AM583.60588.85604.169/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyUSD BillionWGDPSWED
PopulationMexico Population129.0012/31/2022 12:00:00 AM126.60126.80127.109/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyMillionMEX SP.POP.TOTL

/forecast/country/{countries}/indicator/{indicators}?f=json

[{"Country":"Mexico","Category":"GDP","Title":"Mexico GDP","LatestValue":1414.19,"LatestValueDate":"2022-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":1447.00,"YearEnd2":1470.00,"YearEnd3":1496.00,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"USD Billion","HistoricalDataSymbol":"WGDPMEXI"},{"Country":"Sweden","Category":"GDP","Title":"Sweden GDP","LatestValue":585.94,"LatestValueDate":"2022-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":581.84,"YearEnd2":581.26,"YearEnd3":592.30,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"USD Billion","HistoricalDataSymbol":"WGDPSWED"},{"Country":"Mexico","Category":"Population","Title":"Mexico Population","LatestValue":129.00,"LatestValueDate":"2022-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":126.60,"YearEnd2":126.80,"YearEnd3":127.10,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"Million","HistoricalDataSymbol":"MEX SP.POP.TOTL"}]

/forecast/country/{countries}/indicator/{indicators}?f=csv

Category,Title,LatestValue,LatestValueDate,ForecastValue1Q,ForecastValue2Q,ForecastValue3Q,ForecastValue4Q,ForecastValue1,ForecastValue2,ForecastValue3,q1_date,q2_date,q3_date,q4_date,Frequency,Unit,HistoricalDataSymbol
GDP,Mexico GDP,1414.19,12/31/2022 12:00:00 AM,,,,,1447.00,1470.00,1496.00,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,USD Billion,WGDPMEXI
GDP,Sweden GDP,585.94,12/31/2022 12:00:00 AM,,,,,581.84,581.26,592.30,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,USD Billion,WGDPSWED
Population,Mexico Population,129.00,12/31/2022 12:00:00 AM,,,,,126.60,126.80,127.10,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,Million,MEX SP.POP.TOTL

/forecast/country/{countries}/indicator/{indicators}?f=xml

<ArrayOfForecastItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<ForecastItem>
<Category>GDP</Category>
<Country>Mexico</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>WGDPMEXI</HistoricalDataSymbol>
<LatestValue>1414.19</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<Title>Mexico GDP</Title>
<Unit>USD Billion</Unit>
<YearEnd>1447.00</YearEnd>
<YearEnd2>1470.00</YearEnd2>
<YearEnd3>1496.00</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>GDP</Category>
<Country>Sweden</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>WGDPSWED</HistoricalDataSymbol>
<LatestValue>585.94</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<Title>Sweden GDP</Title>
<Unit>USD Billion</Unit>
<YearEnd>581.84</YearEnd>
<YearEnd2>581.26</YearEnd2>
<YearEnd3>592.30</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>Population</Category>
<Country>Mexico</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>MEX SP.POP.TOTL</HistoricalDataSymbol>
<LatestValue>129.00</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<Title>Mexico Population</Title>
<Unit>Million</Unit>
<YearEnd>126.60</YearEnd>
<YearEnd2>126.80</YearEnd2>
<YearEnd3>127.10</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
</ArrayOfForecastItem>

By ticker

Using Requests:

import requests
api_key = 'YOUR_API_KEY'
url = f'https://api.tradingeconomics.com/forecast/ticker/usurtot,wgdpchin?c={api_key}'
data = requests.get(url).json()
print(data)

Or using our package:

te.getForecastByTicker(ticker= 'usurtot')

With multi tickers:

te.getForecastByTicker(ticker= ['usurtot', 'wgdpchin'])

Using Requests:

const axios = require('axios');
(async () => {
    const api_key = 'YOUR_API_KEY'
    const response = await axios.get(`https://api.tradingeconomics.com/forecast/ticker/usurtot,wgdpchin?c=${api_key}`)
    console.log(response.data)
})()

Or using our package:

data = te.getForecasts(ticker = 'usurtot').then(function(data){
    console.log(data)     
});

With multi tickers:

data = te.getForecasts(ticker = ['usurtot','wgdpchin']).then(function(data){
    console.log(data)     
});

Using Requests:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/ticker/usurtot?c=guest:guest");

With multi tickers:

new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/forecast/ticker/usurtot,wgdpchin?c=guest:guest");

/forecast/ticker/{tickers}

CategoryTitleLatestValueLatestValueDateForecastValue1QForecastValue2QForecastValue3QForecastValue4QForecastValue1ForecastValue2ForecastValue3q1_dateq2_dateq3_dateq4_dateFrequencyUnitHistoricalDataSymbol
Unemployment RateUnited States Unemployment Rate3.606/30/2023 12:00:00 AM3.804.004.304.504.004.609/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMMonthlypercentUSURTOT
GDPChina GDP17963.1712/31/2022 12:00:00 AM18879.0020012.0021253.009/30/2023 12:00:00 AM12/31/2023 12:00:00 AM3/31/2024 12:00:00 AM6/30/2024 12:00:00 AMYearlyUSD BillionWGDPCHIN

/forecast/ticker/{tickers}?f=json

[{"Country":"United States","Category":"Unemployment Rate","Title":"United States Unemployment Rate","LatestValue":3.80,"LatestValueDate":"2023-09-30T00:00:00","q1":4.00,"q2":4.30,"q3":4.50,"q4":4.50,"YearEnd":4.00,"YearEnd2":4.60,"YearEnd3":null,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Monthly","Unit":"percent","HistoricalDataSymbol":"USURTOT"},{"Country":"China","Category":"GDP","Title":"China GDP","LatestValue":17963.17,"LatestValueDate":"2022-12-31T00:00:00","q1":null,"q2":null,"q3":null,"q4":null,"YearEnd":18772.00,"YearEnd2":19616.00,"YearEnd3":20636.00,"q1_date":"2023-12-31T00:00:00","q2_date":"2024-03-31T00:00:00","q3_date":"2024-06-30T00:00:00","q4_date":"2024-09-30T00:00:00","Frequency":"Yearly","Unit":"USD Billion","HistoricalDataSymbol":"WGDPCHIN"}]

/forecast/ticker/{tickers}?f=csv

Category,Title,LatestValue,LatestValueDate,ForecastValue1Q,ForecastValue2Q,ForecastValue3Q,ForecastValue4Q,ForecastValue1,ForecastValue2,ForecastValue3,q1_date,q2_date,q3_date,q4_date,Frequency,Unit,HistoricalDataSymbol
Unemployment Rate,United States Unemployment Rate,3.80,9/30/2023 12:00:00 AM,4.00,4.30,4.50,4.50,4.00,4.60,,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Monthly,percent,USURTOT
GDP,China GDP,17963.17,12/31/2022 12:00:00 AM,,,,,18772.00,19616.00,20636.00,12/31/2023 12:00:00 AM,3/31/2024 12:00:00 AM,6/30/2024 12:00:00 AM,9/30/2024 12:00:00 AM,Yearly,USD Billion,WGDPCHIN

/forecast/ticker/{tickers}?f=xml

<ArrayOfForecastItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models">
<ForecastItem>
<Category>Unemployment Rate</Category>
<Country>United States</Country>
<Frequency>Monthly</Frequency>
<HistoricalDataSymbol>USURTOT</HistoricalDataSymbol>
<LatestValue>3.80</LatestValue>
<LatestValueDate>2023-09-30T00:00:00</LatestValueDate>
<Title>United States Unemployment Rate</Title>
<Unit>percent</Unit>
<YearEnd>4.00</YearEnd>
<YearEnd2>4.60</YearEnd2>
<YearEnd3 i:nil="true"/>
<q1>4.00</q1>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2>4.30</q2>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3>4.50</q3>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4>4.50</q4>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
<ForecastItem>
<Category>GDP</Category>
<Country>China</Country>
<Frequency>Yearly</Frequency>
<HistoricalDataSymbol>WGDPCHIN</HistoricalDataSymbol>
<LatestValue>17963.17</LatestValue>
<LatestValueDate>2022-12-31T00:00:00</LatestValueDate>
<Title>China GDP</Title>
<Unit>USD Billion</Unit>
<YearEnd>18772.00</YearEnd>
<YearEnd2>19616.00</YearEnd2>
<YearEnd3>20636.00</YearEnd3>
<q1 i:nil="true"/>
<q1_date>2023-12-31T00:00:00</q1_date>
<q2 i:nil="true"/>
<q2_date>2024-03-31T00:00:00</q2_date>
<q3 i:nil="true"/>
<q3_date>2024-06-30T00:00:00</q3_date>
<q4 i:nil="true"/>
<q4_date>2024-09-30T00:00:00</q4_date>
</ForecastItem>
</ArrayOfForecastItem>

Response fields

FieldTypeDescriptionExample
Country*stringCountry name“Mexico”
CategorystringName of the indicator“Auto Exports”
TitlestringCombination of country and indicator name“Mexico Auto Exports”
LatestValuenumberLast released value272.69
LatestValueDatestringDate of the last released value“2023-03-31T00:00:00”
ForecastValue1Q**numberForecast value for the next quarter257.00
ForecastValue2Q**numberForecast value for the quarter following ForecastValue1Q250.00
ForecastValue3Q**numberForecast value for the quarter following ForecastValue2Q239.00
ForecastValue4Q**numberForecast value for the quarter following ForecastValue3Q274.00
ForecastValue1**numberForecast value for the year end239.00
ForecastValue2**numberForecast value for the year end following ForecastValue1242.00
ForecastValue3**numberForecast value for the year end following ForecastValue2232.00
q1_datestringDate for ForecastValue1Q“2023-06-30T00:00:00”
q2_datestringDate for ForecastValue2Q“2023-09-30T00:00:00”
q3_datestringDate for ForecastValue3Q“2023-12-31T00:00:00”
q4_datestringDate for ForecastValue4Q“2024-03-31T00:00:00”
FrequencystringFrequency of the indicator“Monthly”
UnitstringUnit of the forecasted values“Thousand Units”
HistoricalDataSymbolstringUnique symbol used by Trading Economics“MEXICOAUTEXP”

*Country only appears in the packages or when using ‘&f=json’ on endpoints.

**Forecast response fields can be diferent from HTML response fields:

Python/NodeHTML
yearendForecastValue1
yearend2ForecastValue2
yearend3ForecastValue3
q1ForecastValue1Q
q2ForecastValue2Q
q3ForecastValue3Q
q4ForecastValue4Q