{"id":13693068,"url":"https://github.com/gutenye/tesla-api","last_synced_at":"2026-03-12T12:31:12.164Z","repository":{"id":13391963,"uuid":"59770006","full_name":"gutenye/tesla-api","owner":"gutenye","description":"Unofficial API Wrapper for Tesla Model S and X. #follows-javascript-conventions #es6 #es7","archived":false,"fork":false,"pushed_at":"2023-07-11T13:15:28.000Z","size":116,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T07:44:19.642Z","etag":null,"topics":["tesla","tesla-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gutenye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-05-26T17:31:42.000Z","updated_at":"2023-08-23T11:29:57.000Z","dependencies_parsed_at":"2024-04-08T02:33:13.420Z","dependency_job_id":null,"html_url":"https://github.com/gutenye/tesla-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gutenye%2Ftesla-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gutenye%2Ftesla-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gutenye%2Ftesla-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gutenye%2Ftesla-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gutenye","download_url":"https://codeload.github.com/gutenye/tesla-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248536978,"owners_count":21120684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tesla","tesla-api"],"created_at":"2024-08-02T17:01:05.144Z","updated_at":"2026-03-12T12:31:07.137Z","avatar_url":"https://github.com/gutenye.png","language":"JavaScript","funding_links":[],"categories":["API Wrappers"],"sub_categories":[],"readme":"tesla-api, Unofficial API Wrapper for Tesla Model S and X\n===================================================\n\n[Homepage](https://github.com/gutenye/tesla-api) |\n[API Documentation](https://timdorr.docs.apiary.io) | \n[Issue Tracker](https://github.com/gutenye/tesla-api/issues) |\n[MIT License](http://choosealicense.com/licenses/mit) |\n[by Guten](http://guten.me) |\n[Gratipay](https://gratipay.com/gutenye) |\n[Bountysource](https://www.bountysource.com/teams/gutenye)\n\n|                |                                                            |\n|----------------|------------------------------------------------------------|\n| **Install**    |                                                            |\n| Node           | yarn add tesla-api                                    |\n\nPhilosophy\n-----------\n\nAPI wrappers [should reflect the idioms of the language in which they were written](http://wynnnetherland.com/journal/what-makes-a-good-api-wrapper). tesla-api wraps the Tesla API in a flat API client that follows Javascript conventions and requires little knowledge of REST.\n\nGetting started\n---------------\n\nWith ES2015 and Async Functions\n\n```javascript\nimport Tesla from \"tesla-api\"\n\nasync function main() {\n  try {\n    const vehicles = await Tesla.login({email: x, password: y})\n    const vehicle = vehicles[0]\n    const chargeState = await vehicle.chargeState()\n    console.log(chargeState)              //-\u003e { chargeState: 'Completed', ... }\n  } catch (err) {\n    if (err.status) {                     // 4xx, 5xx response error\n      console.log(`\u003c${err.status} ${err.message}\u003e`, err.response.body)\n    } else {                              // Network failures, timeouts, and other errors\n      console.error(err.stack)\n    }\n  }\n}\nmain()\n```\n\nStreaming driving state\n\n```\nvehicle.stream().subscribe(\n  data =\u003e console.log(data.speed),\n  err =\u003e console.error(err),\n  () =\u003e console.log(\"complete\")\n)\n```\n\nstream returns a [Observable](https://github.com/ReactiveX/RxJS).\n\n**Follows Javascript Conventions**\n\nConvert response key from underscore to camelCase\n\n```\n{\n  response: {\n    display_name: \"Hello\",\n    remote_start_enabled: true\n  }\n}\n\n-\u003e\n\n{\n  response: {\n    displayName: \"Hello\",\n    remoteStartEnabled: true\n  }\n}\n```\n\n**Automatical re-Authentication**\n\nWhen credientals are expires, automatically authenticate it again.\n\n**Units Support**\n\n```\nTesla.login({distanceUnit: \"km\"})\n```\n\nodometer, batteryRange, etc returns in kilometer unit instead of mile\n\n**API Reference**\n\nRead the source for now :), also see [API Documentation](https://timdorr.docs.apiary.io) for a reference.\n\nProjects using this library\n---------------------------\n\n\u003e Feel free to send a PR to include your projects.\n\n- [tesla-slack](https://github.com/heikkipora/tesla-slack) Integrates your Tesla Model S/X fleet to Slack.\n\nDevelopment\n===========\n\nContributing\n-------------\n\n* Submit any bugs/features/ideas to GitHub issue tracker.\n* Thanks to [all contributors](https://github.com/gutenye/tesla-api/contributors).\n\nResource\n--------\n\n* [Unofficial documentation of the Tesla API](https://github.com/timdorr/model-s-api)\n\nCopyright\n---------\n\nThe MIT License\n\nCopyright (c) 2015 Guten Ye\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgutenye%2Ftesla-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgutenye%2Ftesla-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgutenye%2Ftesla-api/lists"}