Want to learn more about Chargetrip's GraphQL API? Our team of developers has created a few examples to help you get started. This article focuses on the car example that shows you how to query car data from our database.
Planning a route with an internal combustion engine (ICE) vehicle is different from an electric vehicle (EV). EV drivers must remember that their car battery is impacted by factors like weather, elevation, road conditions, and more.
But developers using our API don’t need to know this. Chargetrip’s extensive database contains 272 EV models, each with its own consumption model and all the information needed to plan a journey. This database is constantly updated with new vehicles and consumption models, and car details are continuously improved.
Fetch data from our API
The Playground contains 12 test car models to try out our API. You can also get your own
x-client-id with access to the entire EV database + 1000 free calls per month. Sign up to our free tier here, and get started straight away.
carList query to query a list of cars. Consider using pagination for fast and responsive data fetching. You can use the
search parameter to query a specific
In the example below, we have requested only a few of the possible fields.
The response to the
carList query will produce a list of cars, with some basic details and images to display on the front end. This way, end-users can select what car to plan routes with, and understand what their car is capable of.
carList query, you find what we consider real-world range under the property
chargetrip_range. This gives an indication of the range for
worst case scenarios. Worst conditions are based on -10°C, and use of heating and best conditions are based on 23°C and no A/C.
Next to that, the
carList query returns a unique car
id for every car. This id can be used in other parts of our API; like getting more car details via the
A car id is necessary when creating a new route with the
newRoute mutation. Then the Chargetrip’s algorithm will ensure you receive the optimal route for that EV!
Full information about car queries is found in our API documentation. Want to know what else our API does? Check out the other examples. If you have any questions or suggestions, contact us via the live chat on our website. Your feedback is super useful to us!