Skip to content

It seems get_charge_history() API URI is no longer working? Returns 400 #155

Description

@nohir0

teslapy==2.8.0

Trying:
print(vehicles[0].get_charge_history())

throws:

Traceback (most recent call last):
[...]
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: https://powergate.prd.sn.tesla.services:443/api/v4/vehicle/charge_history => {:Message=>"Error getting charge history", :Status=>400} for url: https://owner-api.teslamotors.com/api/1/vehicles/[my-tesla-id]/charge_history

A colleage uses this in his script for fetching charging history now:

url_charging_base = 'https://ownership.tesla.com/mobile-app/charging/'
url_charging_history = f'{url_charging_base}history?deviceLanguage=en&deviceCountry={country_code}&httpLocale=en_US&vin={vehicle_vin}&operationName=getChargingHistoryV2'

What do you mean?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions