timdorr / tesla-api

🚘 A Ruby gem and unofficial documentation of Tesla's JSON API for the Model S, 3, X, and Y.
https://tesla-api.timdorr.com/
MIT License
1.99k stars 532 forks source link

Endpoint `/api/1/vehicles` returns only 100 records #758

Closed malina-nimbee closed 1 year ago

malina-nimbee commented 1 year ago

I have a client with more than 100 vehicles under one account and I can't figure out how to perform paging or sending an offset (eg like in mysql). Does anybody know?

malina-nimbee commented 1 year ago

The parameter is page. First 100 results is page 1. When request GET parameter page is provided, the API returns results above the 100 limit. You should perform another request with incremented page parameter and join the data when the result contains count=100 which means there could be next page.

curl -X GET "https://owner-api.teslamotors.com/api/1/vehicles?page=2" -H "Authorization: Bearer $TESLA_TOKEN"