An energy pricing API from your Excel price sheet.
An energy pricing API calculates an offer from a customer's usage and your price sheet: unit rate, standing charge, total cost and the monthly instalment. Your Excel workbook already does that. SpreadAPI publishes it as an API and as an electricity tariff calculator for your website, so sales, partner portals and AI assistants quote from the same price sheet.
- Monthly instalment
- $150.00
- Unit rate (¢/kWh)
- 34.1
- Grid fee (¢/kWh)
- 8.6
- Cheapest tariff at this usage
- Flex
| Month | Usage kWh | Cost | Instalment | Balance |
|---|---|---|---|---|
| 1 | 426 | $196.67 | $150.00 | -$46.67 |
| 2 | 384 | $178.61 | $150.00 | -$75.28 |
| 3 | 357 | $167.00 | $150.00 | -$92.28 |
| 4 | 300 | $142.49 | $150.00 | -$84.77 |
| 5 | 266 | $127.87 | $150.00 | -$62.64 |
| 6 | 239 | $116.26 | $150.00 | -$28.90 |
See the call
An example, not a live call: the request for the default values and the outputs of the answer.
https://spreadapi.io/api/v1/services/410c7f87-78c7-42db-83dd-edbe83cb2d03_mwf718ltbrlcd/execute?usage=3800&tariff=Green&grid_area=Central&bonus=0.05
{
"outputs": [
{
"name": "unit_rate",
"title": "Unit rate (¢/kWh)",
"value": 34.1,
"formatString": "0.00"
},
{
"name": "grid_fee",
"title": "Grid fee (¢/kWh)",
"value": 8.6,
"formatString": "0.00"
},
{
"name": "energy_cost",
"title": "Energy cost per year",
"value": 1622.6,
"formatString": "$#,##0.00"
},
{
"name": "standing_charge",
"title": "Standing charge per year",
"value": 160.8,
"formatString": "$#,##0.00"
},
{
"name": "bonus_amount",
"title": "Bonus in the first year",
"value": -89.17,
"formatString": "$#,##0.00"
},
{
"name": "tax",
"title": "Sales tax 6 %",
"value": 101.65,
"formatString": "$#,##0.00"
},
{
"name": "total_first_year",
"title": "Total cost in the first year",
"value": 1795.88,
"formatString": "$#,##0.00"
},
{
"name": "monthly_instalment",
"title": "Monthly instalment",
"value": 150,
"formatString": "$#,##0.00"
},
{
"name": "cheapest_tariff",
"title": "Cheapest tariff at this usage",
"value": "Flex"
},
{
"name": "monthly_forecast",
"title": "Monthly forecast",
"value": [
["Month", "Usage kWh", "Cost", "Instalment", "Balance"],
[1, 426, 196.67, 150, -46.67],
[2, 384, 178.61, 150, -75.28],
[3, 357, 167, 150, -92.28],
[4, 300, 142.49, 150, -84.77],
[5, 266, 127.87, 150, -62.64],
[6, 239, 116.26, 150, -28.9],
[7, 232, 113.25, 150, 7.85],
[8, 239, 116.26, 150, 41.59],
[9, 270, 129.59, 150, 62],
[10, 315, 148.94, 150, 63.06],
[11, 369, 172.16, 150, 40.9],
[12, 403, 186.78, 150, 4.12]
]
}
]
}A new price sheet should be live the same day.
Today the prices change in the Excel file, then someone rebuilds them in the tariff calculator on the website, the sales tool and the partner portal. Each copy can drift.
Own the price sheet
Change a unit rate or a grid fee in the price sheet and republish. The workbook is the pricing engine; nobody re-keys it.
Call one endpoint
Website, sales tool and partner portal send usage, tariff and grid area and get the offer and its monthly forecast as JSON.
Quote from a link
The ready-made web calculator runs on the same price sheet, by link or embedded in a partner site.
The offer and the twelve months behind it.
Mark the monthly forecast as a result and every offer carries it: usage, cost, instalment and the running balance for each month.
The workbook also names the cheapest tariff at this usage, with a formula. An AI assistant that uses the service answers with these numbers. It does not estimate a price.
The engine calculates with more than 500 Excel functions, including dynamic arrays, LET and LAMBDA. The table comes from formulas that spill, like in Excel. Measured on our demo calculator: a calculation takes about 20 ms on the server, and a call returns in about 100 ms from Europe.
"outputs": [
{ "name": "total_first_year", "value": 1795.88 },
{ "name": "monthly_instalment", "value": 150 },
{ "name": "monthly_forecast", "value": [
["Month", "Usage kWh", "Cost", "Instalment", "Balance"],
[1, 426, 196.67, 150, -46.67],
[2, 384, 178.61, 150, -75.28],
[3, 357, 167, 150, -92.28],
… 9 more rows
] }
]From the answer of the example above, default values
Where it fits
- Tariff calculators on a website or in a partner portal
- Offers for sales and service teams, by API or by link
- Many offers in one batch call, for example a list of customers in a nightly job
- A price model an AI assistant has to apply exactly
What it is not
- No market data feed: the prices come from your sheet
- No billing, no metering, no customer accounts
- No version history with rollback and no audit trail of price changes
- Macros in the workbook do not run
Where the data runs
In our cloud, or with the on-premises runtime on your own infrastructure. Callers never see the formulas, only the results you mark.
Try it with your own price sheet.
Import the Excel file, mark the inputs and the results, publish.