faostat_get_rankings
Fetch top country rankings by production, yield, or trade value for any commodity and year. Use to answer 'which country produces the most?' questions.
Instructions
Get rankings — e.g. top countries by production, yield, or trade value. Use this to answer "which country produces the most X?" questions.
NOTE: element_code here is the DISPLAY code (e.g. '5510'), not the filter code used in faostat_get_data. Rankings use the same codes shown in data responses.
Args: domain_code: Domain to rank within (e.g. 'QCL') element_code: Display element code to rank by (e.g. '5510' for Production in QCL) item_code: Commodity code (e.g. '56' for Maize, '15' for Wheat) year: The year to rank for (e.g. '2022') lang: Language code (default: 'en') limit: Number of top results to return (default: 10) response_format: Output format: 'objects' (default), 'compact', or 'csv'
Example: faostat_get_rankings(domain_code='QCL', element_code='5510', item_code='56', year='2022', limit=10) → Top 10 maize-producing countries in 2022
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain_code | Yes | ||
| element_code | Yes | ||
| item_code | Yes | ||
| year | Yes | ||
| lang | No | en | |
| limit | No | ||
| response_format | No | objects |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |