queryType: getFuelEconomy*
The getFuelEconomy queryType is passed to the API to get the observed fuel economy for different vehicle classes by geography.
See Special Case APIs for more information.
Parameters
| Parameter | Description | Type | Defined Value Set | Value Req'd |
|---|---|---|---|---|
| queryType | Must equal getFuelEconomy. | STRING | getFuelEconomy | Y |
| aggregateAllZones | Whether to aggregate the results over all zones (true) or report the results for each zone provided (false). The default is false. | BOOL | true or false | N |
| dateRange |
An object defining the analysis date range. Each object contains:
Note:
A minimum date range of 1 month is required. | OBJECT | - | Y |
| isMetric | True for data to be returned in metric units, false for imperial. | BOOLEAN | true or false | Y |
| vehicleClassSchemeId | Determines which vehicle classification scheme you will receive data for. See the Vehicle class schemas for a list of options. The default value is 2. | INTEGER | [1,4] | N |
| vehicleClasses |
An array of vehicle class objects where each object contains | ARRAY |
See the Vehicle types and Weight class tables. For Vehicle Type: "Truck", "Passenger", "MPV", "Bus", "Other". More information at AFDC Vehicle Categories. To get all vehicle types, pass an empty array. | N |
| vehicleYears |
Array of objects representing bin definitions for histogram of vehicle years of the vehicle classes selected. There should be an object for each desired bin for the
Note:
A null in For example: [{"LowerBound": 2017, "UpperBound": 2020}, {"LowerBound":2021, "UpperBound": 2022}] will produce 3 objects in the | ARRAY | - | N |
| zones |
An array of objects representing the zones for which you want information. Each object contains
| ARRAY |
| Y |
Responses
| Code | Type | Description |
|---|---|---|
| 200 | JSON | The requested data. |
| 401 | JSON | Occurs for various unauthorized tasks, such as not providing credentials in your parameters. |
| 500 | JSON | Occurs if an internal server error occurs. Contact altitudesupport@geotab.com if this occurs. |
Response Schema
| Attribute | Description | Data Type | Defined Value Set |
|---|---|---|---|
| CategoryIndex | Identifier for the vehicle class category. | INTEGER | - |
| ISO_3166_2 | The state ISO code of the returned zone. | STRING | - |
| FuelEconomy | Calculated fuel economy (mph or l/100km). | FLOAT | - |
| FuelEconomyByFuelType |
Array objects representing the fuel economy for each fuel type. Each object contains:
| ARRAY | - |
| FuelEconomyByVehicleYear |
Array objects representing the fuel economy for a vehicle year bucket. Each object contains:
| ARRAY | - |
| SchemeId | Unique identifier for the vehicle class scheme. See Vehicle class schemas for more detailed information. | INTEGER | [1,4] |
| VehicleClass | The vehicle class for which the data is returned. | STRING | - |
| VehicleClassIndex | Unique identifier for the vehicle class. | INTEGER | - |
| ZoneDescription |
Description of the zone when available. The value is based on the type of zone:
| STRING | - |
| ZoneId | The zoneId for the zone result represented in the current row. | STRING | - |
| ZoneType | The zone type of the zone. | STRING | “State”, ”County” or ”City” |
Sample parameters
{
"dateRange":{"DateFrom":"2023-10-01", "DateTo":"2023-10-31"},
"isMetric":false,
"queryType":"getFuelEconomy",
"vehicleClassSchemeId":2,
"vehicleClasses": [],
"zones":[{
"ZoneId":"32003",
"ISO_3166_2":"US-NV",
"ZoneType":"County"
}]
}