## Emissions from Vehicles (by Type)

Returns estimated greenhouse gas emissions (CO2e) in multiple units (grams, kilograms, metric tons, pounds) for travel in vehicles based on its type.

operationId: calculate_emissions_from_vehicle_usage_based_on_type

## Payload Specification

| Field          | Type   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Example                     |
| -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
| vehicle_type   | String | Yes      | Type of vehicle. Acceptable values are: \[Car-Type-Mini, Car-Type-Supermini, Car-Type-LowerMedium, Car-Type-UpperMedium, Car-Type-Executive, Car-Type-Luxury, Car-Type-Sports, Car-Type-4x4, Car-Type-MPV, Car-Size-Small, Car-Size-Medium, Car-Size-Large, Car-Size-Average, Motorbike-Size-Small, Motorbike-Size-Medium, Motorbike-Size-Large, Motorbike-Size-Average, Bus-LocalAverage, Bus-Coach, Taxi-Local, Train-National, Train-Local, Ferry-FootPassenger, Ferry-CarPassenger, Ferry-AllPassenger\] | Car-Size-Large              |
| fuel_type      | String | No       | Applicable for cars, these 5 values are allowed: \["Diesel", "Petrol", "PHEV", "BEV", "Unknown"\]. If in doubt then use "Unknown", which is the default value.                                                                                                                                                                                                                                                                                                                                               | Petrol                      |
| distance_unit  | String | Yes      | Enter "km" for kilometers and "mi" for miles. Default is "km". Allowed values: \["km", "mi"\]                                                                                                                                                                                                                                                                                                                                                                                                                | km                          |
| distance_value | Number | Yes      | Distance travelled. If an undefined value is passed, it will be set to 1.00                                                                                                                                                                                                                                                                                                                                                                                                                                  | 1200                        |
| include_wtt    | String | No       | The default value of "Y" includes the Well-to-Tank (WTT) factors while "N" bypasses it                                                                                                                                                                                                                                                                                                                                                                                                                       | Y                           |
| cluster_name   | String | No       | Identifier to log and aggregate these results under using the Cluster Data API                                                                                                                                                                                                                                                                                                                                                                                                                               | KrugerBrent_ProjectTwo_2026 |

## Example

### Request Payload

```
import http.client
conn = http.client.HTTPSConnection("carbonsutra1.p.rapidapi.com")
payload = "vehicle_type=Car-Type-Executive&distance_value=11250&distance_unit=km"
headers = {
    'content-type': "application/x-www-form-urlencoded",
    'Authorization': "Bearer <AUTHORIZATION_TOKEN>",
    'X-RapidAPI-Key': "<AUTHORIZATION_KEY>",
    'X-RapidAPI-Host': "carbonsutra1.p.rapidapi.com"
    }
conn.request("POST", "/vehicle_estimate_by_type", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

### Response Payload

```
{
  "data": {
    "type": "estimate-vehicle-usage",
    "vehicle_type": "Car-Type-4x4",
    "fuel_type": "Petrol",
    "distance_value": 4500,
    "distance_unit": "km",
    "include_wtt": "undefined",
    "co2e_gm": 1106955,
    "co2e_kg": 1106.96,
    "co2e_mt": 1.11,
    "co2e_lb": 2440.43,
    "explanation": "CarbonSutra computed this emission profile using the UK Government's 2026 conversion factors for greenhouse gas (GHG) reporting. This is a 4x4 car, running on petrol. For a transit distance of 4,500 kilometers and with indirect/WTT factors excluded, the total footprint evaluates to 1,106,955 grams of CO2e. Standardized metric conversions render this as 1106.96 kg (rounded to two decimal places) or 1.11 metric tons. Scaled against imperial baselines using the conversion factor of 2.20462 (source: GHG conversion factors, 2026), the final metric is expressed as 2440.43 lbs."
  },
  "success": true,
  "status": 200
}
```

## Notes

1. If you know the make and model of vehicle, we suggest to use the API that calculates emissions by Vehicle Models for more accurate results.
2. WTT is an optional factor in calculation. While it is your decision to include/exclude it, we suggest the calculations are consistent with that choice, esp when the results are compared between periods.
