TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC
Start a Discussionhttps://teslamotorsclub.com/tmc/tags/

Does making too many token requests get you throttled?

Discussion in 'Model S: User Interface' started by wayner, Dec 28, 2016.

  1. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    2,559
    Location:
    Toronto
    I am doing some playing around and I am no unable to get a token. My process uses teslajson.py that requests a new token every time you use it. Is this a way of getting locked out? Should I just cache a token an reuse it until it stops working?
     
  2. Drewflux

    Drewflux Member

    Joined:
    Aug 25, 2015
    Messages:
    190
    Location:
    Australia
    Short answer is yes. its happened to other members in the model s rest API thread.
     
  3. tliving

    tliving Member

    Joined:
    Mar 8, 2014
    Messages:
    735
    Location:
    New England, USA
    Teslajson didn't used to let you provide the token back to it, so I forked it and added the feature and the owner merged it back in. That was back in Feb 2016. Unfortunately the original author just made a change (1.2) that broke that feature -- you can't get the token back any more.

    That broke a bunch of my stuff, so I reported it and resorted to going back to using my fork:
    GitHub - the-mace/teslajson: Simple Python class to access the Tesla JSON API

    With that fork you can get the access_token from the Connection object and keep it around for however long you want. This is how EVTripping.com connects to Tesla owner's accounts only once and then only keeps the token (not any passwords) for long term monitoring.
     
  4. cryptyk

    cryptyk Member

    Joined:
    Jul 8, 2015
    Messages:
    346
    Location:
    United States
    I used to run EvMote. I had a few thousand teslas using the site and lots of testing before it went public. I never saw any intentional throttling from the tesla APIs even with thousands of concurrent GPS stream connections and hundreds of concurrent API requests. I also did lots of messing around with the APIs while I was developing and I'm sure I requested oauth tokens a few hundred times per hour in the early days.

    I'm sure they will throttle you if you're abusive, but the threshold appears to be pretty high...
     
  5. cytranic

    cytranic Member

    Joined:
    Aug 14, 2015
    Messages:
    89
    Location:
    FL
    Yes, when I was testing, especially when making bad calls they would rate limit me... Normally for a few hours, but i've seen 24 hours as well.
     

Share This Page