GnistAI GnistAI
Log in

IMF

International Monetary Fund datasets — global economic indicators and financial statistics.

Overview   |   MCP   |   REST API   |   OpenAPI   |   CLI   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 6 tools tools 6 6 type: api wrapper type type api wrapper api wrapper lifecycle: maintained lifecycle lifecycle maintained maintained Economics

Data source: IMF Data API

REST Bridge Endpoint https://context.gnist.ai/rest/imf/
Authentication

All requests require a Gnist-API-Key header (or api_key query parameter).

Free tier: 100 calls/day. Get your API key.

Tools (6)

list_weo_indicators

List all available World Economic Outlook indicators from the IMF.

The WEO covers macroeconomic variables across 196 countries with
historical data and 5-year forecasts, updated twice per year (April
and October). Use this to discover indicator codes before calling
get_weo_forecast() with specific indicators.

Returns:
count and list of indicators with code, label, description, unit, source, dataset.

Request Body
{
  "query": "example"
}
get_weo_forecast

Get World Economic Outlook forecasts and historical data for a country.

By default returns 6 headline macro indicators: real GDP growth, inflation,
unemployment, current account balance, government debt, and fiscal balance.

Country codes use ISO alpha-3 (e.g. USA, GBR, DEU, NOR, CHN, JPN, BRA).

Args:
country: ISO alpha-3 country code (e.g. 'USA', 'NOR', 'DEU', 'CHN').
indicators: WEO indicator codes. If omitted, returns the 6 defaults.
Use list_weo_indicators() to discover all available codes.
start_year: Include observations from this year (inclusive).
end_year: Include observations up to this year (inclusive).

Returns:
country, source note, and indicators list with observations (period, value).

ParameterTypeRequiredDescription
countrystringrequiredISO alpha-3 country code (e.g. 'USA', 'NOR', 'DEU', 'CHN').
indicatorsanyoptionalWEO indicator codes. If omitted, returns the 6 defaults. Use list_weo_indicators() to discover all available codes.
start_yearanyoptionalInclude observations from this year (inclusive).
end_yearanyoptionalInclude observations up to this year (inclusive).
Request Body
{
  "country": "NO"
}
get_commodity_prices

Get primary commodity price data from the IMF PCPS dataset.

Default commodities: Brent Crude Oil, Gold, Copper, Aluminum, Natural Gas (US).

Args:
commodities: List of PCPS commodity codes. Defaults to 5 key commodities.
start_period: Start period (YYYY-MM for monthly, YYYY for annual).
end_period: End period (YYYY-MM or YYYY).
frequency: 'M' for monthly (default) or 'A' for annual.

Returns:
source, available_codes list, and series with code, name, unit, and observations.

ParameterTypeRequiredDescription
commoditiesanyoptionalList of PCPS commodity codes. Defaults to 5 key commodities.
start_periodanyoptionalStart period (YYYY-MM for monthly, YYYY for annual).
end_periodanyoptionalEnd period (YYYY-MM or YYYY).
frequencystringoptional'M' for monthly (default) or 'A' for annual. (default: "M")
Request Body
{
  "query": "example"
}
get_trade_balance

Get bilateral or aggregate trade statistics from the IMF DOTS dataset.

Use partner='W00' (or omit) to get a country's total world trade.
Specify a partner code for bilateral flows.

Args:
reporter: ISO alpha-2 country code of the reporting country (e.g. 'US', 'DE').
partner: ISO alpha-2 partner code, or 'W00' for world total (default).
start_year: Start year (inclusive).
end_year: End year (inclusive).

Returns:
reporter, partner, and series with exports, imports, and trade balance.

ParameterTypeRequiredDescription
reporterstringrequiredISO alpha-2 country code of the reporting country (e.g. 'US', 'DE').
partneranyoptionalISO alpha-2 partner code, or 'W00' for world total (default).
start_yearanyoptionalStart year (inclusive).
end_yearanyoptionalEnd year (inclusive).
Request Body
{
  "reporter": "NO"
}
get_country_overview

Get a macro snapshot for a country combining WEO headline indicators.

Returns the most recent actuals and near-term IMF forecasts covering GDP growth,
inflation, unemployment, current account, government debt, and fiscal balance.

Args:
country: ISO alpha-3 country code (e.g. 'USA', 'NOR', 'DEU').

Returns:
country, source, window (year range), and indicators dict with latest values.

ParameterTypeRequiredDescription
countrystringrequiredISO alpha-3 country code (e.g. 'USA', 'NOR', 'DEU').
Request Body
{
  "country": "NO"
}
report_feedback

Report a bug, feature request, or general feedback for this data source.

Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.

Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")
Request Body
{
  "feedback": "example"
}

Quick Start

Shell
curl -X POST "https://context.gnist.ai/rest/imf/get_weo_forecast" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"country": "example"}'
Python
import httpx

resp = httpx.post(
    "https://context.gnist.ai/rest/imf/get_weo_forecast",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={
  "country": "example"
},
)
print(resp.json())

Related Toolkits (Economics)

Resources