IMF API: Get economic forecast
Gets World Economic Outlook figures for a country or region by year, labelled as actual or forecast. Measures the IMF does not publish for a year are null.
Unofficial. Not affiliated with or endorsed by IMF.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Country, required
country Country or region name, such as Germany, World, or Euro area.
World
- End Year optional
end_year Last year to show, for example 2028. Defaults to two years after the current year.
2027
Whole number.
- Start Year optional
start_year First year to show, for example 2024. Defaults to the current year.
2025
Whole number.
Input as JSON
{ "country": "World", "end_year": 2027, "start_year": 2025}Output
{ "years": [ { "year": 2025, "status": "actual", "page_url": "https://www.imf.org/external/datamapper/NGDP_RPCH@WEO/WEOWORLD" , "gdp_billions_usd": 118485.328, "inflation_percent": 4.1, "gdp_per_person_usd": 14749.376, "unemployment_percent": null, "real_gdp_growth_percent": 3.5, "government_debt_percent_of_gdp": 94, "current_account_balance_percent_of_gdp": 0.5 }, { "year": 2026, "status": "forecast", "page_url": "https://www.imf.org/external/datamapper/NGDP_RPCH@WEO/WEOWORLD" , "gdp_billions_usd": 128003.776, "inflation_percent": 4.7, "gdp_per_person_usd": 15889.337, "unemployment_percent": null, "real_gdp_growth_percent": 3.1, "government_debt_percent_of_gdp": 94.6, "current_account_balance_percent_of_gdp": 0.7 }, { "year": 2027, "status": "forecast", "page_url": "https://www.imf.org/external/datamapper/NGDP_RPCH@WEO/WEOWORLD" , "gdp_billions_usd": 135093.196, "inflation_percent": 4.1, "gdp_per_person_usd": 16626.826, "unemployment_percent": null, "real_gdp_growth_percent": 3.4, "government_debt_percent_of_gdp": 95.8, "current_account_balance_percent_of_gdp": 0.7 } ], "country": "World", "weo_edition": "October 2026", "imf_country_code": "WEOWORLD"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"imf.org/get_economic_forecast","input":{"country":"World","end_year":2027,"start_year":2025}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "imf.org/get_economic_forecast" , "input": { "country": "World", "end_year": 2027, "start_year": 2025 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "imf.org/get_economic_forecast" , "input": { "country": "World", "end_year": 2027, "start_year": 2025 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run imf.org/get_economic_forecast# with {"country":"World","end_year":2027,"start_year":2025}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "country" ], "properties": { "country": { "type": "string", "description": "Country or region name, such as Germany, World, or Euro area." }, "end_year": { "type": "integer", "description": "Last year to show, for example 2028. Defaults to two years after the current year." }, "start_year": { "type": "integer", "description": "First year to show, for example 2024. Defaults to the current year." } }}Output schema
{ "type": "object", "required": [ "country", "imf_country_code", "weo_edition", "years" ], "properties": { "years": { "type": "array", "items": { "type": "object", "required": [ "year", "status", "real_gdp_growth_percent", "inflation_percent", "unemployment_percent", "gdp_billions_usd", "gdp_per_person_usd", "government_debt_percent_of_gdp", "current_account_balance_percent_of_gdp", "page_url" ], "properties": { "year": { "type": "integer" }, "status": { "enum": [ "actual", "forecast" ], "type": "string" }, "page_url": { "type": "string" }, "gdp_billions_usd": { "type": [ "number", "null" ] }, "inflation_percent": { "type": [ "number", "null" ] }, "gdp_per_person_usd": { "type": [ "number", "null" ] }, "unemployment_percent": { "type": [ "number", "null" ] }, "real_gdp_growth_percent": { "type": [ "number", "null" ] }, "government_debt_percent_of_gdp": { "type": [ "number", "null" ] }, "current_account_balance_percent_of_gdp": { "type": [ "number", "null" ] } } }, "description": "Economic measures for each requested year." }, "country": { "type": "string", "description": "Country or region name." }, "weo_edition": { "type": "string", "description": "World Economic Outlook edition." }, "imf_country_code": { "type": "string", "description": "IMF code for this country or group.", "x-fous-developer": true } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
imf.org/get_economic_forecast- Returns
- country code, WEO edition, and per-year GDP, growth, inflation, unemployment, debt and current account
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method imf.org/get_economic_forecast with the inputs above.
Ask your agent
- What is the projected GDP growth and inflation for Germany from 2024 to 2028?
- Show me IMF forecast figures for the Euro area for 2025 through 2027, marking which years are estimates.
- I need World Economic Outlook unemployment and government debt numbers for Japan between 2024 and 2026.
- Can you pull the current account balance and GDP for Brazil for the years 2025 to 2029 from the IMF?
- Give me the economic outlook for the World for 2024 to 2027, including inflation and debt, with actual versus forecast labels.
See more
All IMF methodsRanks countries by a World Economic Outlook indicator for a chosen year, excluding regional and group totals and countries without a value.
imf.org/list_country_rankingsLooks up a World Bank statistic for a country and returns its annual values and latest value for the selected years.
data.worldbank.org/get_country_statisticReturns seven key economic indicators for a country from its public Trading Economics overview: GDP growth rate, inflation rate, interest rate, unemployment rate, government debt to GDP, currency and stock market. Indicators absent from the overview are null; the US dollar index is not reported as a USD exchange rate.
tradingeconomics.com/get_country_overviewGets a public FRED economic series by plain name or series ID, with its observations, latest value and source details.
fred.stlouisfed.org/get_economic_indicatorGets the latest WHO value of a health statistic for a country, with sex-specific values, the regional value for the same year, and up to 10 years of history.
who.int/get_country_health_statisticsRanks countries by a World Development Indicators statistic for a given year, or for the latest year with broad country coverage. Regional aggregates and countries without data for that year are left out.
worldbank.org/compare_countriesCompares the latest reported value of an economic indicator across countries in a region, highest first. World includes all listed countries; Australia uses the Oceania region.
tradingeconomics.com/list_countries_by_indicatorFinds the Our World in Data chart that best matches a statistic and returns its country-by-year numeric values, definition and source.
ourworldindata.org/get_statistic