Data source: World Bank Open Data
https://context.gnist.ai/rest/worldbank/
AuthenticationAll requests require a Gnist-API-Key header (or api_key query parameter).
Free tier: 100 calls/day. Get your API key.
Tools (5)
get_indicatorFetch a time series for a World Bank indicator.
Args:
country_code: ISO 3166-1 alpha-2 or alpha-3 country code (e.g. "US", "USA", "NO").
Use "WLD" for global aggregates or "all" for every country.
indicator_code: World Bank indicator ID (e.g. "NY.GDP.MKTP.CD" for GDP,
"SP.POP.TOTL" for population). Use search_indicators to find codes.
year_from: Start year (inclusive). If omitted, uses mrv instead.
year_to: End year (inclusive). If omitted, uses year_from as single year.
mrv: Most recent values to return (1–50, default 10). Used when year_from/year_to are not set.
Returns:
Time series of indicator values with date, value, and country metadata.
Values may be null for years where data is unavailable.
| Parameter | Type | Required | Description |
|---|---|---|---|
country_code | string | required | ISO 3166-1 alpha-2 or alpha-3 country code (e.g. "US", "USA", "NO"). Use "WLD" for global aggregates or "all" for every country. |
indicator_code | string | required | World Bank indicator ID (e.g. "NY.GDP.MKTP.CD" for GDP, "SP.POP.TOTL" for population). Use search_indicators to find codes. |
year_from | any | optional | Start year (inclusive). If omitted, uses mrv instead. |
year_to | any | optional | End year (inclusive). If omitted, uses year_from as single year. |
mrv | integer | optional | Most recent values to return (1–50, default 10). Used when year_from/year_to are not set. (default: 10) |
{
"country_code": "NO",
"indicator_code": "example"
}search_indicatorsSearch the World Bank indicator catalog by keyword.
Covers 1,400+ socioeconomic indicators including GDP, population, health,
education, trade, energy, environment, and more.
Args:
query: Search term (e.g. "gdp", "literacy rate", "co2 emissions").
per_page: Number of results to return (1–50, default 20).
Returns:
List of matching indicators with ID, name, unit, and topic classification.
Use the indicator id field with get_indicator or compare_countries.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Search term (e.g. "gdp", "literacy rate", "co2 emissions"). |
per_page | integer | optional | Number of results to return (1–50, default 20). (default: 20) |
{
"query": "example"
}country_profileGet a snapshot of key development indicators for a country.
Covers: GDP (total and per capita), population, life expectancy, and CO2 emissions.
Data comes from World Bank Open Data (CC-BY-4.0).
Args:
country_code: ISO 3166-1 alpha-2 or alpha-3 country code (e.g. "NO", "USA", "DE").
year: Specific year to retrieve. Defaults to most recent available data.
Returns:
Country profile with GDP, population, life expectancy, and CO2 figures.
Any field may be null if the World Bank has no data for that country/year combination.
| Parameter | Type | Required | Description |
|---|---|---|---|
country_code | string | required | ISO 3166-1 alpha-2 or alpha-3 country code (e.g. "NO", "USA", "DE"). |
year | any | optional | Specific year to retrieve. Defaults to most recent available data. |
{
"country_code": "NO"
}compare_countriesCompare one indicator across multiple countries for a given year.
Args:
indicator_code: World Bank indicator ID (e.g. "NY.GDP.MKTP.CD").
Use search_indicators to find the right code.
country_codes: List of ISO 3166-1 alpha-2 or alpha-3 codes (e.g. ["US", "DE", "JP"]).
Maximum 20 countries per request.
year: The year to compare (e.g. 2022).
Returns:
Indicator values for each country in the requested year.
Values may be null if data is unavailable for a country/year pair.
| Parameter | Type | Required | Description |
|---|---|---|---|
indicator_code | string | required | World Bank indicator ID (e.g. "NY.GDP.MKTP.CD"). Use search_indicators to find the right code. |
country_codes | list[string] | required | List of ISO 3166-1 alpha-2 or alpha-3 codes (e.g. ["US", "DE", "JP"]). Maximum 20 countries per request. |
year | integer | required | The year to compare (e.g. 2022). |
{
"indicator_code": "example",
"country_codes": [
"example"
],
"year": 1
}report_feedbackReport 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'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |
{
"feedback": "example"
}Quick Start
curl -X POST "https://context.gnist.ai/rest/worldbank/get_indicator" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"country_code": "example", "indicator_code": "example"}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/rest/worldbank/get_indicator",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={
"country_code": "example",
"indicator_code": "example"
},
)
print(resp.json())