PHPackages                             stephangroen/tesla-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. stephangroen/tesla-php-client

ActiveLibrary[API Development](/categories/api)

stephangroen/tesla-php-client
=============================

A PHP Client for the Tesla API

v0.6.0(6y ago)173548[1 issues](https://github.com/stephangroen/tesla-php-client/issues)MITPHPPHP &gt;=7.0.0

Since Dec 22Pushed 6y ago5 watchersCompare

[ Source](https://github.com/stephangroen/tesla-php-client)[ Packagist](https://packagist.org/packages/stephangroen/tesla-php-client)[ Docs](http://github.com/stephangroen/testla-php-client)[ RSS](/packages/stephangroen-tesla-php-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)DependenciesVersions (8)Used By (0)

tesla-php-client
================

[](#tesla-php-client)

A PHP client for easy integration of the Tesla API

This client is very basic, so most changes to the Tesla API will automatically be accomodated for. You can find the docs of the API at

Installation
------------

[](#installation)

This project can easily be installed through Composer.

```
composer require stephangroen/tesla-php-client

```

One-time authentication process
-------------------------------

[](#one-time-authentication-process)

Before you can start, you will first need to get an access token. This is a one-time process. Fortunatly the client makes this very simple. Get the client\_id and client\_secret here: . You need to add them to you environment via a .env file in your existing project or use the functions supplied by the client. You need your email address and password you use for My Tesla. With these credentials you can get the access token.

```
$tesla = new StephanGroen\Tesla\Tesla();
$tesla->setClientId('client_id_here');
$tesla->setClientSecret('client_secret_here');
$accessToken = $tesla->getAccessToken('your_username', 'your_password');
```

The access token is the only authentication token you need after this one-time process.

Use the client
--------------

[](#use-the-client)

Next time you'd like to use the client, initiate it with the access token:

```
$tesla = new StephanGroen\Tesla\Tesla('your_access_token');
```

Get and set your vehicle id
---------------------------

[](#get-and-set-your-vehicle-id)

In order to execute vehicle specific calls, you need your vehicle id. Retrieve this by requesting all vehicles for your account:

```
$tesla = new StephanGroen\Tesla\Tesla();
$tesla->vehicles();
```

This will return an array with information about your vehicles. Extract the `id` from the respone, not the `vehicle_id` which is used for Tesla internal purposes. You might want to store this id locally for future use. When you have the id, let the client know as follows:

```
$tesla = new StephanGroen\Tesla\Tesla();
$tesla->setVehicleId(123);
```

Example call
------------

[](#example-call)

Calls are very simple, read the source code and API docs to find out all available calls. For example, set the charge limit to 90 percent:

```
$tesla = new StephanGroen\Tesla\Tesla('87dsfg76sdfg765sdfg765dsfg76fgds76');
$tesla->setVehicleId(123);
$tesla->setChargeLimit(90);
```

So, for every use you initiate the client and set the vehicle id to execute calls for.

Client response
---------------

[](#client-response)

All calls just return an array with the data as described in the API docs mentioned above.

408 responses
-------------

[](#408-responses)

You might get some 408 responses when your vehicle still needs to wake up. Wait for a moment and try again.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~173 days

Recently: every ~221 days

Total

7

Last Release

2387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94084d27fbed98367df4f02d8ed51a1c9de50efc243d3d05ec0451a1f0f97860?d=identicon)[stephangroen](/maintainers/stephangroen)

---

Top Contributors

[![stephangroen](https://avatars.githubusercontent.com/u/1607643?v=4)](https://github.com/stephangroen "stephangroen (17 commits)")[![corsair](https://avatars.githubusercontent.com/u/1847891?v=4)](https://github.com/corsair "corsair (6 commits)")[![Olen](https://avatars.githubusercontent.com/u/203184?v=4)](https://github.com/Olen "Olen (6 commits)")[![boxystudio](https://avatars.githubusercontent.com/u/8049008?v=4)](https://github.com/boxystudio "boxystudio (3 commits)")[![steveneppler](https://avatars.githubusercontent.com/u/24479922?v=4)](https://github.com/steveneppler "steveneppler (1 commits)")

---

Tags

phpapitesla

### Embed Badge

![Health badge](/badges/stephangroen-tesla-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/stephangroen-tesla-php-client/health.svg)](https://phpackages.com/packages/stephangroen-tesla-php-client)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
