THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

EV Charging Stations Availability

You can use any of the POI searches including Fuzzy Search, Geometry Search, or Along Route Search ( see Search API reference) to find a charging point for your electric car.

The EV charging stations IDs are returned from a search query. You can use this ID to check the real-time availability of EV connector types at the charging station using the Extended Search API – EV Charging Stations Availability endpoint. You can view charging station availability when you want to stop during the drive, or due to an event like the low level of your battery. The EV Charging Stations Availability endpoint provides information about the real-time availability of charging points based on criteria such as charging power, probability of being available, etc.

The Response of an EV Charging Stations Availability Request is grouped by the connector type. You can also specify the connector type in your POI searches including Fuzzy Search, Geometry Search, or Along Route Search by defining [connectorSet] to narrow the results. By doing so, the Response will only return the EV charging stations for the specified connector type. Have a look at the detailed documentation about EV Charging Stations Availability.

Important: The method for an EV Charging Stations Availability query uses more than one API service to only accept and return one Request at a time. First, the method makes an API call to a Search endpoint to retrieve the IDs of n charging stations, and then it makes a call to the Extended Search endpoint to retrieve the availability of these n charging stations. In this case, the method uses multiple API calls. If you make a Request to retrieve n charging station details, separate n Requests will be made.

Sample use case: As an EV driver you want to see the EV POIs around a certain location (e.g., when approaching a destination), so you know what charging stations are available around this place.

Sample use case: You want to see upcoming EV POIs along planned route, such that you always have a quick preview of charging possibilities that are in range, matching your vehicle and preferred energy vendor.

Sample use case: You want to know if an EV POI included in the route doesn’t have any available charging spots (e.g., they are all occupied or otherwise unavailable), and you would like to find an alternative EV POI.

Sample use case: : You are planning to visit the area of Amsterdam. You need to find EV charging stations in the city center in Amsterdam.

Use the following code snippets to try this in your app:

First, create a service:

let service = EVChargingStationService(apiKey: Key.Search)
self.service = [[EVChargingStationService alloc] initWithApiKey:Key.Search]

If you want to use Fuzzy Search based on the top-left and bottom-right bounding box locations:

1service.search(topLeft: TTCoordinate.AMSTERDAM_TOP_LEFT(), bottomRight: TTCoordinate.AMSTERDAM_BOTTOM_RIGHT()) { result, _ in
2 guard let result = result else {
3 return
4 }
5 self.search(completedWith: result)
6}
1__weak SearchChargingStationsViewController *weakSelf = self;
2[self.service searchWithTopLeft:[TTCoordinate AMSTERDAM_TOP_LEFT]
3 bottomRight:[TTCoordinate AMSTERDAM_BOTTOM_RIGHT]
4 completion:^(NSArray<ChargingStationDetails *> *_Nullable result, NSError *_Nullable error) {
5 SearchChargingStationsViewController *strongSelf = weakSelf;
6 if (result != NULL && strongSelf != NULL) {
7 [strongSelf searchCompletedWithResult:result];
8 }
9 }];

If you want to use Geometry Search based on a given shape like PolygonShape:

1let locations = coordinates.map { CLLocation(latitude: sh.latitude, longitude: sh.longitude) }
2let polygonShape = PolygonShape(locations: locations)
3service.search(shape: [polygonShape]) { result, _ in
4 guard let result = result else {
5 return
6 }
7 self.search(completedWith: result)
8}
1PolygonShape *shape = [[PolygonShape alloc] initWithLocations:locations];
2[self.service searchWithShape:@[ shape ]
3 completion:^(NSArray<ChargingStationDetails *> *_Nullable result, NSError *_Nullable error) {
4 SearchChargingStationsViewController *strongSelf = weakSelf;
5 if (result != NULL && strongSelf != NULL) {
6 [strongSelf searchCompletedWithResult:result];
7 }
8 }];

If you want to use Along Route Search you first need to use the TTRoute service. Then, based on the TTFullRoute object, get route location points.

1let routeLocations = route.coordinatesData().map { CLLocation(sh.mkCoordinateValue) }
2self?.service.search(route: routeLocations, completion: { chargingStationResult, _ in
3 guard let chargingStationResult = chargingStationResult else {
4 return
5 }
6 self?.search(completedWith: chargingStationResult)
7})
1NSMutableArray<CLLocation *> *routeLocations = [@[] mutableCopy];
2for (NSValue *value in route.coordinatesData) {
3 CLLocation *location = [[CLLocation alloc] init:[value MKCoordinateValue]];
4 [routeLocations addObject:location];
5}
6__weak SearchChargingStationsViewController *weakSelf = self;
7[self.service searchWithRoute:routeLocations
8 completion:^(NSArray<ChargingStationDetails *> *_Nullable result, NSError *_Nullable error) {
9 SearchChargingStationsViewController *strongSelf = weakSelf;
10 if (result != NULL && strongSelf != NULL) {
11 [strongSelf searchCompletedWithResult:result];
12 }
13 }];

Screen shots presenting how the EV Charging Stations Availability endpoint functions:

image

Fuzzy search

image

Geometry search

image

Along the route search