# Rutube API

> Returns Rutube video details, HLS stream playlists, channel videos, comments and the video categories.

Category: Social & Video. Region: RU. 5 endpoints at `https://api.hoshime.com/v1/rutube/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/rutube
## GET /v1/rutube/video

A public Rutube video by its URL or id: title, description, duration, views, channel and dates.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Rutube video URL (https://rutube.ru/video/<id>/) or the 32-character video id. (e.g. https://rutube.ru/video/2239a49871ae52770b4fd7093c46bb7f/) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `createdAt` (string), `description` (string), `durationSeconds` (integer (int64)), `embedUrl` (string), `id` (string), `isAdult` (boolean), `isLive` (boolean), `likeCount` (integer (int64)), `publishedAt` (string), `thumbnails` (Image[]), `thumbnails[].height` (any), `thumbnails[].url` (string), `thumbnails[].width` (any), `title` (string), `url` (string), `viewCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/rutube/video?url=https%3A%2F%2Frutube.ru%2Fvideo%2F2239a49871ae52770b4fd7093c46bb7f%2F" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rutube/streams

The HLS playlist of a public Rutube video and its renditions, from the highest to the lowest resolution.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Rutube video URL (https://rutube.ru/video/<id>/) or the 32-character video id. (e.g. https://rutube.ru/video/2239a49871ae52770b4fd7093c46bb7f/) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `hlsUrl` (string), `id` (string), `variants` (Variant[]), `variants[].bandwidth` (integer (int64)), `variants[].height` (integer (int64)), `variants[].url` (string), `variants[].width` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/rutube/streams?url=https%3A%2F%2Frutube.ru%2Fvideo%2F2239a49871ae52770b4fd7093c46bb7f%2F" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rutube/channelVideos

The public videos of one Rutube channel, newest first, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Numeric channel id, or the rutube.ru/video/person/<id>/ URL. (e.g. 23577112) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `createdAt` (string), `description` (string), `durationSeconds` (integer (int64)), `embedUrl` (string), `id` (string), `isAdult` (boolean), `isLive` (boolean), `likeCount` (integer (int64)), `publishedAt` (string), `thumbnails` (Image[]), `thumbnails[].height` (any), `thumbnails[].url` (string), `thumbnails[].width` (any), `title` (string), `url` (string), `viewCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/rutube/channelVideos?id=23577112" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rutube/comments

Comments on one public Rutube video, 20 per page, in the order Rutube shows them.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Video id or rutube.ru video URL. (e.g. 2239a49871ae52770b4fd7093c46bb7f) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `createdAt` (string), `id` (string), `likeCount` (integer (int64)), `parentId` (string), `replyCount` (integer (int64)), `text` (string)

```bash
curl "https://api.hoshime.com/v1/rutube/comments?id=2239a49871ae52770b4fd7093c46bb7f" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rutube/categories

The video categories Rutube sorts its catalog into.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string), `shortName` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/rutube/categories" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
