IMF API: List country rankings
Ranks countries by a World Economic Outlook indicator for a chosen year, excluding regional and group totals and countries without a value.
Unofficial. Not affiliated with or endorsed by IMF.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Year optional
year Calendar year to rank, for example 2026. Defaults to the current year.
Not set
Whole number from 1900 to 2200.
- Order optional
order Sort direction, for example highest_first.
highest_first (default)
One of
highest_first,lowest_first.- Indicator optional
indicator Economic measure to rank, for example gdp_growth.
gdp_growth (default)
One of
gdp_growth,inflation,unemployment,gdp,gdp_per_person,government_debt.- Max Results optional
max_results Maximum countries to return, for example 20.
20 (default)
Whole number from 1 to 200.
Input as JSON
{}Output
{ "unit": "%", "year": 2026, "rankings": [ { "rank": 1, "value": 22.3, "country": "Guyana", "page_url": "https://www.imf.org/external/datamapper/NGDP_RPCH@WEO/GUY" }, { "rank": 2, "value": 10.7, "country": "Taiwan Province of China", "page_url": "https://www.imf.org/external/datamapper/NGDP_RPCH@WEO/TWN" }, { "rank": 3, "value": 10.5, "country": "South Sudan, Republic of", "page_url": "https://www.imf.org/external/datamapper/NGDP_RPCH@WEO/SSD" } ], "indicator": "Real GDP growth", "data_status": "Forecast"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"imf.org/list_country_rankings","input":{}}' # 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/list_country_rankings" , "input": {}})# 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/list_country_rankings" , "input": {} }), 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/list_country_rankings# with {}"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": [], "properties": { "year": { "type": "integer", "maximum": 2200, "minimum": 1900, "description": "Calendar year to rank, for example 2026. Defaults to the current year." }, "order": { "enum": [ "highest_first", "lowest_first" ], "type": "string", "default": "highest_first", "description": "Sort direction, for example highest_first." }, "indicator": { "enum": [ "gdp_growth", "inflation", "unemployment", "gdp", "gdp_per_person", "government_debt" ], "type": "string", "default": "gdp_growth", "description": "Economic measure to rank, for example gdp_growth." }, "max_results": { "type": "integer", "default": 20, "maximum": 200, "minimum": 1, "description": "Maximum countries to return, for example 20." } }}Output schema
{ "type": "object", "required": [ "indicator", "unit", "year", "data_status", "rankings" ], "properties": { "unit": { "type": "string" }, "year": { "type": "integer" }, "rankings": { "type": "array", "items": { "type": "object", "required": [ "rank", "country", "value", "page_url" ], "properties": { "rank": { "type": "integer" }, "value": { "type": "number" }, "country": { "type": "string" }, "page_url": { "type": "string" } } } }, "indicator": { "type": "string" }, "data_status": { "enum": [ "Actual", "Forecast" ], "type": "string" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
imf.org/list_country_rankings- Returns
- indicator, unit, year, data status, ranked countries with values and page URLs
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/list_country_rankings with the inputs above.
Ask your agent
- Which countries had the highest GDP growth rate in 2026 according to the IMF World Economic Outlook?
- Rank the lowest inflation countries for 2025, top 15, from lowest to highest
- Show me a ranking of countries by unemployment rate for 2027, highest first, limited to 10 results
- List the countries with the largest government debt as a share of GDP in 2024 on imf.org
- I need the top 50 countries ranked by GDP per person for 2026, sorted from lowest to highest value
See more
All IMF methodsGets 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.
imf.org/get_economic_forecastRanks 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_indicatorLooks 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_statisticGets the latest official FIFA men's or women's national-team ranking, with points and movement since the previous ranking. Unranked teams are excluded.
fifa.com/get_world_rankingLists companies in the Forbes Global 2000 in rank order, optionally for a given year, country of headquarters and industry. Financial figures are in billions of US dollars; up to 500 results.
forbes.com/list_global_2000Gets 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_statisticsLists THE World University Rankings for a year, optionally filtered by country, with displayed ranks, scores, student figures and university links. Subject rankings are supported by name.
timeshighereducation.com/list_university_rankings