Yandex
There are two approaches to retrieving data from Yandex using our SERP Scraper API. You can give us a full URL or pass parameters via the specifically built data source - Search.
Below is a quick overview of all the available data
source
values we support with Yandex.Source | Description | Structured data |
---|---|---|
yandex | Submit any Yandex URL you like. | No. |
yandex_search | Yandex SERPs. | No. |
Although we do not have dedicated parsers for Yandex, you can write your own parsing instructions with Custom Parser feature and get structured data.
You can jump to your preferred Yandex page type by selecting its name on the right hand side menu. Each page contains the parameter table as well as code examples to help you get started with your query.
The
yandex
source is designed to retrieve content of direct URLs of various Yandex pages. Instead of sending multiple parameters, you can provide us with a direct URL required for Yandex page. We do not strip any parameters or alter your URLs in any other way.Parameter | Description | Default Value |
---|---|---|
source | yandex | |
url | Direct URL (link) to Yandex page | - |
user_agent_type | desktop | |
render | | |
callback_url | - |
- required parameter
In the example below, we make a request to retrieve a result for a URL.
JSON
cURL
Python
PHP
HTTP
{
"source": "yandex",
"url": "https://yandex.com/search/?text=nike&"
}
curl --user "user:pass1" 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json" -d '{"source": "yandex", "url": "https://yandex.com/search/?text=nike&"}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'yandex',
'url': 'https://yandex.com/search/?text=nike&'
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Instead of response with job status and results url, this will return the
# JSON response with results.
pprint(response.json())
<?php
$params = array(
'source' => 'yandex',
'url' => 'https://yandex.com/search/?text=nike&'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://data.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>
# URL has to be encoded to escape `&` and `=` characters:
# URL: https://yandex.com/search/?text=nike&
# Encoded URL: https%3A%2F%2Fyandex.com%2Fsearch%2F%3Ftext%3Dnike%26
https://realtime.oxylabs.io/v1/queries?source=google&url=https%3A%2F%2Fyandex.com%2Fsearch%2F%3Ftext%3Dnike%26&access_token=12345abcde
The example above uses the Realtime integration method. If you would like to use some other integration method in your query (e.g. Push-Pull or Proxy Endpoint), refer to the integration methods section.
The
yandex_search
source is designed to retrieve Yandex Search results (SERP).Parameter | Description | Default Value |
---|---|---|
source | yandex_search | |
domain | Domain localization. Available domains: com , ru , ua , by , kz , tr | com |
query | UTF-encoded keyword | - |
start_page | Starting page number | 1 |
pages | Number of pages to retrieve | 1 |
limit | Number of results to retrieve in each page | 10 |
locale | Language. Available languages: en , ru , by , fr , de , id , kk , tt , tr , uk . | - |
geo_location | Geographical location in Yandex rstr format. | - |
user_agent_type | desktop | |
callback_url | - |
- required parameter
In the example below, we make a request to retrieve Yandex SERPs from the number
11
to 20
for the keyword adidas
.JSON
cURL
Python
PHP
HTTP
{
"source": "yandex_search",
"query": "adidas",
"start_page": 11,
"pages": 10
}
curl --user "user:pass1" 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json" -d '{"source": "yandex_search", "domain": "com", "query": "adidas", "start_page": 11, "pages": 10}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'yandex_search',
'domain': 'com',
'query': 'adidas',
'start_page': 11,
'pages': 10
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
<?php
$params = array(
'source' => 'yandex_search',
'domain' => 'com',
'query' => 'adidas',
'start_page' => 11,
'pages' => 10
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
https://realtime.oxylabs.io/v1/queries?source=yandex_search&domain=com&query=adidas&start_page=11&pages=10&access_token=12345abcde
The example above uses the Realtime integration method. If you would like to use some other integration method in your query (e.g. Push-Pull or Proxy Endpoint), refer to the integration methods section.
Last modified 3mo ago