Skip to content

niklaswa/tesla-order-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

To run the script, you need to install python3 for your operating system.

https://www.python.org/downloads/

Then you need to install the required libraries by running:

pip install -r requirements.txt

Note: curl_cffi is required, not optional. Tesla's auth endpoint fingerprints the TLS handshake of the token request; a plain requests/OpenSSL handshake yields an access token that owner-api rejects with 403 forbidden. curl_cffi replays a real browser's TLS fingerprint so the token is accepted.

Optional: Copy the script to a new directory, the script asks to save the tokens and order details in the current directory for reusing the tokens and for comparing the data with the last time you fetched the order details.

Then you can run the script by running:

python3 tesla_order_status.py

How to authenticate / login

When you run the script for the first time, it will open your browser to log in with your Tesla account. Since the redirect URL uses a tesla:// protocol that browsers can't open, you need to grab the URL from your browser's Developer Tools. Here's how:

  1. Run the script — it will open the Tesla login page in your browser.
  2. Log in with your Tesla account credentials.
  3. After logging in, the browser will try to redirect to a tesla:// URL. The page will show an error or a blank page — this is expected.
  4. Open your browser's Developer Tools (press F12 or Cmd+Option+I on macOS), go to the Console tab, and find the redirect request that starts with tesla://auth/callback?code=.... Copy the full URL.

Copying the URL from the browser console

  1. Paste the copied URL back into the terminal where the script is waiting for input, and press Enter.

Pasting the URL in the terminal

The script will exchange the code for access tokens and save them locally in tesla_tokens.json for future use. You won't need to log in again until the tokens expire.

Preview

Main information

Image

Change tracking

Image

About

Python script to retreive and track your tesla order status. For example the current odometer of the vehicle. (ref: https://ts.la/niklas82130)

Resources

Stars

54 stars

Watchers

8 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages