https://github.com/gladyshev/yandex-direct-client
Lightweight and useful Yandex Direct API version 5 client
https://github.com/gladyshev/yandex-direct-client
php yandex yandex-direct
Last synced: 7 months ago
JSON representation
Lightweight and useful Yandex Direct API version 5 client
- Host: GitHub
- URL: https://github.com/gladyshev/yandex-direct-client
- Owner: gladyshev
- License: unlicense
- Created: 2016-12-10T12:50:58.000Z (over 9 years ago)
- Default Branch: v4.x
- Last Pushed: 2024-12-17T13:52:45.000Z (over 1 year ago)
- Last Synced: 2025-09-19T14:01:34.714Z (9 months ago)
- Topics: php, yandex, yandex-direct
- Language: PHP
- Homepage:
- Size: 219 KB
- Stars: 18
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Yandex Direct API v5 PHP client
===============================
Современный и удобный PHP-клиент [Yandex.Direct API](https://tech.yandex.ru/direct/doc/dg/concepts/about-docpage/).
[](https://travis-ci.org/gladyshev/yandex-direct-client)
[](https://scrutinizer-ci.com/g/gladyshev/yandex-direct-client/?branch=v4.x)
[](https://scrutinizer-ci.com/g/gladyshev/yandex-direct-client/?branch=v4.x)
## Требования
* PHP 7.2 и выше
## Установка
```bash
$ composer require gladyshev/yandex-direct-client
```
## Использование
```php
$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' => [...]
// ]
```