PHPackages                             sadonsergey/yc-ml-translate - 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. [API Development](/categories/api)
4. /
5. sadonsergey/yc-ml-translate

ActiveLibrary[API Development](/categories/api)

sadonsergey/yc-ml-translate
===========================

Yandex ML Translate for Yandex Cloud (AI API)

1.0.3(5y ago)0461[1 PRs](https://github.com/sadonsergey/yc-ml-translate/pulls)MITPHPPHP ^7.2.5CI failing

Since Jul 12Pushed 1y agoCompare

[ Source](https://github.com/sadonsergey/yc-ml-translate)[ Packagist](https://packagist.org/packages/sadonsergey/yc-ml-translate)[ Docs](https://github.com/sadonsergey/yc-ml-translate)[ RSS](/packages/sadonsergey-yc-ml-translate/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

Yandex ML Translate for Yandex Cloud (AI API)
=============================================

[](#yandex-ml-translate-for-yandex-cloud-ai-api)

- [API Documentation](https://cloud.yandex.ru/docs/translate/api-ref/)
- [Get API keys](https://cloud.yandex.ru/docs/translate/api-ref/authentication)

Installation
------------

[](#installation)

```
composer require "sadonsergey/yc-ml-translate"
```

Usage
-----

[](#usage)

- You must use one of two tokens, if an OAuth token is used then we will exchange it for an IAM token. However, we will have to do this every time we request a transfer, we recommend using the IAM token.
- You can get an IAM token yourself [here](https://cloud.yandex.ru/docs/iam/operations/iam-token/create)
- $OAuthToken is optional if there is a $ IAMToken.
- $folderId is required. The ID of the directory to which you have access. Required for authorization with a user account (see UserAccount resource). Do not use this field if you are making a request on behalf of a service account.

> The lifetime of an IAM token is no more than 12 hours, but it is recommended to request it more often, for example, every hour.

```
$yandexTranslate = new ssadon\YandexTranslate($OAuthToken, $IAMToken, $folderId);

//Translating text
$text = $yandexTranslate->translate('en', 'ru', 'cat');
echo $text['text']; //кошка

//You can use multiple translation
$text = $yandexTranslate->translate('en', 'ru', ['cat', 'dog']);
echo $text[0]['text']; //кошка
echo $text[1]['text']; //собака

//Detecting language
$detect = $yandexTranslate->detectLanguage('English text');
echo $detect; //en
```

> You can also see how this works on the basis of tests. Do not forget to start them before you start working.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~0 days

Total

4

Last Release

2132d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11750848?v=4)[Sergey Sadon](/maintainers/sadonsergey)[@sadonsergey](https://github.com/sadonsergey)

---

Top Contributors

[![sadonsergey](https://avatars.githubusercontent.com/u/11750848?v=4)](https://github.com/sadonsergey "sadonsergey (6 commits)")

---

Tags

googletranslateyandexapitranslatecloudaiyandexmllearningmachine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sadonsergey-yc-ml-translate/health.svg)

```
[![Health](https://phpackages.com/badges/sadonsergey-yc-ml-translate/health.svg)](https://phpackages.com/packages/sadonsergey-yc-ml-translate)
```

###  Alternatives

[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

632.3k](/packages/rubix-server)[sabatinomasala/replicate-php

PHP client for the Replicate API

3743.6k](/packages/sabatinomasala-replicate-php)

PHPackages © 2026

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