EV charging

API

Remotely manage EV charging

Check the charging status and charge electric vehicles with simple API requests.

Charging status

Check whether an EV’s charging cable is plugged in and charging.

Start or stop charge

Remotely start or stop charging a battery electric (BEV) or plug-in hybrid vehicle (PHEV).

Get & set charge limit

Preserve battery health by managing charge limits for electric vehicles.

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>");

// Fetch the vehicle's charging status
const charge = await vehicle.charge();

// Start the vehicle's charging session
await vehicle.startCharge();

// Set the vehicle's charge limit
await vehicle.setChargeLimit(0.8);
// Example http response from Smartcar (charging status)
{
  "isPluggedIn": true,
  "state":"FULLY_CHARGED"
}

// Example http response from Smartcar (start charge)
{
  "status": "success"
}

// 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>")

# Fetch the vehicle's charging status
charge = vehicle.charge()

# Start the vehicle's charging session
vehicle.start_charge()

# Set the vehicle's charge limit
vehicle.set_charge_limit(0.8)
// Example http response from Smartcar (charging status)
{
  "isPluggedIn": true,
  "state":"FULLY_CHARGED"
}

// Example http response from Smartcar (start charge)
{
  "status": "success"
}

// 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>");

// Fetch the vehicle's charging status
VehicleCharge charge = vehicle.charge();

// Start the vehicle's charging session
vehicle.startCharge();

// Set the vehicle's charge limit
vehicle.setChargeLimit(0.8)
// Example http response from Smartcar (charging status)
{
  "isPluggedIn": true,
  "state":"FULLY_CHARGED"
}

// Example http response from Smartcar (start charge)
{
  "status": "success"
}

// 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 charging status
var charge, resErr = vehicle.GetCharge(context.TODO());

// Start the vehicle's charging session
var startCharge, resErr = vehicle.StartCharge(context.TODO());
// Example http response from Smartcar (charging status)
{
  "isPluggedIn": true,
  "state":"FULLY_CHARGED"
}

// Example http response from Smartcar (start charge)
{
  "status": "success"
}

// 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
)

# Fetch the vehicle's charging status
charge = vehicle.charge()

# Start the vehicle's charging session
vehicle.startCharge!

# Set the vehicle's charge limit
vehicle.set_charge_limit!(0.8)
// Example http response from Smartcar (charging status)
{
  "isPluggedIn": true,
  "state":"FULLY_CHARGED"
}

// Example http response from Smartcar (start charge)
{
  "status": "success"
}

// 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.