manzadey/yandex-metrika

Yandex Metrika API

v0.1 2021-08-03 16:40 UTC

This package is auto-updated.

Last update: 2024-09-29 06:08:40 UTC


README

要开始工作,需要创建客户端,并指定计数器和OAUTH令牌。

use Manzadey\YandexMetrika\Client;

$client = new Client('metrics', 'token');

API请求示例

$response = $client->get('/stat/v1/data/bytime', [
    'metrics' => 'ym:s:visits',
    'date1'   => 'today',
    'date2'   => 'today',
]);

// return \Manzadey\YandexMetrika\Response

处理响应的函数

public function getResponse() : ResponseInterface

public function toArray() : array

public function getBody() : string