How to Find Nearby EV Charging Stations and Their Connector Types

API or service
Places API, Route Matrix API
Task
Location → nearest charging stations → operators, connector types, driving times
Examples
URLAI
Difficulty
Beginner
Time
10 min

You have a location, such as a map click, a driver's position, or a destination address, and need the nearest electric vehicle charging stations with their operators and connector types. The Geoapify Places API finds places of the service.vehicle.charging_station category, nearest first, and returns the connector types it has for each station in socket_options.

Send the charging-station category with a circle filter and a proximity bias, then read operator, network, and socket_options for each station. Optionally, add driving times from the Route Matrix API to show how long the drive to each station takes.

Task flow: location → Places API → nearest charging stations → operators and connector types → optional Route Matrix driving times.

Request the nearest charging stations

This request finds charging stations within 1,000 metres of a point in downtown Seattle, near Westlake Avenue and Lenora Street, nearest first:

https://api.geoapify.com/v2/places?categories=service.vehicle.charging_station&filter=circle:-122.336,47.6165,1000&bias=proximity:-122.336,47.6165&limit=10&apiKey=YOUR_API_KEY
Parameter Value Purpose
categories service.vehicle.charging_station Charging stations for electric vehicles.
filter circle:-122.336,47.6165,1000 Limits the search to 1,000 metres around the point.
bias proximity:-122.336,47.6165 Orders the stations by distance and adds properties.distance in metres.
limit 10 Returns at most 10 stations.

Coordinates in circle and proximity are ordered as longitude, latitude.

The request returned 5 stations. Shown as a list:

# Name Operator Connectors in socket_options Distance
1 Greenlots Shell Recharge Solutions chademo 219 m
2 Blink Blink type1 230 m
3 EVgo EVgo not listed 628 m
4 Tesla Supercharger Tesla nacs 811 m
5 ChargePoint ChargePoint not listed 976 m

Reduced response: The response below keeps two stations: one with a connector count, and one with a count, an output value, and a network.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Greenlots",
        "operator": "Shell Recharge Solutions",
        "housenumber": "900",
        "street": "Lenora Street",
        "city": "Seattle",
        "state": "Washington",
        "postcode": "98121",
        "categories": ["service", "service.vehicle", "service.vehicle.charging_station"],
        "opening_hours": "24/7",
        "socket_options": {
          "chademo": { "amount": 2 }
        },
        "distance": 219,
        "place_id": "5131e7be41a0955ec059cf4d9b711acf4740f00103f901e21ab1dd00000000920309477265656e6c6f7473"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-122.3379063, 47.6179945]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "name": "Tesla Supercharger",
        "operator": "Tesla",
        "network": "Supercharger",
        "brand": "Tesla Supercharger",
        "housenumber": "601",
        "street": "Union Street",
        "city": "Seattle",
        "state": "Washington",
        "postcode": "98101",
        "categories": ["access_limited", "access_limited.customers", "fee", "service", "service.vehicle", "service.vehicle.charging_station"],
        "opening_hours": "24/7",
        "socket_options": {
          "nacs": { "amount": 10, "output": 72 }
        },
        "distance": 811,
        "place_id": "5173d712f241955ec059605969520ace4740f00103f901981c9103030000009203125465736c6120537570657263686172676572"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-122.33215, 47.60969]
      }
    }
  ]
}

Only publicly accessible stations

The Tesla Supercharger has the access_limited.customers category: it is for customers only. To list only stations that are open to the public, add conditions=access:

https://api.geoapify.com/v2/places?categories=service.vehicle.charging_station&conditions=access&filter=circle:-122.336,47.6165,1000&bias=proximity:-122.336,47.6165&limit=10&apiKey=YOUR_API_KEY

This request returned the same stations without the Tesla Supercharger. The access condition includes places marked as public and places without access information, which the API treats as public. See the supported conditions, such as fee and no_fee, for other filters.

An empty features array means there are no charging stations in the circle. Offer a larger radius, or let the user move the search point.

Read operators and connector types

Each station is a GeoJSON feature. These properties describe it:

Property Type Content
name string Station name, often the operator or brand.
operator string The company that runs the station, for example Shell Recharge Solutions.
network string The charging network, when the data has one, for example Supercharger.
brand string The brand name, when the data has one.
opening_hours string Opening hours, for example 24/7.
socket_options object Connector types and their details. See below.
distance number Straight-line distance in metres from the proximity point.
place_id string Use it to request Place Details for one station.

Treat the descriptive properties as optional: a station has only the ones its data contains. In the example, only the Tesla Supercharger has a network, and EVgo and ChargePoint have no socket_options or opening_hours.

socket_options

socket_options is an object. Each key is a connector type, such as chademo, type1, or nacs, and its value is an object with details about that connector:

"socket_options": {
  "nacs": { "amount": 10, "output": 72 }
}
  • Connector type (the key): show it as the API returns it. The keys in the example are chademo (CHAdeMO), type1 (SAE J1772), and nacs (North American Charging Standard).
  • amount: the number of connectors of this type, for example 10. The Places API OpenAPI specification allows a detail value to be a string, a number, a boolean, or null, so check that amount is a number before you show it as a count or add counts together.
  • output: the charging output for this connector type, for example 72. Show it as the API returns it, without assuming a unit.

Handle a missing socket_options as "Connector types not listed", not as "no connectors". For live availability and pricing, point users to the operator's own app or website.

The Places API returns station data, not live status: it doesn't say whether a connector is free right now.

Add driving times with the Route Matrix API

properties.distance is a straight-line distance. A driver follows streets, turns, and one-way restrictions, so the drive is longer and can change which station is quickest to reach. The Route Matrix API calculates the driving time and road distance from the search point to every station in one request.

Send the search point as the only source and the stations as targets, in the same order as the list:

POST https://api.geoapify.com/v1/routematrix?apiKey=YOUR_API_KEY
Content-Type: application/json
{
  "mode": "drive",
  "sources": [
    { "location": [-122.336, 47.6165] }
  ],
  "targets": [
    { "location": [-122.3379063, 47.6179945] },
    { "location": [-122.338104, 47.617999] },
    { "location": [-122.3300941, 47.6205006] },
    { "location": [-122.33215, 47.60969] },
    { "location": [-122.3383581, 47.6078644] }
  ]
}

Matrix locations are [longitude, latitude], the same order as geometry.coordinates in the Places response.

Reduced response: With one source and five targets, sources_to_targets has one row with five cells. time is in seconds and distance in metres.

{
  "sources_to_targets": [
    [
      { "distance": 466, "time": 66, "source_index": 0, "target_index": 0 },
      { "distance": 466, "time": 66, "source_index": 0, "target_index": 1 },
      { "distance": 814, "time": 110, "source_index": 0, "target_index": 2 },
      { "distance": 1002, "time": 117, "source_index": 0, "target_index": 3 },
      { "distance": 1249, "time": 155, "source_index": 0, "target_index": 4 }
    ]
  ],
  "units": "metric",
  "distance_units": "meters",
  "mode": "drive"
}

Match each cell to its station with target_index and show the driving time and road distance in place of the straight-line distance. Minutes are time / 60, rounded, with at least 1 minute:

# Name Straight line (Places API) By car (Route Matrix API)
1 Greenlots 219 m 1 min · 466 m
2 Blink 230 m 1 min · 466 m
3 EVgo 628 m 2 min · 814 m
4 Tesla Supercharger 811 m 2 min · 1,002 m
5 ChargePoint 976 m 3 min · 1,249 m

Greenlots is 219 metres away in a straight line, but the drive is 466 metres. Treat a cell without a finite time as unreachable and keep the straight-line distance for that station.

Traffic. The default traffic model is free_flow: the route is calculated without traffic influence, so city driving times are optimistic. Add "traffic": "approximated" to the request body to slow down potentially busy roads. See the Route Matrix API parameters.

Cost. Route Matrix credits are max(sources, targets) × min(sources, targets, 10). With one source, that is one credit per station: this request with 5 stations costs 5 credits. The station list already works without it, so make driving times optional, for example a "Show driving time" checkbox that is off by default. See Route Matrix pricing.

To pick the single quickest station by travel time, see How to Find the Nearest Driver, Store, or Facility by Travel Time.

EV charging station finder with an AI coding agent

Copy this prompt into Codex, Claude Code, Cursor, or another coding agent to add a "nearest charging stations" finder to your project.

Add a "nearest EV charging stations" finder to my project with the Geoapify Places API: a numbered list of stations with operators and connector types, nearest first, with matching markers on a map.

Before you start
- Inspect the existing project first. Reuse its current framework, components, styling, HTTP client, map library, and conventions. Make the smallest necessary changes.
- Ask only what the project doesn't answer: where the search point comes from (map click, the driver's position, or a destination address), the radius, the number of stations, whether to list only publicly accessible stations, and whether to add optional driving times.
- Ask me to configure a Geoapify API key before live requests. On a backend, read it from GEOAPIFY_API_KEY. In a browser, ask whether to use a restricted key or a backend proxy. Never hardcode, print, or log the key.

API flow
1. Send GET https://api.geoapify.com/v2/places with categories=service.vehicle.charging_station, filter=circle:lon,lat,radiusMeters, bias=proximity:lon,lat (same point), and limit. Add conditions=access to list only publicly accessible stations.
2. Show the features in the returned order: properties.name, properties.operator, properties.network when present, properties.distance in metres, and a numbered marker at geometry.coordinates ([longitude, latitude]).
3. Read properties.socket_options: each key is a connector type (show it as returned), each value an object with details such as amount and output. Show amount as a count only when it is a number; show output as returned without assuming a unit. A missing socket_options means "Connector types not listed".
4. Optional driving times: when the user turns them on, POST https://api.geoapify.com/v1/routematrix with mode drive, the search point as the only source, and the stations as targets in list order. Match sources_to_targets[0] cells by target_index and show time (seconds, as minutes) and road distance instead of the straight-line distance. Keep the straight-line distance when a cell has no finite time. With one source, the request costs one credit per station, so keep it off by default.

Requirements
- Keep longitude before latitude in circle, proximity, and matrix locations.
- Treat every station property except geometry as optional.
- The data has no live availability: don't show connectors as free or busy.
- Treat an empty features array as "no stations in this area" and suggest a larger radius.
- Ignore responses from older requests when the user moves the point quickly. Handle HTTP 400 messages, 401, timeouts, and limited 429 retries with backoff. Show loading states.
- Keep the map attribution, including "Powered by Geoapify", visible.

Review the generated code against the requests in this guide. Check that socket_options values are type-checked, missing connector data is shown as "not listed", driving times are optional and mapped by target_index, and the API key isn't exposed.