API Reference
Endpoints overview

API Reference

Base URL: https://api.fuelkenya.com/v1

All endpoints return application/json. Dates are ISO 8601 strings (YYYY-MM-DD). Prices are floating-point numbers in KSh per litre.

Endpoint summary

MethodPathAuthDescription
GET/healthNoneDatabase health check
GET/townsNoneList all available towns
GET/pricesNoneList prices with optional filters and pagination
GET/prices/latestNoneLatest pricing cycle prices
POST/ingest/csvBearer tokenUpload a new EPRA pricing cycle CSV

HTTP methods

The API uses standard HTTP semantics:

  • GET — read-only, safe to cache and retry
  • POST — used only for the ingest endpoint; creates/updates records

Content negotiation

All responses are Content-Type: application/json; charset=utf-8. The ingest endpoint accepts multipart/form-data for the file upload.

Error format

All errors follow FastAPI's default error envelope:

{
  "detail": "Human-readable error message"
}

Validation errors (status 422) include a richer detail array describing which fields failed and why. See Errors for the full list.