Sources › Finance › PIHPS (Harga Pangan) › Food Prices

PIHPS Food Prices API

Harga harian satu komoditas per provinsi. Hari tanpa survei dikembalikan sebagai null, bukan nol.

PIHPS (Harga Pangan)GET /pricesAll plans1 Zap

Request

GET
https://api.zapi.ink/v1/finance:pihps/prices

Send your key in the x-api-key header. The response is JSON in the { project, data, timestamp } envelope, and an identical request is served from cache for 1 hour.

Parameters

NameTypeInRequiredDescription
commoditystringqueryNoCommodity or category id from `pihps/commodities` (default cat_1, rice). Example: cat_1
marketenum: 1 | 2 | 3 | 4queryNoMarket tier: 1 traditional (default), 2 modern, 3 wholesaler, 4 producer. Example: 1
provincestringqueryNoProvince id from `pihps/regions`. Omit for all provinces. Example: 13
fromstringqueryNoStart date (YYYY-MM-DD or YYYYMMDD). Default 7 days back. Example: 2026-08-01
tostringqueryNoEnd date (YYYY-MM-DD or YYYYMMDD). Default today. Example: 2026-08-08

Code examples

cURL
curl -X GET "https://api.zapi.ink/v1/finance:pihps/prices?commodity=cat_1&market=1&province=13&from=2026-08-01&to=2026-08-08" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
JavaScript
const res = await fetch("https://api.zapi.ink/v1/finance:pihps/prices?commodity=cat_1&market=1&province=13&from=2026-08-01&to=2026-08-08", {
  method: "GET",
  headers: {
    "x-api-key": "zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
  },
});
const data = await res.json();
console.log(data);
Python
import requests

res = requests.get(
    "https://api.zapi.ink/v1/finance:pihps/prices",
    params={"commodity":"cat_1","market":"1","province":"13","from":"2026-08-01","to":"2026-08-08"},
    headers={"x-api-key":"zpi_xxxxxxxxxxxxxxxxxxxxxxxx"},
)
print(res.json())

Example response

200 OK · application/json
{
  "project": "finance:pihps",
  "data": {
    "to": "2026-08-07",
    "from": "2026-08-03",
    "count": 35,
    "dates": [
      "2026-08-03",
      "2026-08-04",
      "2026-08-05",
      "2026-08-06",
      "2026-08-07"
    ],
    "items": [
      {
        "level": 0,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 16200
          },
          {
            "date": "2026-08-04",
            "price": 16250
          },
          {
            "date": "2026-08-05",
            "price": 16250
          },
          {
            "date": "2026-08-06",
            "price": 16250
          },
          {
            "date": "2026-08-07",
            "price": 16250
          }
        ],
        "region": "Semua Provinsi"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 15650
          },
          {
            "date": "2026-08-04",
            "price": 15350
          },
          {
            "date": "2026-08-05",
            "price": 15650
          },
          {
            "date": "2026-08-06",
            "price": null
          },
          {
            "date": "2026-08-07",
            "price": 15350
          }
        ],
        "region": "Aceh"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 15350
          },
          {
            "date": "2026-08-04",
            "price": 15400
          },
          {
            "date": "2026-08-05",
            "price": 15400
          },
          {
            "date": "2026-08-06",
            "price": 15400
          },
          {
            "date": "2026-08-07",
            "price": 15400
          }
        ],
        "region": "Sumatera Utara"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 17900
          },
          {
            "date": "2026-08-04",
            "price": 17900
          },
          {
            "date": "2026-08-05",
            "price": 18150
          },
          {
            "date": "2026-08-06",
            "price": 17900
          },
          {
            "date": "2026-08-07",
            "price": 17900
          }
        ],
        "region": "Sumatera Barat"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 16650
          },
          {
            "date": "2026-08-04",
            "price": 16650
          },
          {
            "date": "2026-08-05",
            "price": 16650
          },
          {
            "date": "2026-08-06",
            "price": 16800
          },
          {
            "date": "2026-08-07",
            "price": 16700
          }
        ],
        "region": "Riau"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 15500
          },
          {
            "date": "2026-08-04",
            "price": null
          },
          {
            "date": "2026-08-05",
            "price": 15500
          },
          {
            "date": "2026-08-06",
            "price": 15500
          },
          {
            "date": "2026-08-07",
            "price": null
          }
        ],
        "region": "Kepulauan Riau"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 15550
          },
          {
            "date": "2026-08-04",
            "price": 15550
          },
          {
            "date": "2026-08-05",
            "price": 15550
          },
          {
            "date": "2026-08-06",
            "price": 15550
          },
          {
            "date": "2026-08-07",
            "price": 15550
          }
        ],
        "region": "Jambi"
      },
      {
        "level": 1,
        "prices": [
          {
            "date": "2026-08-03",
            "price": 15800
          },
          {
            "date": "2026-08-04",
            "price": 15800
          },
          {
            "date": "2026-08-05",
            "price": 15850
          },
          {
            "date": "2026-08-06",
            "price": 15850
          },
          {
            "date": "2026-08-07",
            "price": 15850
          }
        ],
        "region": "Bengkulu"
      }
    ],
    "market": "1",
    "source": "bank-indonesia-pihps",
    "currency": "IDR",
    "commodity": "cat_1"
  },
  "timestamp": "2026-08-08T10:10:23Z"
}

Frequently asked questions

How do I call the PIHPS Food Prices API?

Send a GET request to https://api.zapi.ink/v1/finance:pihps/prices with your Zapi key in the x-api-key header. Parameters — optional: commodity, market, province, from, to. The response is JSON in the { project, data, timestamp } envelope.

What does the PIHPS Food Prices API return?

Harga harian satu komoditas per provinsi. The example response has the fields to, from, count, dates, items, market, source, currency. Each item in items has fields such as level, prices, region.

Is the PIHPS Food Prices API free?

Yes. It is on the Zapi free tier: 600 Zap a month with one API key and no credit card. Each call costs 1 Zap. Paid plans raise the limits.

Can an AI assistant call the PIHPS Food Prices API?

Yes. Add the Zapi MCP server (https://mcp.zapi.ink/mcp) to Claude, Cursor or another MCP client and ask in plain words; it calls run_scraper with scraper "pihps" and endpoint "prices".

What other PIHPS API endpoints are there?

It has 2 endpoints. Besides Food Prices: Commodities.