Skip to content
Docs
Get API key
Forecast

Forecasts for Economic Indicators

Use the following API endpoints to obtain forecast data for economic indicators.

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:

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

Or using our package:

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

With multi countries:

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

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

Text
https://api.tradingeconomics.com/forecast/country/{countries}?c={your_api_key}&f=json
JSON
[
  {
    "Country": "Mexico",
    "Category": "Auto Exports",
    "Title": "Mexico Auto Exports",
    "LatestValue": 301.34,
    "LatestValueDate": "2023-09-30T00:00:00",
    "q1": 256.0,
    "q2": 272.0,
    "q3": 255.0,
    "q4": 245.0,
    "YearEnd": 256.0,
    "YearEnd2": 242.0,
    "YearEnd3": 232.0,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33: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.0,
    "q2": 1104.0,
    "q3": -2330.0,
    "q4": -2330.0,
    "YearEnd": 1379.0,
    "YearEnd2": 1691.0,
    "YearEnd3": 407.0,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Monthly",
    "Unit": "USD Million",
    "HistoricalDataSymbol": "MXTBBAL"
  },
  {
    "Country": "Sweden",
    "Category": "Balance of Trade",
    "Title": "Sweden Balance of Trade",
    "LatestValue": -8400.0,
    "LatestValueDate": "2023-08-31T00:00:00",
    "q1": -2600.0,
    "q2": 5900.0,
    "q3": 14700.0,
    "q4": 5300.0,
    "YearEnd": -2600.0,
    "YearEnd2": -2000.0,
    "YearEnd3": -2800.0,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Monthly",
    "Unit": "SEK Million",
    "HistoricalDataSymbol": "SWTBAL"
  }
]

By indicator

Using Requests:

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

Or using our package:

Python
te.getForecastData(indicator= 'gdp')

With multi indicators:

Python
te.getForecastData(indicator= ['gdp', 'population'])
Text
https://api.tradingeconomics.com/forecast/indicator/{indicators}?c={your_api_key}&f=json
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.0,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Yearly",
    "Unit": "USD Billion",
    "HistoricalDataSymbol": "AFGSTANGDP"
  },
  {
    "Country": "Afghanistan",
    "Category": "Population",
    "Title": "Afghanistan Population",
    "LatestValue": 34.3,
    "LatestValueDate": "2022-12-31T00:00:00",
    "q1": null,
    "q2": null,
    "q3": null,
    "q4": null,
    "YearEnd": 33.4,
    "YearEnd2": 32.8,
    "YearEnd3": 32.3,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33: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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Yearly",
    "Unit": "USD Billion",
    "HistoricalDataSymbol": "ALBANIAGDP"
  }
]

By country and indicator

Using Requests:

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

Or using our package:

Python
te.getForecastData(country= ['mexico','sweden'],
 indicator= ['gdp','population'])
Text
https://api.tradingeconomics.com/forecast/country/{countries}/indicator/{indicators}?c={your_api_key}&f=json
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.0,
    "YearEnd2": 1470.0,
    "YearEnd3": 1496.0,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33: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.3,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Yearly",
    "Unit": "USD Billion",
    "HistoricalDataSymbol": "WGDPSWED"
  },
  {
    "Country": "Mexico",
    "Category": "Population",
    "Title": "Mexico Population",
    "LatestValue": 129.0,
    "LatestValueDate": "2022-12-31T00:00:00",
    "q1": null,
    "q2": null,
    "q3": null,
    "q4": null,
    "YearEnd": 126.6,
    "YearEnd2": 126.8,
    "YearEnd3": 127.1,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Yearly",
    "Unit": "Million",
    "HistoricalDataSymbol": "MEX SP.POP.TOTL"
  }
]

By ticker

Using Requests:

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

Or using our package:

Python
te.getForecastByTicker(ticker= 'usurtot')

With multi tickers:

Python
te.getForecastByTicker(ticker= ['usurtot', 'wgdpchin'])
Text
https://api.tradingeconomics.com/forecast/ticker/{tickers}?c={your_api_key}&f=json
JSON
[
  {
    "Country": "United States",
    "Category": "Unemployment Rate",
    "Title": "United States Unemployment Rate",
    "LatestValue": 3.8,
    "LatestValueDate": "2023-09-30T00:00:00",
    "q1": 4.0,
    "q2": 4.3,
    "q3": 4.5,
    "q4": 4.5,
    "YearEnd": 4.0,
    "YearEnd2": 4.6,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33: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.0,
    "YearEnd2": 19616.0,
    "YearEnd3": 20636.0,
    "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",
    "ForecastLastUpdate": "2023-10-01T15:33:00",
    "Frequency": "Yearly",
    "Unit": "USD Billion",
    "HistoricalDataSymbol": "WGDPCHIN"
  }
]

Response fields

FieldTypeDescriptionExample
Country*stringName of the country associated with the indicator.“Mexico”
CategorystringName of the economic indicator.“Auto Exports”
TitlestringCombination of country and indicator name.“Mexico Auto Exports”
LatestValuenumberMost recently released actual value.272.69
LatestValueDatestringDate of the last actual value release.“2023-03-31T00:00:00”
q1**numberForecast for the next quarter.257.00
q2**numberForecast for the quarter following ForecastValue1Q.250.00
q3**numberForecast for the quarter following ForecastValue2Q.239.00
q4**numberForecast for the quarter following ForecastValue3Q.274.00
YearEnd**numberForecast for the current year-end.239.00
YearEnd2**numberForecast for the next year-end.242.00
YearEnd3**numberForecast for the year after ForecastValue2.232.00
q1_datestringRelease date associated with ForecastValue1Q.“2023-06-30T00:00:00”
q2_datestringRelease date associated with ForecastValue2Q.“2023-09-30T00:00:00”
q3_datestringRelease date associated with ForecastValue3Q.“2023-12-31T00:00:00”
q4_datestringRelease date associated with ForecastValue4Q.“2024-03-31T00:00:00”
ForecastLastUpdatestringTimestamp of the most recent update to the forecast data, in UTC.“2024-03-31T00:00:00”
FrequencystringFrequency of data release.“Monthly”
UnitstringUnit of measurement for all forecast values.“Thousand Units”
HistoricalDataSymbolstringUnique internal symbol used by Trading Economics for this indicator.“MEXICOAUTEXP”

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

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

JSON/CSVHTML
YearEndForecastValue1
YearEnd2ForecastValue2
YearEnd3ForecastValue3
q1ForecastValue1Q
q2ForecastValue2Q
q3ForecastValue3Q
q4ForecastValue4Q