Vai al contenuto
GET /v1/cost

Charge cost including losses

Provalo dal vivo

10 chiamate gratuite al giorno — senza registrazione, senza chiave API. Passa dal gateway oanor.

Intestazioni personalizzate (facoltative)
api.oanor.com/evcharging-api

Funziona. Prendi una chiave API e usala nel tuo progetto.

Ottieni una chiave API

Frammenti di codice

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_..."}
)

Risposta di esempio

Una risposta reale di questo endpoint, acquisita dall'ultimo 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
}