Api contains two methods: get languages (getLangs) and lookup.
To use it you need api key. You can get it here:
https://tech.yandex.ru/dictionary/
composer require bog/yandex-dictionary-api
Create object with Api Key as parameter.
$dictionary = new Dictionary('apiKey');
You can get respose as JSON (default) or XML.
Output examples for both types:
https://tech.yandex.ru/dictionary/doc/dg/reference/getLangs-docpage/
https://tech.yandex.ru/dictionary/doc/dg/reference/lookup-docpage/
// JSON output (default)
$dictionary->setType(Dictionary::TYPE_JSON);
// XML output
$dictionary->setType(Dictionary::TYPE_XML);
$langs = $dictionary->getLangs();
Set languages ('en-ru' is default):
$dictionary->setTranslateFrom('en');
$dictionary->setTranslateTo('ru');
Lookup:
$translation = $dictionary->lookup('hello');