Charge Records
curl --request GET \
--url https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/recordsimport requests
url = "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"records": [
{
"chargeStart" : "2023-03-08T12:54:44Z",
"chargeEnd" : "2023-03-08T14:14:44Z",
"location": "Cockfosters Road, Barnet, EN4 0",
"energy" : 34.22998046875,
"isPublic" : true,
"startPercentRemaining" : 0.57,
"endPercentRemaining" : 1,
"chargingType" : "DC"
}
]
}
BMW and MINI
Charge Records
Returns data associated with completed charging sessions for a vehicle. Limited to the last 30 days or when the owner first granted your application access, which ever is shorter.
GET
/
v2.0
/
vehicles
/
{id}
/
{make}
/
charge
/
records
Charge Records
curl --request GET \
--url https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/recordsimport requests
url = "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"records": [
{
"chargeStart" : "2023-03-08T12:54:44Z",
"chargeEnd" : "2023-03-08T14:14:44Z",
"location": "Cockfosters Road, Barnet, EN4 0",
"energy" : 34.22998046875,
"isPublic" : true,
"startPercentRemaining" : 0.57,
"endPercentRemaining" : 1,
"chargingType" : "DC"
}
]
}
This endpoint is currently available for
bmw and miniPermission
read_charge_records
Request
Pathstring
required
The vehicle ID of the vehicle you are making a request to.
Date of the first record to return in YYYY-MM-DD format.
Defaults to 30 days prior or when the owner first granted your application access, whichever is shorter.
Date of the final record to return in YYYY-MM-DD format. Defaults to the date of the request.
Response
[object]
An array of charge records for the vehicle.
Hide child attributes
Hide child attributes
string
The start date of the charging record, formatted in ISO 8601 standard
string
The end date of the charging record, formatted in ISO 8601 standard
string
Location of the charge session.
number
default:"kWh"
The amount of energy consumed during the charging session.
bool
Indicates whether the charging location is public or not.
number
The remaining battery soc at the start of the charging session.
number
The remaining battery soc at the end of the charging session.
string
The type of charger used for the session.
{
"records": [
{
"chargeStart" : "2023-03-08T12:54:44Z",
"chargeEnd" : "2023-03-08T14:14:44Z",
"location": "Cockfosters Road, Barnet, EN4 0",
"energy" : 34.22998046875,
"isPublic" : true,
"startPercentRemaining" : 0.57,
"endPercentRemaining" : 1,
"chargingType" : "DC"
}
]
}
Was this page helpful?
⌘I

