FAO APIfao.org ↗
Query FAO's FAOSTAT database via API: browse 100+ data domains covering crop production, trade, emissions, prices, and food balances with filterable endpoints.
What is the FAO API?
The FAOSTAT API exposes 4 endpoints for querying the UN Food and Agriculture Organization's statistical database, covering domains such as crop and livestock production, food trade, land use, greenhouse gas emissions, and food balance sheets. Starting with list_domains, you can enumerate every available domain, then drill into its structure with list_dimensions, fetch valid filter codes with list_codes, and pull observation records with get_data — filtering by area, item, element, and year.
curl -X GET 'https://api.parse.bot/scraper/1eacf014-2ec2-40a2-8ab3-7996dce12e08/list_domains' \ -H 'X-API-Key: $PARSE_API_KEY'
Lists every FAOSTAT data domain available for download, grouped by thematic group (e.g. Production, Trade, Food Balances, Prices). One row per domain with its domain_code (the key used by list_dimensions, list_codes and get_data), the group it belongs to, the date of the latest update, the latest reference year covered and the planned next release. Single request; a few archived domains have no release information (null fields).
| Param | Type | Description |
|---|---|---|
| lang | string | Language of labels in the response. |
{
"type": "object",
"fields": {
"count": "integer number of domains returned",
"domains": "array of domain records: group_code, group_name, domain_code, domain_name, date_update (ISO date of last data update or null), release_current, year_current (latest reference year as string), release_next, year_next, release_note"
},
"sample": {
"data": {
"count": 78,
"domains": [
{
"year_next": "2025",
"group_code": "Q",
"group_name": "Production",
"date_update": "2025-12-31",
"domain_code": "QCL",
"domain_name": "Crops and livestock products",
"release_next": "2026-12",
"release_note": "update",
"year_current": "2024",
"release_current": "2025-12-31"
},
{
"year_next": null,
"group_code": "R",
"group_name": "Land, Inputs and Sustainability",
"date_update": null,
"domain_code": "RN",
"domain_name": "Land",
"release_next": null,
"release_note": null,
"year_current": null,
"release_current": null
}
]
},
"status": "success"
}
}About the FAO API
What the API covers
FAOSTAT is FAO's primary statistical repository, tracking food and agriculture indicators across countries and regions over decades. The list_domains endpoint returns every available domain grouped into thematic clusters — Production, Trade, Food Balances, Prices, Land Use, Emissions, and more. Each domain record includes a domain_code, group_code, group_name, and a date_update field showing when data was last refreshed.
Navigating domain structure
list_dimensions accepts a domain_code and returns the full dimensional structure of that domain — for example, QCL (Crops and Livestock Products) uses area, item, element, and year dimensions, while trade domains substitute reporterarea and partnerarea. Each dimension links to one or more code lists. list_codes fetches all valid codes for a given list_id within a domain, returning code, label, parent, and aggregate_type per entry — so you know exactly which values to pass as filters.
Retrieving observation data
get_data is where statistical records come back. Filter using comma-separated codes for area, item, element, and year. For domains with non-standard dimensions (e.g. domains using month, sex, or indicator), pass additional filters via the filters parameter as semicolon-separated key=value pairs. Each record in the response carries the domain's dimension labels and codes in snake_case, plus unit, a numeric value, an observation flag, and a note. Results are paginated: page_size controls records per page (up to 5000), and has_more signals whether another page exists.
Language support and echoed parameters
All four endpoints accept a lang parameter to return labels in different languages. Every response echoes back the domain_code (and, where relevant, list_id) you requested, which simplifies building multi-step pipelines without tracking state manually.
The FAO API is a managed, monitored endpoint for fao.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when fao.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official fao.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track annual wheat production quantities by country using
get_datafiltered by item code 15 and element code 2510 from the QCL domain. - Build a food trade dashboard by querying trade domain dimensions with
list_dimensionsand pulling bilateral trade flows filtered byreporterareaandpartnerarea. - Retrieve historical greenhouse gas emissions by sector and country for climate research using the Emissions domain.
- Enumerate all available commodities in a domain using
list_codeswithlist_id=itemsto populate a commodity picker in a data exploration tool. - Compare food balance sheet components (supply, utilization, per-capita availability) across regions using
get_datawith region-level area codes. - Monitor data freshness across all FAOSTAT domains by polling
list_domainsand inspectingdate_updatefields. - Query land use statistics over time by filtering
get_dataon specific area and year codes from the Land Use domain.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does FAO provide an official developer API for FAOSTAT?+
How do I find valid codes to pass to `get_data`?+
get_data requires codes — not labels — for parameters like area, item, element, and year. Use list_codes with the appropriate list_id (e.g. countries, items, elements, years) and domain_code to get every valid code value for that dimension. Pass those codes as comma-separated strings to get_data.What does the `has_more` field in `get_data` responses mean?+
has_more is true when the current page was filled to page_size and additional records may exist. Increment page_number and repeat the request with the same filters to retrieve subsequent pages. page_size can be set between 1 and 5000.Does the API expose FAOSTAT metadata beyond domain and dimension listings, such as dataset methodologies or indicator definitions?+
list_domains), dimensional structure (list_dimensions), code lists (list_codes), and observation records (get_data). Narrative metadata such as dataset methodology documents, indicator definitions, or data collection notes are not returned by any endpoint. You can fork the API on Parse and revise it to add an endpoint targeting that metadata.Are sub-national or subnational data available through `get_data`?+
get_data. You can fork the API on Parse and revise it to point at other FAO data sources that publish subnational figures.