gladyshev / yandex-direct-client
Useful Yandex.Direct API v5 client.
v4.4.0
2024-12-17 13:51 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- ext-mbstring: *
- guzzlehttp/psr7: 1.9.1|2.7.0
- psr/http-client: 1.0.3
Requires (Dev)
- guzzlehttp/guzzle: 7.9.0
- phpunit/phpunit: 8.5.41
- psr/log: 1.1
- squizlabs/php_codesniffer: 3.5.8
- vimeo/psalm: 3.18.2
This package is auto-updated.
Last update: 2026-03-17 16:45:27 UTC
README
Современный и удобный PHP-клиент Yandex.Direct API.
Требования
- PHP 7.2 и выше
Установка
$ 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' => [...]
// ]