gladyshev / yandex-direct-client
Useful Yandex.Direct API v5 client.
v4.6.0
2026-07-17 17:41 UTC
Requires
- php: ^8.4
- ext-json: *
- ext-mbstring: *
- psr/http-client: 1.0.3
- psr/http-factory: ^1.1
- psr/http-message: ^1.1|^2.0
Requires (Dev)
- guzzlehttp/guzzle: 7.9.0
- phpunit/phpunit: ^9.6
- psr/log: 1.1
- squizlabs/php_codesniffer: ^3.13
- vimeo/psalm: ^6
This package is auto-updated.
Last update: 2026-07-17 17:42:35 UTC
README
Современный и удобный PHP-клиент Yandex.Direct API.
Требования
- PHP 8.4 и выше
Установка
$ composer require gladyshev/yandex-direct-client
Использование
$credentials = \Gladyshev\Yandex\Direct\Credentials::client( getenv('_TOKEN_') ); $httpClient = new \GuzzleHttp\Client(); // Guzzle 7 или любой другой PSR-18 HTTP-клиент $client = new \Gladyshev\Yandex\Direct\Client( $credentials, $httpClient ); $response = $client->campaigns->get( ['Ids' => [123545345, 23423234]], // SelectionCriteria ['Status', 'Currency', 'Funds'] // FieldNames ); print_r($response); // [ // 'request_id' => 8695244274068608439, // 'units_used_login' => 'ttt-agency', // 'units' => [ // 'debit' => 10, // 'rest' => 20828, // 'limit' => 64000 // ], // 'result' => [...] // ]