Client libraries and SDKs

Libraries and tools for interacting with your Samsara integration.

SDKs

Samsara's SDKs reduce the amount of work required to integrate the REST APIs. Find installation instructions and examples of API requests in the readme for each SDK.

For issues with the usability of the SDK, please create an issue in the respective GitHub repository. For any other API and developer questions, please direct those to the support team by opening a ticket

Samsara Python

GitHub

Installation

pip install samsara-api

Usage

from samsara import Samsara

# Initialize the client with your API token
client = Samsara(
    token="YOUR_TOKEN",
)

# Get your organization information
org_info = client.organization_info.get_organization_info()
print(f"Organization: {org_info.data.name}")

# List all vehicles in your fleet
vehicles = client.vehicles.list()
for vehicle in vehicles:
    print(f"Vehicle: {vehicle.name} (ID: {vehicle.id})")

# Get specific vehicle details
vehicle = client.vehicles.get(id="YOUR_VEHICLE_ID")
print(f"Vehicle VIN: {vehicle.data.vin}")