Query vehicles

In order to see all vehicles in the vehicle database use the vehicleList query. See a live example of this query including all available output parameters here.

Query vehicle list

An example that renders a list of vehicles that can be searched and filtered.

Query vehicle list

Query

To query the vehicles in the database, call the vehicleList. Optionally configure the arguments to support filters, search, localization or pagination. The sections below describe each feature in more detail.

  • Filter
    • To filter the vehicle list use the filter argument. Filter on availability, drivetrain, connected vehicle provider, region, purpose and type. For example, use PHEV as a drivetrain filter to return all plug-in hybrids.

  • Search
    • To search in the vehicle list use the search argument to do a search over all naming fields. For example search on 'ID3' which will return all Volkswagen ID3 editions.

  • Localize
    • To apply localization to the vehicleList use the country argument. The naming, availability and specifications, if available to us, will be shown for the given country. As an example, for Portugal (PT) the naming of the Hyundai Kona would be Hyundai Kauai.

Arguments

filter VehicleListFilter

Filter vehicle result.

country CountryCodeAlpha2

ISO-3166 alpha-2 country code to apply localization on vehicle data if available.

Show CountryCodeAlpha2 enum values

size Int

Number of elements (count) to return.

Default • 10

page Int

Page number to return.

Default • 0

Frequently used fields

id ID

Vehicles unique ID.

naming VehicleListNaming

Naming of the vehicle.

connectors VehicleConnector

Connectors available for the vehicle.

availability VehicleListAvailability

Availability of the vehicle.

Other fields

drivetrain VehicleDrivetrain

Drivetrain of the vehicle.

adapters VehicleConnector

Adapters available for the vehicle.

battery VehicleListBattery

Battery of the vehicle.

body VehicleListBody

Body of the vehicle.

range VehicleListRange

Range of the vehicle.

media VehicleListMedia

Media of the vehicle.

routing VehicleListRouting

Routing of the vehicle.

connect Connect

Information about vehicle connectivity.

region VehicleRegion

Regions in which the vehicle is available. Based on the continent code (CC) standard.

Show VehicleRegion enum values

purpose VehiclePurpose

Vehicle intended use. Can be passenger, cargo, or utility.

Show VehiclePurpose enum values

type VehicleType

Type of vehicle.

Show VehicleType enum values

Response

A response can either contain a data or an errors object. The response header will always return 200 as a status code.

Data object

When successful, a data object will be returned with the requested fields. If there are no fields present the data object will return the operation name with the appropriate return type. If the operation was a query, this output will be an object of the schema’s query root type; if the operation was a mutation, this output will be an object of the schema’s mutation root type.

Error object

If unsuccessful, an errors object will be returned with more details in the extensions object. The error object can contain any of the following objects.

Error

ERROR_FORBIDDEN_MESSAGE

You are forbidden to execute this operation

Error

PAGINATION_INVALID_PAGE

Page must be an INT value higher than 0

Error

PAGINATION_INVALID_SIZE

Size must be an INT value between 1 and 1000