Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Model S REST API

This site may earn commission on affiliate links.
In the last day or so, I started getting 404 errors on a few endpoints. Specifically, the following all just started failing with 404s:
If I just call GET https://owner-api.teslamotors.com/api/1/vehicles/ I can see my list of vehicles (which is a list of 1). And, if I call GET https://owner-api.teslamotors.com/api/1/vehicles/{myvehicleid} I see the info for my specific vehicle. I have verified that the calls are using the id that gets returned from the vehicles call.

Any ideas? Is anyone else seeing anything similar? Are there other endpoints that I should be using? Any help would be really appreciated!
 
Looks like data_request endpoints have been deprecated for at least half a year and they are finally removed. You will need to use vehicle_data endpoint to retrieve all the different vehicle states. See here:
 
Last edited:
Looks like data_request endpoints have been deprecated for at least half a year and they are finally removed. You will need to use vehicle_data endpoint to retrieve all the different vehicle states. See here:
Thanks! This is exactly what I needed!
 
Tesla recently released an official REST API. I suspect this broke the unofficial APIs.
I've done some more research since my post a couple days ago. Release 2023.28 appears to have removed GPS from the vehicle_data response, but the API does still work, for now. If I understand correctly this will be totally decommissioned, even for older vehicles, sometime in 2024. I'm still trying to figure out how to deal with the official REST API that was announced. Haven't figured out if it's even available for someone like me as an individual owner the just wants to pull data on their own vehicle using a local routine on a home computer. Everything seems to be focused on processes running on a website, but if I'm wrong and there is a way I can make it work from a local routine running on my laptop, I'd be thrilled if someone could help educate me on how to do that!

For now, I'm having to accept that I've lost GPS for now and need to get to work to figure out how I can migrate to some other process by end of the year. Oh, well ...
 
  • Like
Reactions: goRt
I still have GPS running on my TesSense app, I query the car in Python with:
Code:
        print("Starting connection to", mycar.get_vehicle_summary()['display_name'], end='')
        if not mycar.available():
            print("... []")
        else:
            try: cardata=mycar.get_vehicle_data()
            except: print("Error reading CarData")
            else:
                print("... [", round(cardata['drive_state']['latitude'], 3), ",", round(cardata['drive_state']['longitude'], 3), "]")

And I get:

Starting connection to MyTesla... [ 37.xxx , -122.xxx ]

edited for privacy reasons
 
I still have GPS running on my TesSense app, I query the car in Python with:
Code:
        print("Starting connection to", mycar.get_vehicle_summary()['display_name'], end='')
        if not mycar.available():
            print("... []")
        else:
            try: cardata=mycar.get_vehicle_data()
            except: print("Error reading CarData")
            else:
                print("... [", round(cardata['drive_state']['latitude'], 3), ",", round(cardata['drive_state']['longitude'], 3), "]")

And I get:

Starting connection to MyTesla... [ 37.xxx , -122.xxx ]

edited for privacy reasons
What software release are you on?

I just noticed I had a typo in my earlier entry about related software release. The issue happened for me when I updated a couple days ago from 2023.32.7 to 2023.38.4. It appears to disappear with software 2023.38 and later releases, not 2023.28 per my typo of in message from a couple hours ago.

I'm also doing my logging script in python. I checked the full response string from the vehicle_data get request. Latitude or longitude values are not included in the drive_state group, and I do not find anywhere else either.

I ended up adding try: / except: logic around where I'd pull the latitude and longitude values out to keep my logger from bombing. That has me back running, but unfortunately, without capturing gps location data.

I haven't compared the full vehicle_data response to before to see what else might have been disappeared but so far seems isolated to gps. I think this change coincides with the new Location Sharing feature included with 2023.38 release. It says that you'll actually get a icon at the top of your screen in the car pop up when an app requests your vehicle's live location data. The description suggest that it doesn't block response, just provides a notification so in the car you realize you're being tracked.
 
Got it, so you think it's something for NON-FSD users? I am on the latest FSD 2023.27.7 that I got this week.
Everything I've seen links it to 2023.38 release. Here's the release notes I see for version I installed. Look at the item about location sharing. I'm guessing whenever that gets rolled into the FSD branch you'll see the same impact.

From what I see in the new official REST API they are going to a separate telemetry stream to provide gps. I'm guessing this is now the first step in transition for that.
IMG_5725.jpeg
 
Anyone else tired of having to update their code for Tesla API changes? My commands have been failing and I just found out that I have to install Tesla's Vehicle Command SDK which uses golang (never heard of that language). Here we go again... This is the 5th time in just a few years that I've had to update my scripts because of some arbitrary decisions made by Tesla's software devs. Would be nice if they'd stick with their original API and minimize changes.
 
I can't even get this thing to install. I installed the latest go application and I'm following the installation instructions on github:

Code:
root@apache:~/github/vehicle-command-main# go get ./...
root@apache:~/github/vehicle-command-main# go build ./...
root@apache:~/github/vehicle-command-main# go install ./...
root@apache:~/github/vehicle-command-main# tesla-keygen
tesla-keygen: command not found
 
Anyone else tired of having to update their code for Tesla API changes? My commands have been failing and I just found out that I have to install Tesla's Vehicle Command SDK which uses golang (never heard of that language). Here we go again... This is the 5th time in just a few years that I've had to update my scripts because of some arbitrary decisions made by Tesla's software devs. Would be nice if they'd stick with their original API and minimize changes.
But isn't the API unofficial? It seems like Tesla doesn't care that much if people use the API, but they don't promise anything, including that it won't get totally broken. This isn't all that unusual although other companies can be even worse in this area.
 
It's interesting that they used to use the API so if something was working in the Tesla App you knew it would work for you. I have to figure the new App uses the secure API that they plan to open to the public (and charge for). Will be an interesting time for our apps. I get why they removed the GPS location from the API even though in theory you need a password to get the GPS data, but it would be more secure if the location of my car is unavailable outside the Secure API
 
Yeah, I think Tesla has not made up its mind about hobbyists, they require that you register to be a developer with a fully formed business identity including a website to push your product. Great for TeslaFi or TezLab, and all the other apps I use have already migrated over to the new API, but for those of us that just wanna play around we are being locked out

If Tesla's third largest investor can't get heard by the board I don't think any of our complaints will be heard
 
  • Like
Reactions: gglockner and goRt