API reference

Plan an EV road trip with charging stops, and look up chargers. These are the endpoints the embeddable planner itself calls. No API key and no sign-in: every endpoint is public and rate-limited per caller IP. Every error response is JSON with a single error string that is safe to show to a person.

The basics

  • Base URLs: / (production). The embed widget calls the same paths on whichever site serves it.
  • No API key or sign-in. Limits are per caller IP and reset on their own.
  • Errors are JSON, { "error": "..." }, with a message that is safe to show to a person. A 429 always says whether it was this caller’s limit or a shared provider’s daily quota.
  • Distances are kilometres, times are hours unless a field says minutes, battery levels are percentages from 0 to 100.
  • Machine-readable OpenAPI 3.1 description: /api/openapi.json (import it into Postman, Insomnia or a client generator).

Plan a trip

post/api/plan

Geocodes the origin, destination and any waypoints, routes between them, finds chargers along the way that the chosen vehicle can plug into, and returns three plans: optimal (shortest total time), fewer and fewest (fewer charging stops). Routes and chargers are cached for 7 days per origin/destination pair, so repeat trips are fast. Set ephemeralPlan: true for a driver-started update that must not read or write the route cache.

Send Accept: application/x-ndjson to stream the answer instead: one JSON object per line, in order route, chargers, plan (each with a stage field and the same fields as the combined response), so the route can be drawn before the charging plan is ready. In a stream, a failure after the response has started arrives as a final {"stage":"error","error":"..."} line with status 200.

Rate limit
20 plan units per 5 minutes per IP. A request costs 1 unit plus 1 per waypoint. Trips that need new routing also draw on the free providers' shared daily quotas; when those run out the response is a 429 naming the daily limit.
Cross-origin
Yes, callable from a page on any origin (CORS).

Request body

Plan a trip request body
FieldTypeDescription
originQueryrequiredstringWhere the trip starts: an address or place name.
destinationQueryrequiredstringWhere the trip ends.
vehicleModelIdrequiredstringWhich car, from the built-in catalogue.
One of 33 values, for example tesla:model3:2024:lfp:rwd
  • tesla:model3:2024:lfp:rwd
  • tesla:model3:2024:lr:awd
  • tesla:modely:2024:lr:awd
  • tesla:models:2024:lr
  • tesla:modelx:2024:lr-awd
  • tesla:cybertruck:2024:awd
  • ford:mache:2023:premium-er:rwd
  • ford:f150lightning:2023:er
  • chevrolet:equinoxev:2024:2lt:fwd
  • chevrolet:blazerev:2024:2lt:awd
  • chevrolet:boltev:2023
  • hyundai:ioniq5:2024:se-lr:rwd
  • hyundai:ioniq6:2024:se-lr:rwd
  • kia:ev6:2024:lr:rwd
  • kia:ev9:2024:lr:rwd
  • kia:niroev:2024:wind:fwd
  • rivian:r1s:2024:dual-large
  • rivian:r1t:2025:dual-large
  • nissan:ariya:2023:venture-plus:fwd
  • volkswagen:id4:2023:pro:rwd
  • bmw:i4:2023:edrive40
  • bmw:ix:2024:xdrive50
  • chevrolet:bolteuv:2023
  • polestar:polestar2:2024:lr-single
  • audi:q4etron:2023:quattro
  • hyundai:konaelectric:2024
  • nissan:leaf:2023:sv-plus
  • mercedes-benz:eqs:2024:450plus:sedan
  • lucid:air:2024:pure:rwd
  • cadillac:lyriq:2024:rwd
  • honda:prologue:2024:ex:awd
  • toyota:bz4x:2024:xle:fwd
  • subaru:solterra:2024:premium:awd
startSoCPercentrequirednumberBattery at departure, 0-100.
minSoCAtChargerPercentrequirednumberNever arrive at a charger below this battery level.
minSoCAtDestinationPercentrequirednumberArrive at the destination with at least this much battery.
relativeSpeedPercentnumberDrive faster or slower than the speed limit, as a percentage of it. (default 100)
outsideTempCnumberOutside temperature in Celsius. Defaults to a seasonal estimate.
useWeatherForecastbooleanUse forecast temperature along the route instead of outsideTempC. A dated departure enables this automatically. (default false)
departureAtstringDeparture date and clock time with an explicit UTC offset. Forecast samples are taken at approximate drive-time arrival along the route; unavailable portions use the manual or seasonal temperature.
ephemeralPlanbooleanSkip route-cache reads and writes for this request, including its coordinates. (default false)
batteryHealthPercentnumberUsable capacity as a percentage of new. (default 100)
realConsumptionWhPerKmnumberThe driver's own measured consumption, overriding the model's.
maxChargeLimitPercentnumberNever charge above this battery level at a stop. (1 to 100, default 100)
chargerFiltersChargerFiltersWhich chargers the planner may use.
avoidTollwaysboolean(default false)
avoidHighwaysboolean(default false)
avoidFerriesboolean(default false)
avoidBordersboolean(default false)
waypointsWaypoint[]Up to 5 stops between origin and destination, in order. (at most 5 items)
includeRoundTripbooleanAlso check whether the driver can get home from the destination without charging there first, using the return leg's own route, elevation and available forecast weather. Adds one more routing lookup. (default false)
excludedChargerIdsstring[]Charger ids the driver explicitly replaced; the optimizer will not select them again. (at most 20 items)

ChargerFilters

ChargerFilters
FieldTypeDescription
preferredNetworksstring[]Network names, as in a charger's networkName. (at most 50 items)
networkFilterMode"include" | "exclude"Use only preferredNetworks, or avoid them.
minStallCountnumber(at least 0)
minChargerPowerKwnumber(at least 0)

Waypoint

Waypoint
FieldTypeDescription
querystringAn address or place name.
pinnedChargerCharger
targetSoCPercentnumberCharge up to this level at a pinned charger. (default 100)
dwellMinutesnumberTime spent at an address stop, added to the trip time.

Example request

curl
curl -X POST '//api/plan' \
  -H 'Content-Type: application/json' \
  -d '{"originQuery":"Los Angeles, CA","destinationQuery":"Las Vegas, NV","vehicleModelId":"tesla:model3:2024:lr:awd","startSoCPercent":90,"minSoCAtChargerPercent":10,"minSoCAtDestinationPercent":10}'

Response 200

The trip plan.

Plan a trip 200 response
FieldTypeDescription
originrequiredGeocodedPlace
destinationrequiredGeocodedPlace
waypointsrequiredGeocodedPlace[]Where each requested waypoint geocoded to.
routerequiredRoute
chargersrequiredCharger[]Every charger found along the route, before plug filtering.
planrequiredobjectThe three plans, one per objective.
batteryProfilesobjectBattery level along the route for each plan, for a chart.
steepGradientSegmentobject | nullThe longest steep climb on the route, if any.
legElevationEffectsobjectClimb and descent per leg between stops, for each plan.
weatherNoteobject | nullThe most notable forecast temperature, when useWeatherForecast is on.
weatherCoverage"complete" | "partial" | "unavailable"Coverage of the five route weather samples. Missing forecast segments use the manual or seasonal temperature.
batteryInsightsobjectElevation-and-battery highlights for each plan: major summits and the lowest predicted battery point.
regenSummaryobjectRoute-wide climb/regen energy effect (one value, shared across every plan - it depends only on the route and vehicle).
reserveTradeoffobject | nullA third trade-off beside stop count: the optimal plan re-run with a higher destination reserve, and the actual difference in time, stops and arrival battery.
roundTripobject | nullPresent only when the request set includeRoundTrip.
roundTripsobjectReturn-route battery checks for each outbound objective, using that objective's arrival battery. roundTrip is the optimal check for compatibility.
roundTripStatus"available" | "unavailable" | "not-applicable"Present when a round-trip check was requested. The check may be unavailable even when the outbound plan succeeds.
roundTripWeatherCoverage"complete" | "partial" | "unavailable"Weather coverage on the independently routed return leg, when weather-aware planning is enabled.
roundTripElevationAvailablebooleanWhether elevation was available on the independently routed return leg.
planningOutsideTempCnumberThe temperature actually used by the energy model, including forecast mode.

GeocodedPlace

GeocodedPlace
FieldTypeDescription
latrequirednumber(-90 to 90)
lonrequirednumber(-180 to 180)
displayNamerequiredstring

Route

Route
FieldTypeDescription
coordinatesrequirednumber[][]The route line as [lon, lat] pairs.
edgesrequiredobject[]One entry per pair of consecutive coordinates.
totalDistanceKmrequirednumber
totalDurationHoursrequirednumberDriving time, without charging.
elevationAvailablerequiredbooleanFalse when every elevation provider failed and the plan assumed flat ground.
usingFallbackRoutingrequiredbooleanTrue when the backup routing provider was used.
elevationsrequirednumber[]Metres, one per coordinate.

Charger

Charger
FieldTypeDescription
idrequiredstring
namerequiredstring
latrequirednumber(-90 to 90)
lonrequirednumber(-180 to 180)
distanceAlongRouteKmnumber
maxPowerKwrequirednumber(at least 0)
networkNamestring
addressstring
hoursstring
priceTextstring
lastConfirmedstring
sources"openchargemap" | "afdc"[]
fieldSourcesobject
stallCountinteger | null
connectionsobject[]
source"openchargemap" | "afdc" | "mock"

TripPlan

TripPlan
FieldTypeDescription
objectiverequired"optimal" | "fewer" | "fewest"
feasiblerequiredbooleanFalse when no plan meets the battery limits; see warning.
stopsrequiredChargingStop[]Charging stops, in order.
waypointsrequiredobject[]Where the trip passes each address waypoint.
totalDriveTimeHoursrequirednumber
totalChargeTimeHoursrequirednumber
totalTripTimeHoursrequirednumber
finalArrivalSoCPercentrequirednumber
totalDwellTimeHoursnumber
speedAdjustmentobjectPresent when driving slower would make the trip possible.
warningobject
200 application/json
{
  "origin": {
    "lat": 34.05,
    "lon": -118.24,
    "displayName": "Los Angeles, Los Angeles County, California, United States"
  },
  "destination": {
    "lat": 36.17,
    "lon": -115.15,
    "displayName": "Las Vegas, Clark County, Nevada, United States"
  },
  "waypoints": [],
  "route": {
    "coordinates": [
      [
        -118.24,
        34.05
      ],
      [
        -115.15,
        36.17
      ]
    ],
    "edges": [
      {
        "distanceKm": 0.05,
        "durationHours": 0,
        "elevationGainM": 0.75,
        "elevationLossM": 0,
        "cumulativeDistanceKm": 0.05
      }
    ],
    "totalDistanceKm": 434.89,
    "totalDurationHours": 4.48,
    "elevationAvailable": true,
    "usingFallbackRouting": false,
    "elevations": [
      100.75,
      101.5
    ]
  },
  "chargers": [
    {
      "id": "ocm-97637",
      "name": "Baker, Ca Supercharger",
      "lat": 35.26,
      "lon": -116.08,
      "distanceAlongRouteKm": 283.45,
      "maxPowerKw": 250,
      "networkName": "Tesla (Tesla-only charging)",
      "stallCount": 40,
      "connections": [
        {
          "plugType": "NACS",
          "powerKw": 150
        },
        {
          "plugType": "NACS",
          "powerKw": 250
        }
      ],
      "source": "openchargemap"
    }
  ],
  "plan": {
    "optimal": {
      "objective": "optimal",
      "feasible": true,
      "stops": [
        {
          "chargerId": "ocm-97637",
          "chargerName": "Baker, Ca Supercharger",
          "plugType": "NACS",
          "distanceAlongRouteKm": 283.45,
          "arrivalSoCPercent": 20.57,
          "departureSoCPercent": 50,
          "chargeDurationMinutes": 13.87,
          "arrivalTripTimeHours": 2.92
        }
      ],
      "waypoints": [],
      "totalDriveTimeHours": 4.48,
      "totalChargeTimeHours": 0.23,
      "totalTripTimeHours": 4.71,
      "finalArrivalSoCPercent": 11.22
    },
    "fewer": {
      "objective": "fewer",
      "feasible": true,
      "stops": [
        {
          "chargerId": "ocm-97637",
          "chargerName": "Baker, Ca Supercharger",
          "plugType": "NACS",
          "distanceAlongRouteKm": 283.45,
          "arrivalSoCPercent": 20.57,
          "departureSoCPercent": 50,
          "chargeDurationMinutes": 13.87,
          "arrivalTripTimeHours": 2.92
        }
      ],
      "waypoints": [],
      "totalDriveTimeHours": 4.48,
      "totalChargeTimeHours": 0.23,
      "totalTripTimeHours": 4.71,
      "finalArrivalSoCPercent": 11.22
    },
    "fewest": {
      "objective": "fewest",
      "feasible": true,
      "stops": [
        {
          "chargerId": "ocm-97637",
          "chargerName": "Baker, Ca Supercharger",
          "plugType": "NACS",
          "distanceAlongRouteKm": 283.45,
          "arrivalSoCPercent": 20.57,
          "departureSoCPercent": 50,
          "chargeDurationMinutes": 13.87,
          "arrivalTripTimeHours": 2.92
        }
      ],
      "waypoints": [],
      "totalDriveTimeHours": 4.48,
      "totalChargeTimeHours": 0.23,
      "totalTripTimeHours": 4.71,
      "finalArrivalSoCPercent": 11.22
    }
  },
  "batteryProfiles": {
    "optimal": [
      {
        "cumulativeDistanceKm": 0,
        "socPercent": 90
      },
      {
        "cumulativeDistanceKm": 434.89,
        "socPercent": 11.22
      }
    ],
    "fewer": [
      {
        "cumulativeDistanceKm": 0,
        "socPercent": 90
      },
      {
        "cumulativeDistanceKm": 434.89,
        "socPercent": 11.22
      }
    ],
    "fewest": [
      {
        "cumulativeDistanceKm": 0,
        "socPercent": 90
      },
      {
        "cumulativeDistanceKm": 434.89,
        "socPercent": 11.22
      }
    ]
  },
  "steepGradientSegment": null,
  "legElevationEffects": {
    "optimal": [
      {
        "fromKm": 0,
        "toKm": 283.45,
        "elevationGainM": 2111.42,
        "elevationLossM": 1929.5,
        "extraConsumptionPercent": 12.64
      },
      {
        "fromKm": 283.45,
        "toKm": 434.89,
        "elevationGainM": 1497.83,
        "elevationLossM": 1160.5,
        "extraConsumptionPercent": 17.76
      }
    ],
    "fewer": [
      {
        "fromKm": 0,
        "toKm": 283.45,
        "elevationGainM": 2111.42,
        "elevationLossM": 1929.5,
        "extraConsumptionPercent": 12.64
      },
      {
        "fromKm": 283.45,
        "toKm": 434.89,
        "elevationGainM": 1497.83,
        "elevationLossM": 1160.5,
        "extraConsumptionPercent": 17.76
      }
    ],
    "fewest": [
      {
        "fromKm": 0,
        "toKm": 283.45,
        "elevationGainM": 2111.42,
        "elevationLossM": 1929.5,
        "extraConsumptionPercent": 12.64
      },
      {
        "fromKm": 283.45,
        "toKm": 434.89,
        "elevationGainM": 1497.83,
        "elevationLossM": 1160.5,
        "extraConsumptionPercent": 17.76
      }
    ]
  },
  "weatherNote": null,
  "planningOutsideTempC": 20
}

Errors

Plan a trip error responses
StatusWhenExample body
400The request is malformed: a required field is missing, the vehicle id is unknown, there are more than 5 waypoints, an address could not be found, or the combined route is too long.{ "error": "Could not find a location for \"Atlantis\"." }
422There is no driving route between these places (for example, to Hawaii). Retrying gives the same answer.{ "error": "No driving route between Los Angeles, CA and Honolulu, HI." }
429Either this caller's rate limit, or a routing/charger provider's free daily quota, has been reached.{ "error": "Too many requests. Try again in a few minutes." }
500An unexpected error in this app. Details are in the server log, never in the response.{ "error": "Something went wrong planning this trip. Please try again." }
503A routing, charger or geocoding provider is down or timed out. Try again in a few minutes.{ "error": "The trip-planning service is temporarily unavailable upstream. Please try again in a few minutes." }

Chargers in a map area

get/api/chargers

Every charger inside a bounding box, for a map layer. Below zoom 6 it returns an empty list with zoomTooLow: true and calls nothing upstream. Results are capped at 500; cappedByResultLimit says when the cap was hit, so zooming in shows the rest.

Rate limit
Charged per map tile the area covers that is not already cached on the server: 120 tiles per minute and 80 tiles per day per IP. Areas that are fully cached are free. A shared daily Open Charge Map budget also applies; when it runs out the response is a 429.
Cross-origin
Same origin only.

Parameters

Chargers in a map area parameters
FieldTypeDescription
minLonrequirednumberWest edge. (-180 to 180)
minLatrequirednumberSouth edge. (-90 to 90)
maxLonrequirednumberEast edge. Must be greater than minLon. (-180 to 180)
maxLatrequirednumberNorth edge. Must be greater than minLat. (-90 to 90)
zoomrequirednumberThe map's current zoom level.

Example request

curl
curl '//api/chargers?minLon=-116.2&minLat=35.2&maxLon=-116&maxLat=35.3&zoom=12'

Response 200

Chargers in the area.

Chargers in a map area 200 response
FieldTypeDescription
chargersrequiredAreaCharger[]
cappedByResultLimitrequiredboolean
zoomTooLowrequiredboolean

AreaCharger

AreaCharger
FieldTypeDescription
idrequiredstring
namerequiredstring
latrequirednumber(-90 to 90)
lonrequirednumber(-180 to 180)
maxPowerKwrequirednumber
networkNamestring
stallCountinteger | null
plugTypesrequiredPlugType[]
addressstring
costTextstring
sourcerequired"openchargemap"
200 application/json
{
  "chargers": [
    {
      "id": "ocm-97637",
      "name": "Baker, Ca Supercharger",
      "lat": 35.26,
      "lon": -116.08,
      "maxPowerKw": 250,
      "networkName": "Tesla (Tesla-only charging)",
      "stallCount": 40,
      "plugTypes": [
        "NACS"
      ],
      "address": "71808 Baker BLVD, Baker, CA",
      "costText": "$0.26/kWh; other tariffs for older cars",
      "source": "openchargemap"
    }
  ],
  "cappedByResultLimit": false,
  "zoomTooLow": false
}

Errors

Chargers in a map area error responses
StatusWhenExample body
400A parameter is missing, not a number, or the box is inverted.{ "error": "minLon, minLat, maxLon, maxLat and zoom are required." }
429This caller's tile limit, or the shared daily Open Charge Map budget, has been reached.{ "error": "Too many requests. Try again shortly." }
502Open Charge Map failed or timed out.{ "error": "Could not load chargers for this area." }

Nearby station amenities

get/api/chargers/amenities

Amenities within 200 metres of a station from OpenRouteService POIs with one OpenStreetMap Overpass fallback, looked up after planning. An unknown status means neither source confirmed a result; an empty known list means no matching amenities were listed.

Rate limit
12 per minute per IP, plus a shared 1,000-per-day amenities budget.
Cross-origin
Yes, callable from a page on any origin (CORS).

Parameters

Nearby station amenities parameters
FieldTypeDescription
latrequirednumberStation latitude in degrees. (-90 to 90)
lonrequirednumberStation longitude in degrees. (-180 to 180)

Example request

curl
curl '//api/chargers/amenities?lat=undefined&lon=undefined'

Response 200

Nearby amenity categories or an explicit unknown status.

Nearby station amenities 200 response
FieldTypeDescription
amenitiesrequiredobject

Errors

Nearby station amenities error responses
StatusWhenExample body
400Coordinates are missing or outside valid ranges.{ "error": "Invalid coordinates." }
429The caller's minute budget was reached.{ "error": "Too many requests. Try again shortly." }

One charger's details

get/api/chargers/{id}

The full record for one charger: address, network, pricing text, connectors, status, photos and user comments. Use the id from a plan or area response. Known details are retained in the shared server cache and dated if old; browser caching depends on amenity confidence.

Rate limit
30 per minute and 150 per day per IP, counted only for an upstream Open Charge Map call. A shared 600-per-day budget also applies; cached results cost neither budget.
Cross-origin
Yes, callable from a page on any origin (CORS).

Parameters

One charger's details parameters
FieldTypeDescription
{id}requiredstringA charger id as returned by the other endpoints, ocm- followed by digits.

Example request

curl
curl '//api/chargers/ocm-97637'

Response 200

The charger.

One charger's details 200 response
FieldTypeDescription
chargerrequiredChargerDetail

ChargerDetail

ChargerDetail
FieldTypeDescription
idrequiredstring
namerequiredstring
latrequirednumber(-90 to 90)
lonrequirednumber(-180 to 180)
networkNamestring
networkUrlstring
addressstring
phonestring
usageTypestring
usageCoststring
accessCommentsstringFree text; where Open Charge Map records opening hours.
generalCommentsstring
statusTitlestring
isOperationalboolean
dateLastVerifiedstring
detailFetchedAtstringWhen this full Open Charge Map record was last fetched.
dateLastStatusUpdatestring
stallCountinteger
connectionsrequiredobject[]
photosrequiredobject[]
commentsrequiredobject[]
sourceUrlrequiredstringThe charger's page on openchargemap.org.
amenitiesobjectNearby amenities from OpenRouteService POIs, OpenStreetMap (Overpass), or explicit Open Charge Map notes. status is "unknown" when the lookup wasn't attempted or failed - never treat that as "none nearby".
200 application/json
{
  "charger": {
    "id": "ocm-97637",
    "name": "Baker, Ca Supercharger",
    "lat": 35.262655,
    "lon": -116.08074,
    "networkName": "Tesla (Tesla-only charging)",
    "address": "71808 Baker BLVD, Baker, CA, 92309-0000",
    "usageType": "Public",
    "usageCost": "$0.26/kWh; other tariffs for older cars",
    "statusTitle": "Operational",
    "isOperational": true,
    "dateLastVerified": "2024-06-06T12:05:00Z",
    "detailFetchedAt": "2026-11-30T12:00:00Z",
    "stallCount": 40,
    "connections": [
      {
        "title": "NACS / Tesla Supercharger",
        "plugType": "NACS",
        "powerKw": 250,
        "quantity": 24,
        "currentType": "DC",
        "status": "Operational"
      }
    ],
    "photos": [],
    "comments": [],
    "sourceUrl": "https://openchargemap.org/site/poi/details/97637"
  }
}

Response 202

Full details did not arrive within five seconds; the lookup continues in the background.

One charger's details 202 response
FieldTypeDescription
errorrequiredstringWhat went wrong, safe to show to a person.
202 application/json
{
  "error": "Full charger details are still loading. Try again shortly."
}

Errors

One charger's details error responses
StatusWhenExample body
400The id is not an ocm-<digits> id.{ "error": "Unknown charger id." }
404Open Charge Map has no charger with this id.{ "error": "Charger not found." }
429This caller's limit, or the shared daily Open Charge Map budget, has been reached.{ "error": "Too many requests. Try again shortly." }
503Open Charge Map is temporarily unavailable and no known detail was cached.{ "error": "Full charger details are temporarily unavailable." }

Health check

get/api/health

Confirms the app is up and its database answers. Calls no outside provider, so it is cheap enough to poll; the scheduled uptime check uses it every 15 minutes.

Rate limit
None.
Cross-origin
Same origin only.

Example request

curl
curl '//api/health'

Response 200

The app and its database are up.

Health check 200 response
FieldTypeDescription
okrequiredboolean
200 application/json
{
  "ok": true
}

Errors

Health check error responses
StatusWhenExample body
503The database did not answer.{ "ok": false }
EV Route Planner · Routing by OpenRouteService · Charger data from Open Charge Map