EV Search
Electric Vehicle (EV) Search is a specialized search service designed for EV charging stations. It allows you to find EV charging stations (also known as charging parks) based on various criteria such as location, power output, connector types, and availability status.
EV Search requests are built using the EvSearchOptions class.
EV Search Options
The EvSearchOptions class provides comprehensive control over your evSearch queries. It supports various filtering and ranking parameters to help you find the most suitable charging stations.
Nearby EV Search
Nearby EV search allows you to find charging stations around a specific location within a given radius. This is the most common search mode for finding charging stations near the user’s current position or a selected destination.
1val options =2 buildEvSearchOptionsForNearbySearch(3 geoBias = GeoPoint(latitude = 52.377271, longitude = 4.909466),4 ) {5 radius = Distance.kilometers(1)6 }78search.evSearch(9 options,10 object : EvSearchCallback {11 override fun onSuccess(result: EvSearchResponse) {12 /*13 Your code goes here14 */15 }1617 override fun onFailure(failure: SearchFailure) {18 /*19 Your code goes here20 */21 }22 },23)
For more advanced filtering, you can specify additional parameters:
1val options =2 buildEvSearchOptionsForNearbySearch(3 // user-defined location where the EV results will be biased towards4 geoBias = GeoPoint(latitude = 52.377956, longitude = 4.897070),5 ) {6 radius = Distance.kilometers(1)7 limit = 589 // filter out EV stations with less than 100 kW10 minPower = Power.kilowatts(100)1112 // filter out EV stations with more than 900 kW13 maxPower = Power.kilowatts(900)1415 // filter out EV stations which do not have Tesla connectors16 connectors = listOf(ConnectorType.Tesla)1718 // filter out EV stations which are not in-use or unavailable19 status = Status.Available2021 // filter out EV stations which are not public22 accessTypes = listOf(AccessType.Public)23 }2425search.evSearch(26 options,27 object : EvSearchCallback {28 override fun onSuccess(result: EvSearchResponse) {29 /*30 Your code goes here31 */32 }3334 override fun onFailure(failure: SearchFailure) {35 /*36 Your code goes here37 */38 }39 },40)
For the best experience, consider:
- Using
geoBiasto specify the location around which to search for charging stations. - Using
radiusto control the search area size based on your requirements. - Using
minPowerandmaxPowerto filter stations based on charging capability. - Using
connectorsto find stations compatible with your vehicle’s charging port. - Using
statusto filter out unavailable or occupied charging points.
EV Search Response
Once you have an EvSearchOptions object, provide it to the EV search request. You can achieve this asynchronously by using an instance of EvSearchCallback, or synchronously by obtaining an EvSearchResponse following the instructions outlined in the section called Making search API calls.
If the call succeeds, the returned result is in the EvSearchResponse. If an error occurred, it is in the SearchFailure.
The EvSearchResponse contains a list of EvSearchResult objects.
EV Search Result
Each EvSearchResult contains comprehensive information about a charging station:
place- The location data of the EV charging station, including:- Coordinates
- Address
- Country information
- Names
- Phone numbers
- Emails
ChargingStationdetails (charging points, connectors, power output)- Opening hours
- Time zone
accessType- The access type of the charging station (e.g.,Public,Restricted,Private)detour- Detour information when searching along a route (includes detour duration and distance)nearbyPoiCategories- A set of POI categories available within walking distance of the charging station
Nearby POI Categories
EV Search supports filtering and identifying nearby Points of Interest (POIs) within walking distance of charging stations. This feature helps users find amenities they might need while their vehicle is charging.
Supported Nearby POI Categories
The following StandardCategoryId values are supported for nearby POI filtering:
StandardCategoryId.Restaurant- Restaurants near the charging stationStandardCategoryId.HotelMotel- Hotels and motels for overnight chargingStandardCategoryId.CafePub- Cafés and pubs for refreshmentsStandardCategoryId.PublicAmenity- Public amenities like restroomsStandardCategoryId.Shop- Shops and retail storesStandardCategoryId.ParkRecreationArea- Parks and recreation areas
Using Nearby POI Categories
You can specify nearby POI categories in your search options to filter charging stations that have specific amenities nearby:
1val options =2 buildEvSearchOptionsForNearbySearch(3 geoBias = GeoPoint(latitude = 52.377271, longitude = 4.909466),4 ) {5 radius = Distance.kilometers(5)6 nearbyPoiCategories = setOf(7 StandardCategoryId.Restaurant,8 StandardCategoryId.CafePub,9 StandardCategoryId.Shop,10 )11 }
The results will include charging stations that have at least one of the specified POI categories within walking distance. Each EvSearchResult will also indicate which nearby POI categories are available at that location through the nearbyPoiCategories property.
Next steps
Since you have learned how to work with EV Search, here are recommendations for the next steps:
- EV POI details - Get detailed information about EV charging stations
- General Search - Learn about other search capabilities
- Reverse geocoding - Convert coordinates to addresses