The Smartcar API lets you read vehicle data (location, odometer, fuel, etc.) and send commands to vehicles (lock, unlock) using HTTP requests.
go get github.com/smartcar/go-sdk-v2
package main
import(
"context"
"log"
"github.com/smartcar/go-sdk-v2"
"github.com/smartcar/go-sdk-v2/pkg/models/shared"
"github.com/smartcar/go-sdk-v2/pkg/models/operations"
)
func main() {
s := smartcar.New(
smartcar.WithSecurity(shared.Security{
BearerAuth: "",
}),
)
vehicleID := "36ab27d0-fd9d-4455-823a-ce30af709ffc"
ctx := context.Background()
res, err := s.Vehicles.GetLocation(ctx, vehicleID)
if err != nil {
log.Fatal(err)
}
if res.Location != nil {
// handle response
}
}
- GetChargeTime - Retrieve charging completion time for a Cadillac.
- GetVoltage - Retrieve charging voltmeter time for a Cadillac.
- GetChargeTime - Retrieve charging completion time for a Chevrolet.
- GetVoltage - Retrieve charging voltmeter time for a Chevrolet.
- ListCompatibility - Compatibility
- GetBatteryCapacity - EV Battery Capacity
- GetBatteryLevel - EV Battery Level
- GetChargingLimit - EV Charging Limit
- GetChargingStatus - EV Charging Status
- SetChargingLimit - Set EV Charging Limit
- StartStopCharge - Start or stop charging an electric vehicle. Please contact us to request early access.
- GetAmmeter - Retrieve charging ammeter time for a Tesla.
- GetChargeTime - Retrieve charging completion time for a Tesla.
- GetCompass - Retrieve compass heading for a Tesla.
- GetExteriorTemperature - Retrieve exterior temperature for a Tesla.
- GetInteriorTemperature - Retrieve interior temperature for a Tesla.
- GetSpeedometer - Retrieve speed for a Tesla.
- GetVoltage - Retrieve charging voltmeter time for a Tesla.
- GetWattmeter - Retrieve charging wattmeter time for a Tesla.
- SetAmmeter - Set charging ammeter time for a Tesla.
- GetInfo - User Info
- Batch - Batch
- Disconnect - Revoke Access
- Get - Vehicle Info
- GetEngineOil - Engine Oil Life
- GetFuelTank - Fuel Tank (US Only)
- GetLocation - Location
- GetOdometer - Odometer
- GetPermissions - Application Permissions
- GetTirePressure - Tire Pressure
- GetVin - Returns the vehicle’s manufacturer identifier.
- ListVehicles - All Vehicles
- LockUnlock - Lock/Unlock Vehicle
- Subscribe - Subscribe Webhook
- Unsubscribe - Unsubscribe Webhook
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !