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.txtNote:
curl_cffiis required, not optional. Tesla's auth endpoint fingerprints the TLS handshake of the token request; a plainrequests/OpenSSL handshake yields an access token thatowner-apirejects with403 forbidden.curl_cffireplays 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.pyWhen 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:
- Run the script — it will open the Tesla login page in your browser.
- Log in with your Tesla account credentials.
- 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. - Open your browser's Developer Tools (press
F12orCmd+Option+Ion macOS), go to the Console tab, and find the redirect request that starts withtesla://auth/callback?code=.... Copy the full URL.
- Paste the copied URL back into the terminal where the script is waiting for input, and press Enter.
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.



