API
A small, read-only HTTP API over your own data. Included with Max. See plans, then create a token on your Account page.
Authentication
Send your token as a bearer token. Tokens are read-only and can be revoked at any time.
curl -H "Authorization: Bearer evlogr_xxx" \
https://evlogr.com/api/v1/vehiclesEndpoints
| Endpoint | Returns |
|---|---|
| GET /api/v1/vehicles | Your vehicles, model, battery size, sync state |
| GET /api/v1/drives | Drives: times, distance, battery, places |
| GET /api/v1/charges | Charges: the kWh the cost refers to, energy at the battery and at the wall, cost, price/kWh, location |
| GET /api/v1/state | The car right now: battery, charging state, charge limit, amps, volts, range, odometer |
Parameters
limit (1–500, default 100), offset, from / to (ISO timestamps, filtered on start time) and vehicle_id. Results are newest-first.
curl -H "Authorization: Bearer evlogr_xxx" \
"https://evlogr.com/api/v1/charges?from=2026-01-01&limit=50"Response shape
{
"data": [
{
"id": 265,
"vehicle_id": "…",
"started_at": "2026-08-12T20:15:27Z",
"ended_at": "2026-08-12T22:41:02Z",
"location_label": "Home",
"energy_added_kwh": 26.7,
"wall_kwh": 28.4,
"priced_kwh": 28.4,
"cost": 2.04,
"cost_source": "tariff",
"free_reason": null,
"saved": null,
"currency": "EUR",
"price_per_kwh": 0.0718
}
],
"limit": 100,
"offset": 0
}Which kWh, and which cost
priced_kwh is the quantity cost was worked out from, so cost ÷ priced_kwh is price_per_kwh. It is the one to sum next to cost, or to divide cost by.
energy_added_kwh is what reached the battery. wall_kwh is what the charger delivered, integrated from the power your car reported — larger, because an onboard charger loses some of it as heat. It is null when the samples can’t support it. Neither is the billed quantity. priced_kwh starts from wall_kwh, but a reading no charger could physically produce is corrected first, a session with no usable wall reading is priced on the battery’s gain, and on a Supercharger session Tesla invoiced it is the kWh on that invoice (where energy_added_kwh carries the same meter reading).
cost_source says how cost was arrived at: tariff from your own prices (priced_kwh × price_per_kwh), invoice for Tesla’s own invoiced amount at a Supercharger, override for a figure you typed, free or free_place for a session that cost nothing because it, or the place it happened at, was marked free — where free_reason is solar or free and saved is what it would have cost at your own prices — or unknown when no price was configured at the time. Sessions recorded before this field existed report null.
Current state
One call for the car as it stands. vehicle_id is optional with a single vehicle. Read-only, like everything here: evlogr never sends commands to your car, so there is nothing here that starts a charge or changes a limit.
{
"data": {
"vehicle_id": "…",
"display_name": "Teslucky",
"battery_level": 80,
"charging_state": "Disconnected",
"charge_limit_soc": 80,
"charger_actual_current": 0,
"charger_voltage": 2,
"charger_power_kw": 0,
"charge_port_door_open": false,
"minutes_to_full_charge": 0,
"ideal_range_km": 372.4,
"odometer_km": 65959.13,
"is_climate_on": null,
"inside_temp_c": 21.6,
"outside_temp_c": 23.5,
"poll_state": "asleep",
"last_polled_at": "2026-08-24T08:55:20.917Z",
"sampled_at": "2026-08-24T07:43:11.361Z",
"car_info_at": "2026-08-24T07:43:11.361Z"
}
}charging_state is Tesla’s own: Disconnected, Charging, Complete, Stopped, Starting, NoPower, or null before anything has been reported.
Three timestamps because there are three sources. last_polled_at advances on every poll, including one that finds the car asleep and records no sample — so a recent last_polled_at beside an older sampled_at is normal, and means the readings predate the last check. Use both to decide what you still trust. Values are numbers and booleans, not strings.
Rate limits & errors
120 requests per minute per token. 401 means a missing or invalid token, 403 means your plan no longer includes API access, 429 means you hit the limit.
Home Assistant
A REST sensor that exposes your latest charge cost:
# configuration.yaml
sensor:
- platform: rest
name: evlogr last charge cost
resource: https://evlogr.com/api/v1/charges?limit=1
headers:
Authorization: !secret evlogr_token
value_template: "{{ value_json.data[0].cost }}"
unit_of_measurement: EUR
scan_interval: 900
# ...and the car as it stands, from one call
- platform: rest
name: evlogr vehicle
resource: https://evlogr.com/api/v1/state
headers:
Authorization: !secret evlogr_token
value_template: "{{ value_json.data.battery_level }}"
unit_of_measurement: "%"
json_attributes_path: "$.data"
json_attributes:
- charging_state
- charge_limit_soc
- charger_power_kw
- charge_port_door_open
- ideal_range_km
- sampled_at
scan_interval: 60Need something this doesn’t cover? Tell us — the API grows with what people ask for.