Guide

How to track Toyota Corolla fuel level and refuels via API

· 3 min read

To track fuel level and refuels on a Toyota Corolla, query the DIMO Telemetry API with a Vehicle JWT: signalsLatest returns the current level, and segments with mechanism: refuel returns the refuels. The DIMO LTE R1 reports fuel level in liters, as powertrainFuelSystemAbsoluteLevel, on 2010 and newer Corollas, and it also reports refuel events. The AutoPi does not report fuel level on the Corolla.

DIMO gives developers API access to vehicle-state data: diagnostics, fault codes, battery and fuel health, odometer, and maintenance signals. Vehicle owners consent to and control sharing, so builders get data with clear provenance. See the Toyota Corolla vehicle page for the full signal list. For any other vehicle, see how to detect refuels.

Steps​

  1. Create a Developer License in the Developer Console and note its Client ID, Redirect URI and API Key.
  2. Get a Developer JWT. In the Developer Console, use the system-generated one or generate one with your API Key, as described in the authentication guide.
  3. Get the Corolla shared with you. Sharing happens through DIMO Connect.
  4. Exchange your Developer JWT for a Vehicle JWT through the Token Exchange API. Include the vehicle's token ID and request privilege 1 (all-time, non-location data) and privilege 4 (all-time location). The segments query requires both.
  5. Send the Vehicle JWT on Telemetry API requests as Authorization: Bearer <Vehicle JWT>.
  6. Read the current fuel level on the Corolla's DIMO LTE R1 with the signalsLatest query and the powertrainFuelSystemAbsoluteLevel signal.
  7. Detect refuels with the segments query and the refuel detection mechanism. It finds periods where fuel level rises significantly. The minIncreasePercent setting in config controls how large a rise counts, and the default is 15.
  8. Request the fuel level signal per segment with signalRequests. Refuel segments also include the level signal at the start and end by default.

Code​

Run each query against the Telemetry API with your Vehicle JWT in the Authorization header. Replace 12345 with your vehicle's token ID and set your own dates.

The first query reads the latest fuel level in liters:

query GetLatestFuel {
signalsLatest(tokenId: 12345) {
powertrainFuelSystemAbsoluteLevel {
value
timestamp
}
}
}

The second finds refuel segments over a date range:

query GetRefuels {
segments(
tokenId: 12345
from: "2026-11-01T00:00:00Z"
to: "2026-11-07T00:00:00Z"
mechanism: refuel
config: { minIncreasePercent: 15 }
signalRequests: [
{ name: "powertrainFuelSystemAbsoluteLevel", agg: LAST }
]
limit: 50
) {
start {
timestamp
value { latitude longitude }
}
end {
timestamp
value { latitude longitude }
}
duration
isOngoing
signals { name agg value }
}
}

To run these against your own Corolla, create a Developer License in the Developer Console and work through the authentication guide.

FAQ​

Which Corolla connection reports fuel level and refuels?​

The DIMO LTE R1 reports fuel level and refuel events on a Toyota Corolla, on 2010 and newer model years. On the Corolla, the AutoPi reports idling as its only event and does not report a fuel level signal.

What unit is the fuel level in?​

The powertrainFuelSystemAbsoluteLevel signal is reported in liters on the DIMO LTE R1.

How wide can the refuel query date range be?​

A segments query has a maximum date range of 31 days. It returns up to 200 segments per request, with a default of 100, and you can page with the after argument.

Methodology: based on the DIMO documentation for Authentication, Building Your First App, and the Telemetry API Signals and Segments references, plus the signals and events listed on the Toyota Corolla vehicle page.

More guides · Browse vehicles