API & MCP

Everything a person can do on Bill Detective, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Bill Detective

Enter several billing periods of an electricity, gas, water or data bill. Bill Detective normalises consumption per day, flags unusual periods (outliers), unit-price and standing-charge changes, and totals that do not add up, each with a plain-English explanation.

Inputs of Bill Detective
FieldTypeDefaultDescription
unitselect (kWh, m3, liters, GB)"kWh"Consumption unit
currencytext"EUR"Currency
changeThresholdPercentnumber25Flag per-day change vs. previous period above
outlierPercentnumber30Flag periods above median by more than
tolerancePercentnumber1Arithmetic tolerance. Billed total may differ from consumption × unit price + charges by this much (rounding, taxes included in prices) before it is flagged.
periods (required)table—Billing periods. Start and end dates are both counted as billing days. Fixed charge = total standing/base charge for the period. Leave Total billed empty to skip the arithmetic check for a row.

Example request

Monthly electricity with a May spike and a spring price rise

curl -X POST https://billdetective.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"unit":"kWh","currency":"EUR","periods":[{"label":"Jan","startDate":"2026-01-01","endDate":"2026-01-31","consumption":310,"unitPrice":0.32,"fixedCharge":12,"totalBilled":111.2},{"label":"Feb","startDate":"2026-02-01","endDate":"2026-02-28","consumption":280,"unitPrice":0.32,"fixedCharge":12,"totalBilled":101.6},{"label":"Mar","startDate":"2026-03-01","endDate":"2026-03-31","consumption":300,"unitPrice":0.32,"fixedCharge":12,"totalBilled":108},{"label":"Apr","startDate":"2026-04-01","endDate":"2026-04-30","consumption":290,"unitPrice":0.35,"fixedCharge":12,"totalBilled":113.5},{"label":"May","startDate":"2026-05-01","endDate":"2026-05-31","consumption":520,"unitPrice":0.35,"fixedCharge":14,"totalBilled":198},{"label":"Jun","startDate":"2026-06-01","endDate":"2026-06-30","consumption":295,"unitPrice":0.35,"fixedCharge":14,"totalBilled":117.25}]}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "bill-detective": { "type": "http", "url": "https://billdetective.usefulweb.site/mcp" }
  }
}