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.
Is the API down, or did I trigger some flood protection? I was working on something API related and suddenly started getting 408s. My mobile app doesn't work either.
I started getting 503 (Server Unavailable) just before 2013/08/13 17:04 Pacific Time. That's about 35 minutes before the post that I'm quoting.

And it appears to have woken up around 18:00 Pacific Time.

So it looks like the server was down from 5pm - 6pm Pacific Time.

- - - Updated - - -

For those running apps with databases, are you storing version numbers as well? It would be interesting to see how quickly something like this could be corroborated...

A Houston owner that took ownership today reports that he was told he has version 5 with sleep mode...
 
This is really cool. I'm a web application developer and I'm seriously considering buying the Model S to replace my 2012 Tundra. The availability of this REST API just makes the purchase even more attractive. It would be really fun to make a web-based app that talks to my car.
 
This is really cool. I'm a web application developer and I'm seriously considering buying the Model S to replace my 2012 Tundra. The availability of this REST API just makes the purchase even more attractive. It would be really fun to make a web-based app that talks to my car.

Been there, done that. I can replay where I have been driving at any time. Including visualization of the speed I was going :)
 
Has anybody tried probing for stuff like...
Code:
command/check_for_updates
command/beg_to_join_beta_list
yet? ;)

BTW. I have had an email exchange with the person responsible at Tesla. He pointed out that this api was never intended for public use and asked that we all be very sensitive to frequency of api calls and overall bandwidth use.
I am planning to add some code to my tool to prevent any frequent api calls (this doesn't affect the streaming api, but active calls to the other functions). He didn't want to comment on "what level of calls is acceptable". I am planning to go with something like a 15s minimum between calls (from observation, that appears to be what the android app uses).
I think all of us should be careful and make sure we don't force them to turn this off.
 
BTW. I have had an email exchange with the person responsible at Tesla. He pointed out that this api was never intended for public use and asked that we all be very sensitive to frequency of api calls and overall bandwidth use.
I am planning to add some code to my tool to prevent any frequent api calls (this doesn't affect the streaming api, but active calls to the other functions). He didn't want to comment on "what level of calls is acceptable". I am planning to go with something like a 15s minimum between calls (from observation, that appears to be what the android app uses).
I think all of us should be careful and make sure we don't force them to turn this off.
Thanks for the heads up.

If you continue the conversation, can you please let this person know that -- for me at least -- most of my REST use could be completely non-3G, non-internet if they allowed fetching logged data (with the same info) directly from the car.

Perhaps they'll consider this as part of wifi interaction with the car if they prefer not to do it over the USB.

Thanks.
 
Thanks for the heads up.

If you continue the conversation, can you please let this person know that -- for me at least -- most of my REST use could be completely non-3G, non-internet if they allowed fetching logged data (with the same info) directly from the car.

Perhaps they'll consider this as part of wifi interaction with the car if they prefer not to do it over the USB.

Thanks.

I politely offered help with designing a future api :)
 
BTW. I have had an email exchange with the person responsible at Tesla. He pointed out that this api was never intended for public use and asked that we all be very sensitive to frequency of api calls and overall bandwidth use.
I am planning to add some code to my tool to prevent any frequent api calls (this doesn't affect the streaming api, but active calls to the other functions). He didn't want to comment on "what level of calls is acceptable". I am planning to go with something like a 15s minimum between calls (from observation, that appears to be what the android app uses).
I think all of us should be careful and make sure we don't force them to turn this off.

I had a 2 minute burst of rampant activity yesterday due to a bug. I got an email from Tesla alerting me to it (I already knew) and asking what happened. I sent a note back explaining and apologizing profusely. I haven't heard back. Under normal circumstances I refresh every 15 seconds. I'll figure out how best to add some rate limiting functionality in the underlying client library to avoid runaway activity like I had yesterday.
 
I had a 2 minute burst of rampant activity yesterday due to a bug. I got an email from Tesla alerting me to it (I already knew) and asking what happened. I sent a note back explaining and apologizing profusely. I haven't heard back. Under normal circumstances I refresh every 15 seconds. I'll figure out how best to add some rate limiting functionality in the underlying client library to avoid runaway activity like I had yesterday.
That's exactly what I did as well. I just want to test things a bit more before pushing to Hans. I simply keep a timestamp of "last request" and don't issue a new request until that's at least 15 secs ago (and then I update the "last request" variable). That seems reasonably fool-proof.
 
That's exactly what I did as well. I just want to test things a bit more before pushing to Hans. I simply keep a timestamp of "last request" and don't issue a new request until that's at least 15 secs ago (and then I update the "last request" variable). That seems reasonably fool-proof.

Yes, it wouldnt surprise me if they do something to try to limit accessibility in the future (though Im not sure if they could absolutely prevent it). I am bothered by the idea that they might need to spend some unplanned cycles on making it non-accessible (vs other bug fixes and new features). But I also like the idea of being able to use the data. Hopefully a smart solution is figured out without spending too many cycles on it.

As for IFTTT access (assuming we can continue to access). Yes your scenarios are great. I guess Im just hoping for basic functions first. But yes more robust features like, start pre-cooling based on calendar entries. I.e. once i have no more meetings on my calendar, start pre-cooling haha...
 
Has anyone been able to test against the 5.0 Firmware to see if there are any new fields?

{"charging_state":"Disconnected","charge_limit_soc":90,"charge_limit_soc_std":90,"charge_limit_soc_min":50,"charge_limit_soc_max":100,"charge_to_max_range":false,"battery_heater_on":false,"not_enough_power_to_heat":false,"max_range_charge_counter":0,"fast_charger_present":false,"battery_range":166.23,"est_battery_range":167.7,"ideal_battery_range":191.32,"battery_level":71,"battery_current":-0.6,"charge_energy_added":8.0,"charge_miles_added_rated":26.0,"charge_miles_added_ideal":30.0,"charger_voltage":0,"charger_pilot_current":0,"charger_actual_current":0,"charger_power":0,"time_to_full_charge":null,"charge_rate":0.0,"charge_port_door_open":false,"scheduled_charging_start_time":null,"scheduled_charging_pending":false,"user_charge_enable_request":null,"charge_enable_request":false}

{"df":0,"dr":0,"pf":0,"pr":0,"ft":0,"rt":0,"car_version":"1.35.98","locked":false,"sun_roof_installed":true,"sun_roof_state":"unknown","sun_roof_percent_open":0,"dark_rims":false,"wheel_type":"Base19","has_spoiler":false,"roof_color":"None","perf_config":"Base","exterior_color":"Grey"}

{"inside_temp":54.5,"outside_temp":31.5,"driver_temp_setting":17.0,"passenger_temp_setting":17.0,"is_auto_conditioning_on":false,"is_front_defroster_on":0,"is_rear_defroster_on":false,"fan_status":0}

{"shift_state":null,"speed":null,"latitude":26.407083,"longitude":-80.108949,"heading":173,"gps_as_of":1376935137}

{"gui_distance_units":"mi/hr","gui_temperature_units":"F","gui_charge_rate_units":"mi/hr","gui_24_hour_time":true,"gui_range_display":"Rated"}