Skip to main content
Guide

Amenity stops along the route

EV drivers frequently like to hand pick charging locations based on specific nearby amenities.

The getRouteStationsWithAmenities query returns charging stations along an existing route that are within walking distance of specific amenity categories, while also listing for each station the nearby amenities by name. This lets drivers plan their charging stop around a specific amenity, like their favorite restaurant chain or a coffee place with outdoor area.

How it works

Adding an amenity stop to a route takes four steps:

  1. Create a route.Request a route with createRoute.
  2. Select a route option.Select one of the route options returned by the route subscription or getRoute query.
  3. Search for stations with amenities.Pass the choosen route option as route_id and the route request id returned by createRoute as route_request_id to getRouteStationsWithAmenities, . You’ll get a list of compatible stations along the route, each with the specific amenity places nearby .
  4. Recalculate the route with the selected station.Once the driver picks the station, call createRoute again and add the station to the via input as a charging stop using via.properties.station.station_id. See Route with stops for details on how this works.

How stations are selected

A station is included in the results only if it meets all of the following criteria:

CriterionDescription
Travel windowThe station is reached within the requested time window (center ± margin), measured in seconds of travel time from the start of the route.
Vehicle compatibilityThe station has at least one connector compatible with the vehicle used in the original route.
Distance from routeThe station is within the maximum allowed distance from the route path.
Amenity matchAt least one amenity of the requested type is within the allowed walking distance of the station.

If no stations meet all criteria, try widening your time window margin or relaxing your filters.

Examples

Search for stations with a coffee shop around 1 hour into the trip Search for compatible stations with a coffee shop within walking distance, reached between 45 and 75 minutes into the trip (center: 3600, margin: 900).

Example request
graphql
getRouteStationsWithAmenities(  input: {    route_id: "6527e1f1a8b4c2d3e4f5a6b7"    route_request_id: "6527e1f1a8b4c2d3e4f5a6b8"    amenity_type: coffee    time_window: { center: 3600, margin: 900 }  }) {  id  name  amenities {    type    name    distance  }}
Example response
json
{  "data": {    "getRouteStationsWithAmenities": [      {        "id": "5e5f3e8f8e0c1a0012345678",        "name": "Highway Charging Hub",        "amenities": [          {            "type": "coffee",            "name": "Roadside Coffee Bar",            "distance": 120          },           {            "type": "coffee",            "name": "Starbucks",            "distance": 500          }        ]      }    ]  }}

Recalculate a route with the selected amenity station and a 45-minute stop After the driver selects a station, create a new route that includes it as a charging stop. Setting stop_duration to 2700 tells the route planner the driver will stay at least 45 minutes, so charging is optimized around the lunch break.

Example request
graphql
createRoute(  input: {    vehicle: { id: "607823b2c246f9001b97b1a2" }    origin: {      type: Feature      geometry: { type: Point, coordinates: [4.895168, 52.370216] }    }    destination: {      type: Feature      geometry: { type: Point, coordinates: [6.773456, 51.227741] }    }    via: [      {        type: Feature        properties: {          station: {            station_id: "5e5f3e8f8e0c1a0012345678"            stop_duration: 2700          }        }      }    ]  })

Was this content helpful?

Developers

Chargetrip ©

Status unknown

Manage cookies

Effective: 20th March, 2024 · Updated: 1 September, 2026

We use cookies to help improve your experience of developers.chargetrip.com. This cookie policy is part of the privacy policy, and covers the use of cookies between your device and our site. We also provide basic information on third-party services we may use, who may also use cookies as part of their service, though they are not covered by our policy.

If you don’t wish to accept any cookies from us, you should instruct your browser to refuse cookies from developers.chargetrip.com, with the understanding that we may be unable to provide you with some of your desired content and services.

A cookie is a small piece of data that a website stores on your device when you visit, typically containing information about the website itself, a unique identifier that allows the site to recognize your web browser when you return, additional data that serves the purpose of the cookie itself, and the lifespan of the cookie itself.

Cookies are used to enable certain features (e.g. logging in), to track site usage (e.g. analytics), to store your user settings (e.g. timezone, notification preferences), and to personalize your content (e.g. advertising, language).

Cookies set by the website you are visiting are normally referred to as “first-party cookies,” and typically only track your activity on that particular site. Cookies set by other sites and companies (i.e. third parties) can be used to track you on other websites that use the same third-party service.

Essential cookies

Cookies set by the website you are visiting are normally referred to as “first-party cookies,” and typically only track your activity on that particular site. Cookies set by other sites and companies (i.e. third parties) can be used to track you on other websites that use the same third-party service.

Performance cookies

Targeting / advertising cookies are used in determining what promotional content is more relevant and appropriate to you and your interests. Websites may use them to deliver targeted advertising or to limit the number of times you see an advertisement. This helps companies improve the effectiveness of their campaigns and the quality of content presented to you. These cookies may be set by the website you’re visiting (first-party) or by third-party services. Targeting/advertising cookies set by third parties may be used to track you on other websites that use the same third-party service. We use targeting/advertising cookies on our site.

Marketing / advertising cookies

Targeting / advertising cookies are used in determining what promotional content is more relevant and appropriate to you and your interests. Websites may use them to deliver targeted advertising or to limit the number of times you see an advertisement. This helps companies improve the effectiveness of their campaigns and the quality of content presented to you. These cookies may be set by the website you’re visiting (first-party) or by third-party services. Targeting/advertising cookies set by third parties may be used to track you on other websites that use the same third-party service. We use targeting/advertising cookies on our site.

Third party promise

We review the privacy policies of all our third-party providers before enlisting their services to ensure their practices align with ours. We will never knowingly include third-party services that compromise or violate the privacy of our users.

Cookie
google-cookie-consent
Description
Stores your cookie preferences, meaning which categories you have accepted or declined, so we can respect your choice on every visit and only load the analytics or marketing tools you have allowed.
Lifetime
2 years

How you can control or opt out of cookies

If you do not wish to accept cookies from us, you can instruct your browser to refuse cookies from our website. Most browsers are configured to accept cookies by default, but you can update these settings to either refuse cookies altogether or to notify you when a website is trying to set a cookie.

If you browse websites from multiple devices, you may need to update your settings on each individual device.

Although some cookies can be blocked with little impact on the experience of a website, blocking all cookies may mean you are unable to access certain features and content across the sites you visit.

We may update this Cookie Policy from time to time in order to reflect, for example, changes to the cookies we use or for other operational, legal, or regulatory reasons. Please re-visit this Cookie Policy to stay informed about our use of cookies and related technologies. The date at the top of this Cookie Policy indicates when it was last updated.