PHPackages                             cnam/yandex\_metrica - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cnam/yandex\_metrica

ActiveLibrary

cnam/yandex\_metrica
====================

Sdk for integration yandex metrica api

0.0.1(11y ago)38[28 issues](https://github.com/cnam/yandex_metrica/issues)GPL v2PHP

Since May 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/cnam/yandex_metrica)[ Packagist](https://packagist.org/packages/cnam/yandex_metrica)[ RSS](/packages/cnam-yandex-metrica/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Yandex Metrica api for PHP
==========================

[](#yandex-metrica-api-for-php)

A PHP library for interacting with the Yandex Metrica REST API v2.

[Документация](http://api.yandex.ru/metrika/doc/ref/concepts/About.xml)

Usage
-----

[](#usage)

```
require "vendor/autoload.php";

$clientId = 'client_id';
$secret_pass = 'secret_pass';
$redirectUrl ='http://mysite.com';

$api = new YaM\Api($clientId, $secret_pass);

/**
 * Возвращает Url который нужен для запроса к yandex metrica, для создания кода авторизации
 */
$url = $api->getOAuth()->getLoginUrl($redirectUrl);

/**
 * Теперь каким либо магическим образов с урл на которого редиректил нас mail,
 * мы получили код авторизации
 */
$code = '123456789';

/**
 * По коду авторизации, и url, на который мы были переадресованы, мы получаем токены доступа,
 * Внимание, код авторизации действует только 1 раз при повторном вызове запроса с тем же кодом доступа
 * мы не сможем получить токены.
 */
$accessData = $api->getOauth()->getToken($code, $redirectUrl);

$access_token = $accessData['access_token'];

$api->setTokenAccess($access_token);

/**
 * @var \YaM\Api\Counter $counter
 */
$counter = $api->getContainer('counters');

var_dump($counter->getCounter('1234567'));
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4376d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/983877e47ff9f3f39106d5af83df982cb7d1042b9bf640ce96a35b139474d874?d=identicon)[cnam](/maintainers/cnam)

---

Top Contributors

[![cnam](https://avatars.githubusercontent.com/u/1832776?v=4)](https://github.com/cnam "cnam (5 commits)")

---

Tags

yandex metrica

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cnam-yandex-metrica/health.svg)

```
[![Health](https://phpackages.com/badges/cnam-yandex-metrica/health.svg)](https://phpackages.com/packages/cnam-yandex-metrica)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
