Naar de inhoud
GET /v1/cost

Charge cost including losses

Probeer het live

10 gratis calls per dag — geen registratie, geen API-key. Loopt via de oanor-gateway.

Aangepaste headers (optioneel)
api.oanor.com/evcharging-api

Het werkt. Haal een API-key op en gebruik hem in je project.

Verkrijg een API-sleutel

Codefragmenten

curl "https://api.oanor.com/evcharging-api/v1/cost" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/evcharging-api/v1/cost", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/evcharging-api/v1/cost");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/evcharging-api/v1/cost",
    headers={"x-oanor-key": "oanor_test_..."}
)

Voorbeeldrespons

Een echte respons van dit endpoint, vastgelegd bij de laatste health check.

{
    "data": {
        "note": "You pay for the energy drawn from the grid, which is the energy to the battery ÷ the charging efficiency (~85–95 %), times the price. Home overnight rates make EV miles very cheap; DC fast chargers cost several times more per kWh, so charge at home when you can and use fast charging for trips.",
        "inputs": {
            "price_per_kwh": 0.15,
            "charge_efficiency_pct": 90,
            "energy_to_battery_kwh": 36
        },
        "grid_kwh": 40,
        "charge_cost": 6,
        "cost_per_kwh_to_battery": 0.167
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:56.277Z",
        "request_id": "b1f28584-c787-400d-ae64-9dc4055546ee"
    },
    "status": "ok",
    "message": "Charge cost",
    "success": true
}