s37dap42x/yandex-rich-content-api

Client fo Yandex Rich Content API

Installs: 37

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/s37dap42x/yandex-rich-content-api

1.1.2 2015-11-06 08:33 UTC

This package is not auto-updated.

Last update: 2025-12-21 02:02:06 UTC


README

Client for Yandex Rich Content API

The Rich Content API provides access to the Yandex content system, containing tens of billions of pages. For any of them, you can receive the snippet, title and URL in canonical form, as well as the complete text and also a list of links to the images and videos they contain. This API is useful for services whose users exchange links. It allows them to see a preview of any web page without leaving the service.

API reference

Versioning

Package version corresponds to the version of the API.

Installation

Use composer:

composer require s37dap42x/yandex-rich-content-api

or manually add into your composer.json:

{
  "require": {
    "s37dap42x/yandex-rich-content-api": "1.1.*"
  }
}

and then use the update command: composer update

Usage

Get your own api key

use Yandex\RichContentAPI\RichContent;

$key = "rca.1.1...";
$url = "http://yandex.com";

try {
    $yandex = new RichContent($key);

    // Set optional parameters
    $yandex->setOptions(['img' => 'no', 'content' => 'full']);

    $data = $yandex->getContent($url);
    var_dump($data); // object
} catch (Exception $e) {
    echo $e->getMessage();
}

#License

MIT