Python (parreq)
from parreq import Parreq
client = Parreq("pr_ВАШКЛЮЧ")
state = client.crawl_status(job_id)
print(state.status, state.pages_done, "из", state.pages_planned)import { Parreq } from "parreq-client";
const client = new Parreq({ apiKey: "pr_ВАШКЛЮЧ" });
const state = await client.crawlStatus(jobId);
console.log(state.status, state.pagesDone, "из", state.pagesPlanned);curl --request GET \
--url https://parreq.com/v1/crawl/{job_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://parreq.com/v1/crawl/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://parreq.com/v1/crawl/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://parreq.com/v1/crawl/{job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://parreq.com/v1/crawl/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"code": "invalid_request",
"message": "неверные или отсутствующие параметры: engine",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "missing_api_key",
"message": "нужен ключ: заголовок Authorization: Bearer <ключ>",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "key_revoked",
"message": "ключ отозван",
"request_id": "a83987d3c8a640d1"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"code": "rate_limited",
"message": "частота выше 30 запросов в минуту",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "search_blocked",
"message": "источник не отдал выдачу на этой попытке",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "timeout",
"message": "поисковик не ответил за 180 с",
"request_id": "a83987d3c8a640d1"
}
}Crawler
Состояние обхода
Ход задания, расход кредитов и срез пройденных страниц
GET
/
v1
/
crawl
/
{job_id}
Python (parreq)
from parreq import Parreq
client = Parreq("pr_ВАШКЛЮЧ")
state = client.crawl_status(job_id)
print(state.status, state.pages_done, "из", state.pages_planned)import { Parreq } from "parreq-client";
const client = new Parreq({ apiKey: "pr_ВАШКЛЮЧ" });
const state = await client.crawlStatus(jobId);
console.log(state.status, state.pagesDone, "из", state.pagesPlanned);curl --request GET \
--url https://parreq.com/v1/crawl/{job_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://parreq.com/v1/crawl/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://parreq.com/v1/crawl/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://parreq.com/v1/crawl/{job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://parreq.com/v1/crawl/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"code": "invalid_request",
"message": "неверные или отсутствующие параметры: engine",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "missing_api_key",
"message": "нужен ключ: заголовок Authorization: Bearer <ключ>",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "key_revoked",
"message": "ключ отозван",
"request_id": "a83987d3c8a640d1"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"code": "rate_limited",
"message": "частота выше 30 запросов в минуту",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "search_blocked",
"message": "источник не отдал выдачу на этой попытке",
"request_id": "a83987d3c8a640d1"
}
}{
"error": {
"code": "timeout",
"message": "поисковик не ответил за 180 с",
"request_id": "a83987d3c8a640d1"
}
}Authorizations
Ключ клиента: Authorization: Bearer so_…. Равнозначен заголовку X-API-Key.
Path Parameters
Query Parameters
Required range:
x >= 0Required range:
1 <= x <= 200Response
Successful Response

