Food prices All docs

Food prices API Reference

5 routes. Base URL https://api.apifor.dev, authenticated with x-api-key. Failed calls are not charged. Overview, limits and sources are on the Food price API page.

GET/v1/food-prices1 credit

Monthly average prices per commodity, level and region, newest month first. Months with no reported price are left out. 1 credit. WFP rows are per market (region_level market) with market details under local.

ParameterInTypeRules
countryquerystringISO 3166-1 alpha-2 · default ID · ISO 3166-1 alpha-2 code: ID (default), MY, or a WFP country (PH, KH, LA, MM, TL, TH, VN). Other codes return an empty list.
sourcequerystringone of bapanas, pricecatcher, wfp · wfp = WFP market prices via HDX HAPI (PH, KH, LA, MM, TL, TH, VN, and ID). Used automatically for those countries; with source=wfp and no country every WFP country is searched.
commodityquerystringA code from /v1/food-prices/commodities (e.g. rice-medium) or part of the English or original name. For MY also a PriceCatcher item_code (e.g. 1).
regionquerystringnational, an ISO 3166-2 code (ID-JB), a 2-digit statistics code, or part of a province name. All regions when left out. For MY: national, MY-01..MY-16 or part of a state name. For WFP countries: an OCHA admin p-code (PH13), a WFP market code, or part of a region or market name.
levelquerystringone of consumer, producer, wholesale · consumer (retail), producer (farm-gate, mill; ID only) or wholesale (WFP only). Both levels of the source when left out.
fromquerystringFirst month, YYYY-MM.
toquerystringLast month, YYYY-MM.
pagequeryintegerdefault 1 · Page number, from 1.
limitqueryinteger1 to 200 · default 50 · Rows per page, at most 200.
GET/v1/food-prices
curl 'https://api.apifor.dev/v1/food-prices?country=ID&source=wfp&commodity=rice-medium&region=ID-JB&level=consumer&from=2025-01&to=2026-01&page=1&limit=50' \
  -H 'x-api-key: YOUR_API_KEY'
Example response · 200
{
  "success": true,
  "data": [
    {
      "country": "ID",
      "commodity": "rice-medium",
      "commodity_name": "Medium-grade rice",
      "commodity_original": "Beras Medium",
      "level": "consumer",
      "region_level": "province",
      "region_code": "ID-JB",
      "region_name": "Jawa Barat",
      "region_source_code": "32",
      "period": "2026-01",
      "price": 12964,
      "currency": "IDR",
      "unit": "IDR/kg"
    },
    {
      "country": "ID",
      "commodity": "rice-medium",
      "commodity_name": "Medium-grade rice",
      "commodity_original": "Beras Medium",
      "level": "consumer",
      "region_level": "province",
      "region_code": "ID-JB",
      "region_name": "Jawa Barat",
      "region_source_code": "32",
      "period": "2025-12",
      "price": 13001,
      "currency": "IDR",
      "unit": "IDR/kg"
    }
  ],
  "meta": {
    "total": 61,
    "page": 1,
    "per_page": 2,
    "total_pages": 31,
    "coverage": [
      "ID"
    ],
    "attribution": {
      "source": "Badan Pangan Nasional (National Food Agency of Indonesia), Open Data Pangan",
      "license": "Indonesian government publication (Law 28/2014 on Copyright, Art. 43(b)); attribution required by APIFor policy",
      "license_url": "https://peraturan.bpk.go.id/Download/28018/UU_Nomor_28_Tahun_2014.pdf",
      "source_url": "https://data.badanpangan.go.id/datasetpublications",
      "attribution_page": "https://data.badanpangan.go.id",
      "notice": "Source: Badan Pangan Nasional, Open Data Pangan (data.badanpangan.go.id). Monthly averages as published; APIFor added English commodity n..."
    }
  }
}
  • 200Price rows
  • 400Invalid parameter
GET/v1/food-prices/commodities1 credit

Every commodity with a price series: English code and name, every original spelling, unit and the months covered. 1 credit.

ParameterInTypeRules
countryquerystringISO 3166-1 alpha-2 · default ID · ISO 3166-1 alpha-2 code: ID (default), MY, or a WFP country (PH, KH, LA, MM, TL, TH, VN). Other codes return an empty list.
sourcequerystringone of bapanas, pricecatcher, wfp · wfp = WFP market prices via HDX HAPI (PH, KH, LA, MM, TL, TH, VN, and ID). Used automatically for those countries; with source=wfp and no country every WFP country is searched.
levelquerystringone of consumer, producer, wholesale · consumer (retail), producer (farm-gate, mill; ID only) or wholesale (WFP only). Both levels of the source when left out.
GET/v1/food-prices/commodities
curl 'https://api.apifor.dev/v1/food-prices/commodities?country=ID&source=wfp&level=consumer' \
  -H 'x-api-key: YOUR_API_KEY'
Example response · 200
{
  "success": true,
  "data": [
    {
      "country": "ID",
      "code": "rice-medium",
      "name": "Medium-grade rice",
      "level": "consumer",
      "unit": "IDR/kg",
      "names_original": [
        "Beras Medium"
      ],
      "first_period": "2021-01",
      "last_period": "2026-01",
      "rows": 2235,
      "currency": "IDR"
    }
  ],
  "meta": {
    "total": 1,
    "coverage": [
      "ID"
    ],
    "attribution": {
      "source": "Badan Pangan Nasional (National Food Agency of Indonesia), Open Data Pangan",
      "license": "Indonesian government publication (Law 28/2014 on Copyright, Art. 43(b)); attribution required by APIFor policy",
      "license_url": "https://peraturan.bpk.go.id/Download/28018/UU_Nomor_28_Tahun_2014.pdf",
      "source_url": "https://data.badanpangan.go.id/datasetpublications",
      "attribution_page": "https://data.badanpangan.go.id",
      "notice": "Source: Badan Pangan Nasional, Open Data Pangan (data.badanpangan.go.id). Monthly averages as published; APIFor added English commodity n..."
    }
  }
}
  • 200Commodity list
  • 400Invalid parameter
GET/v1/food-prices/latest1 credit

The newest month for each commodity in one region (national by default), with the month before and the change in percent. 1 credit.

ParameterInTypeRules
countryquerystringISO 3166-1 alpha-2 · default ID · ISO 3166-1 alpha-2 code: ID (default), MY, or a WFP country (PH, KH, LA, MM, TL, TH, VN). Other codes return an empty list.
sourcequerystringone of bapanas, pricecatcher, wfp · wfp = WFP market prices via HDX HAPI (PH, KH, LA, MM, TL, TH, VN, and ID). Used automatically for those countries; with source=wfp and no country every WFP country is searched.
commodityquerystringA code from /v1/food-prices/commodities (e.g. rice-medium) or part of the English or original name. For MY also a PriceCatcher item_code (e.g. 1).
regionquerystringnational (default), an ISO 3166-2 code, a 2-digit statistics code or part of a province name. For MY: national, MY-01..MY-16 or part of a state name. For WFP countries: an OCHA admin p-code (PH13), a WFP market code, or part of a region or market name.
levelquerystringone of consumer, producer, wholesale · consumer (retail), producer (farm-gate, mill; ID only) or wholesale (WFP only). Both levels of the source when left out.
GET/v1/food-prices/latest
curl 'https://api.apifor.dev/v1/food-prices/latest?country=ID&source=wfp&commodity=rice-medium&region=national&level=consumer' \
  -H 'x-api-key: YOUR_API_KEY'
Example response · 200
{
  "success": true,
  "data": [
    {
      "country": "ID",
      "commodity": "rice-medium",
      "commodity_name": "Medium-grade rice",
      "commodity_original": "Beras Medium",
      "level": "consumer",
      "region_level": "national",
      "region_code": "ID",
      "region_name": "Indonesia",
      "region_source_code": null,
      "period": "2026-01",
      "price": 13517,
      "currency": "IDR",
      "unit": "IDR/kg",
      "previous_period": "2025-12",
      "previous_price": 13540,
      "change_pct": -0.17
    }
  ],
  "meta": {
    "total": 1,
    "coverage": [
      "ID"
    ],
    "attribution": {
      "source": "Badan Pangan Nasional (National Food Agency of Indonesia), Open Data Pangan",
      "license": "Indonesian government publication (Law 28/2014 on Copyright, Art. 43(b)); attribution required by APIFor policy",
      "license_url": "https://peraturan.bpk.go.id/Download/28018/UU_Nomor_28_Tahun_2014.pdf",
      "source_url": "https://data.badanpangan.go.id/datasetpublications",
      "attribution_page": "https://data.badanpangan.go.id",
      "notice": "Source: Badan Pangan Nasional, Open Data Pangan (data.badanpangan.go.id). Monthly averages as published; APIFor added English commodity n..."
    }
  }
}
  • 200Latest prices
  • 400Invalid parameter
GET/v1/food-prices/anomalies1 credit

Monthly price anomaly index per commodity (QIPA, AIPA, IFPA) with a status such as alert_high or warning_low. 1 credit.

ParameterInTypeRules
countryquerystringISO 3166-1 alpha-2 · default ID · ISO 3166-1 alpha-2 country code: ID (default) or MY. Other codes return an empty list.
commodityquerystringCode or part of a name.
fromquerystringFirst month, YYYY-MM.
toquerystringLast month, YYYY-MM.
GET/v1/food-prices/anomalies
curl 'https://api.apifor.dev/v1/food-prices/anomalies?country=ID&commodity=beef&from=2026-10&to=2026-10' \
  -H 'x-api-key: YOUR_API_KEY'
Example response · 200
{
  "success": true,
  "data": [
    {
      "country": "ID",
      "commodity": "beef",
      "commodity_name": "Beef (lean)",
      "commodity_original": "Daging Sapi Murni",
      "period": "2026-10",
      "qipa": 4.576311018,
      "aipa": 2.67910535,
      "ifpa": 3.437987617,
      "status": "alert_high",
      "status_original": "Alert (High Price)"
    }
  ],
  "meta": {
    "total": 1,
    "coverage": [
      "ID"
    ],
    "attribution": {
      "source": "Badan Pangan Nasional (National Food Agency of Indonesia), Open Data Pangan",
      "license": "Indonesian government publication (Law 28/2014 on Copyright, Art. 43(b)); attribution required by APIFor policy",
      "license_url": "https://peraturan.bpk.go.id/Download/28018/UU_Nomor_28_Tahun_2014.pdf",
      "source_url": "https://data.badanpangan.go.id/datasetpublications",
      "attribution_page": "https://data.badanpangan.go.id",
      "notice": "Source: Badan Pangan Nasional, Open Data Pangan (data.badanpangan.go.id). Monthly averages as published; APIFor added English commodity n..."
    }
  }
}
  • 200Anomaly rows
  • 400Invalid parameter
GET/v1/food-prices/coverageFree

Countries this service covers, with sources, licences, row counts and country-only fields. Free (0 credits), still needs an API key. Price note: Free.

GET/v1/food-prices/coverage
curl 'https://api.apifor.dev/v1/food-prices/coverage' \
  -H 'x-api-key: YOUR_API_KEY'
Example response · 200
{
  "success": true,
  "data": {
    "service": "food-prices",
    "global": false,
    "country_param": "optional",
    "param_name": "country",
    "countries": [
      {
        "country": "ID",
        "market": null,
        "subdivision_levels": [
          "province",
          "regency"
        ],
        "rows": null,
        "updated_at": null,
        "sources": [
          {
            "name": "Badan Pangan Nasional, Open Data Pangan",
            "url": "https://data.badanpangan.go.id",
            "licence": "Government publication, Law 28/2014 Art. 43(b), attribution",
            "attribution": null
          },
          {
            "name": "WFP market prices via HDX HAPI",
            "url": "https://data.humdata.org/dataset/global-wfp-food-prices",
            "licence": "CC BY-IGO",
            "attribution": "Source: World Food Programme (WFP) via HDX HAPI, CC BY-IGO; monthly means by APIFor"
          }
        ],
        "local_fields": [],
        "notes": "Monthly prices by commodity and market level. With source=wfp: WFP market prices 2017 to 2021 (about 320k monthly rows, 220 markets)."
      },
      {
        "country": "MY",
        "market": null,
        "subdivision_levels": [
          "state"
        ],
        "rows": 416845,
        "updated_at": "2026-11-30",
        "sources": [
          {
            "name": "KPDN PriceCatcher via data.gov.my",
            "url": "https://data.gov.my/data-catalogue/pricecatcher",
            "licence": "CC BY 4.0",
            "attribution": "Source: KPDN PriceCatcher, data.gov.my (CC BY 4.0); aggregated monthly by APIFor"
          }
        ],
        "local_fields": [
          "item_code",
          "item_group"
        ],
        "notes": "Consumer (retail) prices only, from 2022-01. Daily premise-level prices averaged per month, item and state, plus national (region MY). It..."
      }
    ]
  }
}
  • 200Coverage

Error handling · Rate limits · Prices