Tire Pressure API
Inspect a car’s tire pressure with simple API requests.
Retrieve the air pressure for each tire from a vehicle’s TPMS.
const smartcar = require('smartcar');
// Get all vehicles associated with this access token
const {vehicles} = await smartcar.getVehicleIds("<access-token>");
// Construct a new vehicle instance using the first vehicle's id
const vehicle = new smartcar.Vehicle(vehicles[0], "<access-token>");
// Fetch the vehicle's tire pressure
const tirePressure = await vehicle.tirePressure();
console.log(tirePressure);
import smartcar
# Get all vehicles associated with this access token
response = smartcar.get_vehicle_ids("<access-token>")
# Construct a new vehicle instance using the first vehicle's id
vehicle = smartcar.Vehicle(response["vehicles"][0], "<access-token>")
# Fetch the vehicle's tire pressure
tire_pressure = vehicle.tirePressure()
print(tire_pressure)
import com.smartcar.sdk.*;
// Get all vehicles associated with this access token
SmartcarResponse<VehicleIds> response = AuthClient.getVehicleIds("<access-token>");
String[] vehicleIds = response.getData().getVehicleIds();
// Construct a new vehicle instance using the first vehicle's id
Vehicle vehicle = new Vehicle(vehicleIds[0], "<access-token>");
// Fetch the vehicle's attributes
SmartcarResponse<tirePressure> tirePressure = vehicle.tirePressure();
System.out.println(tirePressure);
import (
"context"
smartcar "github.com/smartcar/go-sdk"
)
// Create a smartcar client
var smartcarClient = smartcar.NewClient()
// Get all vehicles associated with this access token
var vehicleIDs, resErr = smartcarClient.GetVehicleIDs(
context.TODO(),
&smartcar.VehicleIDsParams{Access: "<access-token>"},
);
// Construct a new vehicle instance using the first vehicle's id
var vehicle = smartcarClient.NewVehicle(&smartcar.VehicleParams{
ID: vehicleIDs.VehicleIDs[0],
AccessToken: "<access-token>"}
);
// Fetch the vehicle's tire pressure
var tirePressure, resErr = vehicle.GetTirePressure(context.TODO());
require 'smartcar'
# Get all vehicles associated with this access token
vehicle_ids = Smartcar::Vehicle.all_vehicle_ids(token: token)
# Construct a new vehicle instance using the first vehicle's id
vehicle = Smartcar::Vehicle.new(
token: "<access-token>",
id: vehicle_ids.first
)
# Fetch the vehicle's tire pressure
tire_pressure = vehicle.tire_pressure()
puts tire_pressure.to_hash.slice(*%I(backLeft backRight frontLeft frontRight))
// Example response from Smartcar
{
"backLeft": 219.3,
"backRight": 219.3,
"frontLeft": 219.3,
"frontRight": 219.3,
}
Allow fleet managers to monitor fuel tank levels and driver efficiency across all vehicles in their fleet.
Learn more about fleet managementEncourage customers to schedule an on-demand maintenance appointment whenever their vehicle’s tire pressure is low.
Learn more about on-demand services