byd/api-client

PHP client for BYD vehicle API

Maintainers

Package info

github.com/VitalyArt/byd-php-client

pkg:composer/byd/api-client

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-03-09 04:18 UTC

This package is auto-updated.

Last update: 2026-03-09 04:20:38 UTC


README

PHP client library for the BYD vehicle API.

Features

  • Authentication
  • Vehicle listing
  • Real-time data
  • GPS information
  • HVAC status
  • Charging status
  • Energy consumption
  • Remote control
  • Smart charging
  • Push notifications
  • Vehicle settings

Installation

composer require byd/api-client

Usage

<?php

require_once 'vendor/autoload.php';

use Byd\ApiClient\Client;
use Byd\ApiClient\Config\BydConfig;

// Create configuration
$config = BydConfig::fromEnv([
    'username' => 'your-email@example.com',
    'password' => 'your-password',
    // ... other options
]);

// Create client
$client = new Client($config);

// Login
$client->login();

// Get vehicles
$vehicles = $client->getVehicles();

foreach ($vehicles as $vehicle) {
    echo "VIN: " . $vehicle->getVin() . "\n";
    echo "Model: " . $vehicle->getModelName() . "\n";
    echo "---\n";
}

Configuration

The client can be configured in several ways:

Environment Variables

BYD_USERNAME=your-email@example.com
BYD_PASSWORD=your-password
BYD_BASE_URL=https://dilinkappoversea-eu.byd.auto
BYD_COUNTRY_CODE=NL
BYD_LANGUAGE=en
BYD_TIME_ZONE=Europe/Amsterdam

Direct Configuration

$config = new BydConfig(
    'your-email@example.com',
    'your-password',
    'https://dilinkappoversea-eu.byd.auto', // base URL
    'NL', // country code
    'en', // language
    'Europe/Amsterdam', // time zone
    // ... other options
);

API Documentation

Key classes and methods:

Requirements

  • PHP 8.1+
  • ext-json
  • guzzlehttp/guzzle ^7.0
  • psr/log ^3.0

Development

Install dependencies

composer install

Run tests

composer test

Code style

composer cs-fix

License

This project is licensed under the MIT License - see the LICENSE file for details.