Economics
Data source: FAOSTAT API
MCP Protocol
Endpoint
https://context.gnist.ai/mcp/faostat/
claude_desktop_config.json
{
"mcpServers": {
"gnist-faostat": {
"url": "https://context.gnist.ai/mcp/faostat/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Shell
curl -X POST "https://context.gnist.ai/mcp/faostat/" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_datasets", "arguments": {"query": "example"}}}'
REST API
API Root
https://context.gnist.ai/rest/faostat/
7 endpoints available:
GET /rest/faostat/search_datasetsGET /rest/faostat/list_datasetsGET /rest/faostat/get_domain_dimensionsGET /rest/faostat/get_dimension_codesGET /rest/faostat/get_dataGET /rest/faostat/compare_countriesGET /rest/faostat/report_feedback
Shell
curl "https://context.gnist.ai/rest/faostat/search_datasets?query=example" \ -H "Gnist-API-Key: YOUR_API_KEY"
Python
import httpx
resp = httpx.get(
"https://context.gnist.ai/rest/faostat/search_datasets",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
params={
"query": "example"
},
)
print(resp.json())
Command Line
Command
gc faostat
CLI documentation will be available when the GnistAI SDK is published.
Install
pip install gnistai
Available Tools (7)
search_datasetsSearch the FAOSTAT dataset catalog by keyword.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Search term for FAOSTAT datasets (e.g. "wheat", "rice production", "food prices", "fertilizer", "livestock"). |
limit | integer | optional | Number of results to return (1-50, default 20). (default: 20) |
list_datasetsList available FAOSTAT dataset groups and domains.
| Parameter | Type | Required | Description |
|---|---|---|---|
group | any | optional | Optional group filter (e.g. "Production", "Trade", "Prices", "Food Security", "Emissions"). Omit to list all. |
limit | integer | optional | Maximum datasets to return (1-200, default 50). (default: 50) |
get_domain_dimensionsGet available dimensions and filter options for a FAOSTAT domain.
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | required | FAOSTAT domain code (e.g. "QCL" for crops, "TCL" for trade, "PP" for prices, "FS" for food security). Use list_datasets to find codes. |
get_dimension_codesGet valid codes for a specific dimension of a FAOSTAT domain.
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | required | FAOSTAT domain code (e.g. "QCL", "TCL", "PP"). |
dimension | string | required | Dimension name (e.g. "area" for countries, "element" for indicators, "item" for commodities, "year" for time periods). |
limit | integer | optional | Maximum codes to return (1-500, default 100). (default: 100) |
get_dataFetch data from a FAOSTAT domain.
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | required | FAOSTAT domain code (e.g. "QCL" for crops/livestock, "TCL" for trade, "PP" for producer prices, "FS" for food security, "FBS" for food balances). Use list_datasets to find codes. |
areas | any | optional | FAO area codes (e.g. ["231", "351", "5000"] for USA, China, World). Use get_dimension_codes to find codes. Omit for all areas. |
elements | any | optional | Element codes for the indicator type (e.g. ["2510"] for production quantity, ["2610"] for import quantity). Use get_dimension_codes to find valid codes. |
items | any | optional | Item codes for commodities (e.g. ["15"] for wheat, ["27"] for rice). Use get_dimension_codes to find valid codes. |
years | any | optional | Year values (e.g. ["2020", "2021", "2022"]). Omit for all available years. |
area_cs | any | optional | Area coding system: "M49" (default), "FAO", "ISO2", or "ISO3". |
limit | integer | optional | Maximum records to return (1-2000, default 500). (default: 500) |
compare_countriesCompare data across countries/regions for a FAOSTAT domain.
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | required | FAOSTAT domain code (e.g. "QCL", "FS", "PP"). |
area_codes | list[string] | required | FAO area codes to compare (e.g. ["231", "351", "100"] for USA, China, India). Maximum 20. |
elements | any | optional | Element codes to filter by. |
items | any | optional | Item codes to filter by. |
years | any | optional | Year values to filter by. |
area_cs | any | optional | Area coding system: "M49", "FAO", "ISO2", or "ISO3". |
report_feedbackReport a bug, feature request, or general feedback for this data source.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |