Data Reference
Data Types

Data Types

FuelPrice

The core object returned by /prices and /prices/latest.

interface FuelPrice {
  id:            number;
  town:          string;
  super_petrol:  number;
  diesel:        number;
  kerosene:      number;
  valid_from:    string;  // ISO 8601 date: "YYYY-MM-DD"
  valid_to:      string;  // ISO 8601 date: "YYYY-MM-DD"
}

Fields

FieldTypeDescription
idintegerAuto-incrementing internal database ID. Stable once written; do not rely on ordering relative to other towns within the same cycle.
townstringTown name, title-cased (e.g. "Nairobi", "Homa Bay"). The canonical form is what the GET /towns endpoint returns.
super_petrolfloatMaximum retail price for Super Petrol (PMS) in KSh per litre.
dieselfloatMaximum retail price for Diesel (AGO) in KSh per litre.
kerosenefloatMaximum retail price for Kerosene (IK) in KSh per litre.
valid_fromstringFirst date this price is valid. ISO 8601 (YYYY-MM-DD). Always the 15th of a month.
valid_tostringLast date this price is valid. ISO 8601 (YYYY-MM-DD). Always the 14th of the following month.

Example

{
  "id": 1042,
  "town": "Nairobi",
  "super_petrol": 214.03,
  "diesel": 199.73,
  "kerosene": 196.53,
  "valid_from": "2026-06-15",
  "valid_to": "2026-07-14"
}

IngestResponse

Returned by POST /ingest/csv on success.

interface IngestResponse {
  status:             string;  // always "success"
  records_processed:  number;
  timestamp:          string;  // ISO 8601 UTC datetime
}

Fields

FieldTypeDescription
statusstringIngestion result. Currently always "success" for a 201 response.
records_processedintegerNumber of rows from the CSV that were upserted into the database.
timestampstringUTC ISO 8601 datetime string (YYYY-MM-DDTHH:MM:SSZ) of when the operation completed on the server.

Example

{
  "status": "success",
  "records_processed": 224,
  "timestamp": "2026-06-15T08:00:00Z"
}

Pricing cycle dates

EPRA pricing cycles run from the 15th of one month to the 14th of the next. The cycle identifiers map to calendar periods as follows:

Cyclevalid_fromvalid_to
Jun–Jul 20262026-06-152026-07-14
May–Jun 20262026-05-152026-06-14
Apr–May 20262026-04-152026-05-14

To determine the active cycle for a given calendar date:

  • If the date's day ≥ 15: valid_from = YYYY-MM-15, valid_to = next month's 14th
  • If the date's day < 15: valid_from = previous month's 15th, valid_to = YYYY-MM-14

Notes on precision

Prices are stored with two decimal places in the database (NUMERIC(6,2)). The JSON representation is a JavaScript float64, which is exact for values in the KSh price range. When displaying prices, format to 2 decimal places:

price.super_petrol.toFixed(2)  // "214.03"