EV battery

API

Klik, geef toestemming, haal SoC op.

Lees het batterijniveau en de batterijcapaciteit van een elektrisch voertuig met eenvoudige API-aanvragen.

Batterijniveau

Haal de laadstatus (SoC) en de resterende actieradius op van een elektrische auto met batterij (BEV) of een plug-in hybride auto (PHEV).

Capaciteit van de batterij

Ken de capaciteit van de batterij van een elektrische auto.

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 battery level
const battery = await vehicle.battery();

// Fetch the vehicle's battery capacity 
const batteryCapacity = await vehicle.batteryCapacity();
// Example http response from Smartcar (battery level)
{
  "percentRemaining": 0.3,
  "range": 40.5,
}

// Example http response from Smartcar (battery capacity)
{
  "capacity": 28.7,
}
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 battery level
battery = vehicle.battery()

# Fetch the vehicle's battery capacity 
battery_capacity = vehicle.battery_capacity()
// Example http response from Smartcar (battery level)
{
  "percentRemaining": 0.3,
  "range": 40.5,
}

// Example http response from Smartcar (battery capacity)
{
  "capacity": 28.7,
}
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 battery level
VehicleBattery battery = vehicle.battery();

// Fetch the vehicle's battery capacity 
VehicleBatteryCapacity batteryCapacity = vehicle.batteryCapacity();
// Example http response from Smartcar (battery level)
{
  "percentRemaining": 0.3,
  "range": 40.5,
}

// Example http response from Smartcar (battery capacity)
{
  "capacity": 28.7,
}
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 battery level
var battery, resErr = vehicle.GetBattery(context.TODO());

// Fetch the vehicle's battery capacity 
var batteryCapacity, resErr = vehicle.GetBatteryCapacity(context.TODO());
// Example http response from Smartcar (battery level)
{
  "percentRemaining": 0.3,
  "range": 40.5,
}

// Example http response from Smartcar (battery capacity)
{
  "capacity": 28.7,
}
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 battery level
battery = vehicle.battery()

# Fetch the vehicle's battery capacity 
battery_capacity = vehicle.battery_capacity()
// Example http response from Smartcar (battery level)
{
  "percentRemaining": 0.3,
  "range": 40.5,
}

// Example http response from Smartcar (battery capacity)
{
  "capacity": 28.7,
}
Bekijk de API-documenten

Kenmerken van het product

  • Compatibel met 36 automerken

    Compatibel met 39 automerken

  • Vriendelijke toestemmingsstroom van gebruikers

    Vriendelijke toestemmingsstroom van gebruikers

  • Werkt op voertuigen uit 2015 en nieuwer

    Werkt op voertuigen uit 2015 en nieuwer

  • Vertrouwd en veilig

    Vertrouwd en veilig

  • Live data ophalen en acties activeren

    Toegang tot actuele autogegevens

  • SDK's voor Go, Java, Node.js, Python en Ruby

    SDK's voor Go, Java, Node.js, Python en Ruby

Meer informatie over de API's van Smartcar

Gerelateerde industrieën

Laadnetwerken voor elektrische voertuigen

Geef geschatte oplaadtijden, automatische laadschema's en EV-reisplanning op in je app.

Leveranciers van energie en nutsvoorzieningen

Beheer het opladen van elektrische voertuigen in woningen van uw klanten om de belasting van het elektriciteitsnet zo goed mogelijk in evenwicht te houden.

Wat we aan het bouwen zijn

De latentie en frequentie van de beschikbaarheid van gegevens kunnen per merk en model verschillen.