Get & Set Charge Limit

API

Control EV charging, preserve battery health

Prevent overcharging and maintain EV battery health by keeping charging sessions within a specified charge limit. With Smartcar, businesses can avoid charging customer vehicles to 100% to increase battery lifespan.

How businesses use get and set charge limit

Optimize demand response

Set charge limits for EVs based on the time of day and electricity demand to prevent demand spikes.

Manage EV charging

Optimize charging schedules according to a specified charge limit or a driver’s specified needs during each charging session.

Inform battery health reporting

Gain better visibility into a vehicle owner's charging behavior to compare the impact of charge limits on battery health across similar makes and models.

An illustration of a connected vehicle on a winding road.

Get charge limit

Returns the charge limit configuration for the vehicle.

Set charge limit

Set the charge limit of an electric vehicle.

const smartcar = require('smartcar');

// Get all vehicles associated with this access token
const {vehicles} = await smartcar.getVehicles("<access-token>");

// Construct a new vehicle instance using the first vehicle's id
const vehicle = new smartcar.Vehicle(vehicles[0], "<access-token>");

// Set the vehicle's charge limit
await vehicle.setChargeLimit(0.8);


// Example http response from Smartcar (set charge limit)
{
  "status": "success"
}
import smartcar

# Get all vehicles associated with this access token
response = smartcar.get_vehicles("<access-token>")

# Construct a new vehicle instance using the first vehicle's id
vehicle = smartcar.Vehicle(response.vehicles[0], "<access-token>")

# Set the vehicle's charge limit
vehicle.set_charge_limit(0.8)


// Example http response from Smartcar (set charge limit)
{
  "status": "success"
}
import com.smartcar.sdk.*;

// Get all vehicles associated with this access token
VehicleIds response = Smartcar.getVehicles("<access-token>");
String[] vehicleIds = response.getVehicleIds();

// Construct a new vehicle instance using the first vehicle's id
Vehicle vehicle = new Vehicle(vehicleIds[0], "<access-token>");

// Set the vehicle's charge limit
vehicle.setChargeLimit(0.8)


// Example http response from Smartcar (set charge limit)
{
  "status": "success"
}
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 current charge limit
var chargeLimit, resErr = vehicle.GetChargeLimit(context.TODO());


// Example http response from Smartcar (set charge limit)
{
  "status": "success"
}
require 'smartcar'

# Get all vehicles associated with this access token
all_vehicles =  Smartcar.get_vehicles(token: token)

# Construct a new vehicle instance using the first vehicle's id
vehicle = Smartcar::Vehicle.new(
  token: "<access-token>",
  id: all_vehicles.vehicles.first
)

# Set the vehicle's charge limit
vehicle.set_charge_limit!(0.8)


// Example http response from Smartcar (set charge limit)
{
  "status": "success"
}
See the API docs

Product features

  • Compatible with 36 car brands

    Compatible with 39 car brands

  • Friendly user consent flow

    Friendly user consent flow

  • Works on 2015 and newer vehicles

    Works on 2015 and newer vehicles

  • Trusted & secure

    Trusted & secure

  • Retrieve live data and trigger actions

    Retrieve live data and trigger live actions

  • SDKs for Go, Java, Node.js, Python, and Ruby

    SDKs for Go, Java, Node.js, Python, and Ruby

Learn more about Smartcar's APIs

Related industries

EV charging networks

Provide estimated charging times, automatic charging schedules, and EV trip planning in your app.

Energy & utility providers

Manage your customers’ residential EV charging to best balance electric grid load.

What we’re building

Latency and frequency of data availability may vary between makes and models.