# Yandex Videos Scraper (`searchapi/yandex-video-scraper`) Actor

Scrapes Yandex Videos for any query. Extracts the full canonical video-vertical schema: title, URL, platform, channel, duration, views, dates, thumbnail, dimensions, language, category, tags, and more.

- **URL**: https://apify.com/searchapi/yandex-video-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** Videos, Developer tools, SEO tools
- **Stats:** 2 total users, 1 monthly users, 80.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Yandex Video Scraper

Searches the public Yandex Video interface and returns normalized video cards from supported platforms such as YouTube, VK Video, Rutube, and Dzen.

### Modes

- `query`: one search phrase.
- `queries`: up to 25 search phrases in one run.
- When multiple queries are supplied, output is interleaved round-robin and constrained by both `maxItems` and `maxItemsPerQuery`.
- Pagination uses Yandex's page-number behavior and stops at `maxPages` or the requested item limit.

### Output

Every record includes a stable ID, position, query position, page, title, direct video URL, domain, platform, search context, source, and scrape timestamp. When Yandex displays them, records also include the Yandex preview URL, thumbnail and dimensions, duration and duration seconds, channel, displayed and numeric view counts, and published-date text.

The optional `country` input accepts a country code. When Apify Proxy is enabled and no proxy country is set, it selects that country for the proxy session. Video title HTML, embed URL, favicon, source dimensions, category, country, and Yandex region are included only when available from the result card or request context.

Optional fields are omitted rather than filled with nulls or empty strings. CAPTCHA, verification, error, and block pages are never stored as records. Transient Yandex request identifiers are removed from output URLs.

### Proxy guidance

Direct access can work, but Yandex may challenge datacenter IPs. On Apify, use a Residential proxy and a suitable country, commonly `RU`. The `GOOGLE_SERP` proxy group cannot be used because it supports Google Search and Google Shopping only, not Yandex.

This Actor does not solve or bypass CAPTCHAs. A challenge fails the run so consumers never receive misleading partial data.

### Local development

```sh
npm install
npm test
apify run --purge --input-file test/inputs/single.json
node validate-datasets.js
```

The Actor uses the Chrome Playwright image in Docker and the installed Chrome channel on Windows local runs. The default media optimization blocks video and font downloads but preserves page HTML, scripts, styles, and thumbnail URLs.

### Example input

```json
{
  "queries": ["machine learning", "космос"],
  "maxItems": 20,
  "maxItemsPerQuery": 10,
  "maxPages": 2,
  "language": "ru",
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "groups": ["RESIDENTIAL"],
    "countryCode": "RU"
  }
}
```

# Changelog

This Actor's version history is a separate document: https://apify.com/searchapi/yandex-video-scraper/changelog.md

# Actor input Schema

## `query` (type: `string`):

A single phrase to search. You can use this together with the batch field; duplicates are removed.

## `queries` (type: `array`):

Optional batch of up to 25 search phrases. Records are emitted round-robin so one query cannot monopolize the dataset.

## `maxItems` (type: `integer`):

Hard limit across all queries.

## `country` (type: `string`):

Country code for localized results (e.g. 'us', 'ru').

## `maxItemsPerQuery` (type: `integer`):

Per-query cap. The total records still cannot exceed Maximum total records.

## `maxPages` (type: `integer`):

Stops pagination after this many Yandex result pages for each query.

## `language` (type: `string`):

Sets the browser request language without adding an unsupported Yandex search filter.

## `region` (type: `string`):

Optional Yandex lr region identifier, for example 213 for Moscow.

## `maxConcurrency` (type: `integer`):

Maximum number of Yandex pages processed at the same time.

## `maxRequestRetries` (type: `integer`):

Retries temporary network or proxy failures. CAPTCHA responses are not retried.

## `navigationTimeoutSecs` (type: `integer`):

Maximum time allowed for a browser navigation.

## `requestHandlerTimeoutSecs` (type: `integer`):

Maximum total time allowed to process one result page.

## `blockMedia` (type: `boolean`):

Speeds up extraction while keeping HTML, scripts, styles, and thumbnail URLs available.

## `proxyConfiguration` (type: `object`):

Residential proxies are recommended when Yandex challenges a datacenter IP. GOOGLE_SERP is not compatible with Yandex.

## Actor input object example

```json
{
  "query": "machine learning",
  "queries": [],
  "maxItems": 20,
  "country": "",
  "maxItemsPerQuery": 20,
  "maxPages": 10,
  "language": "ru",
  "maxConcurrency": 2,
  "maxRequestRetries": 1,
  "navigationTimeoutSecs": 45,
  "requestHandlerTimeoutSecs": 90,
  "blockMedia": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "machine learning",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/yandex-video-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "machine learning",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/yandex-video-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "machine learning",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call searchapi/yandex-video-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,searchapi/yandex-video-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6QqP0QdcZjf6TDIzW/builds/LM0irkgP6NKDiZSRe/openapi.json
