Skip to main content

Volvo Connected Vehicle API

This is an unofficial Python client for the Volvo Connected Vehicle API. It is based on the official API documentation.

Source: svrooij/py_volvo_connected

Installation

pip install volvo-connected

Usage

from kiota_http.httpx_request_adapter import HttpxRequestAdapter
from volvo_connected import (
  StaticAccessTokenProvider,
  # DynamicAccessTokenProvider,
  VolvoAuthenticationProvider,
  VolvoConnectedClient
)

# Create an access token provider using a static access token
access_token_provider = StaticAccessTokenProvider("YOUR_ACCESS_TOKEN")

# Or explore the DynamicAccessTokenProvider that allows you to auto refresh the token

# def access_token_function(url: str) -> str:
#   # Implement your logic to get the access token using the URL
#   return "your_dynamic_access_token"
# access_token_provider = DynamicAccessTokenProvider(access_token_function)

# Create an authentication provider using your VCC API key and the access token provider
auth_provider = VolvoAuthenticationProvider("YOUR_VCC_API_KEY", access_token_provider)

# Create a client with a request adapter that has the authentication provider
client = VolvoConnectedClient(HttpxRequestAdapter(auth_provider))

Get all vehicles

vehicles = await client.vehicles.get()

Get vehicle by VIN

vehicle = await client.vehicles.by_vin("YV4952NA4F120DEMO").get()

Get Fuel or Battery level

fuel_resp = await client.vehicles.by_vin("YV4952NA4F120DEMO").fuel.get()

fuel_resp.data.fuel_amount.value
# or
fuel_resp.data.battery_charge_level.value

All other endpoints

This client is genereted based on the (adjusted) OpenAPI specification. And everything is strong typed, so go ahead and explore the API.

Metadata

Release files for volvo-connected 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for volvo-connected 0.2.0
File Size Uploaded
volvo_connected-0.2.0.tar.gz 55.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for volvo-connected 0.2.0
File Interpreter ABI Platform
volvo_connected-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 153.2 kB

Release files / volvo_connected-0.2.0.tar.gz

Download URL volvo_connected-0.2.0.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7251672e2572856728adcdbc07bc74d5f9976b8bbee900453c3576680de9d23b
BLAKE2b-256 checksum
How to use checksums
6fe0e06054cceb577836b4e4604d928b8bf87836de1b90ff2fb0c488ced22a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / volvo_connected-0.2.0-py3-none-any.whl

Download URL volvo_connected-0.2.0-py3-none-any.whl
Size 97.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7af960032bbe33ec53230f634754f98aa8044a04a3e24eec5cb16741d5c7609e
BLAKE2b-256 checksum
How to use checksums
0b41245b8388aa9827923c775e5bd7453a0ef373fb95075c5326e4e0527a8237
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page