cURL
curl -X POST https://api.scrapio.dev/v1/youtube/search/crawl \
-H "Authorization: Bearer $SCRAPIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"search":"machine learning tutorials","limit":500,"type":"video"}'import os, requests
resp = requests.post(
"https://api.scrapio.dev/v1/youtube/search/crawl",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
json={"search": "machine learning tutorials", "limit": 500, "type": "video"},
)
print(resp.json()["job_id"])const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({search: 'machine learning tutorials', limit: 500, type: 'video'})
};
fetch('https://api.scrapio.dev/v1/youtube/search/crawl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/youtube/search/crawl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'search' => 'machine learning tutorials',
'limit' => 500,
'type' => 'video'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scrapio.dev/v1/youtube/search/crawl"
payload := strings.NewReader("{\n \"search\": \"machine learning tutorials\",\n \"limit\": 500,\n \"type\": \"video\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrapio.dev/v1/youtube/search/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"search\": \"machine learning tutorials\",\n \"limit\": 500,\n \"type\": \"video\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/youtube/search/crawl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"search\": \"machine learning tutorials\",\n \"limit\": 500,\n \"type\": \"video\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"mode": "async",
"status": "queued",
"job_id": "<string>",
"job_type": "<string>"
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}YouTube
Queue a search crawl
Submit a large YouTube search as an async job, for result counts beyond what the synchronous search endpoint returns.
POST
/
v1
/
youtube
/
search
/
crawl
cURL
curl -X POST https://api.scrapio.dev/v1/youtube/search/crawl \
-H "Authorization: Bearer $SCRAPIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"search":"machine learning tutorials","limit":500,"type":"video"}'import os, requests
resp = requests.post(
"https://api.scrapio.dev/v1/youtube/search/crawl",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
json={"search": "machine learning tutorials", "limit": 500, "type": "video"},
)
print(resp.json()["job_id"])const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({search: 'machine learning tutorials', limit: 500, type: 'video'})
};
fetch('https://api.scrapio.dev/v1/youtube/search/crawl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/youtube/search/crawl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'search' => 'machine learning tutorials',
'limit' => 500,
'type' => 'video'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scrapio.dev/v1/youtube/search/crawl"
payload := strings.NewReader("{\n \"search\": \"machine learning tutorials\",\n \"limit\": 500,\n \"type\": \"video\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrapio.dev/v1/youtube/search/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"search\": \"machine learning tutorials\",\n \"limit\": 500,\n \"type\": \"video\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/youtube/search/crawl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"search\": \"machine learning tutorials\",\n \"limit\": 500,\n \"type\": \"video\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"mode": "async",
"status": "queued",
"job_id": "<string>",
"job_type": "<string>"
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Search query text
Minimum string length:
1Language for results
Required string length:
2 - 16Pattern:
^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$Country code for results
Required string length:
2Pattern:
^[A-Za-z]{2}$Geo location for results
Required string length:
2 - 32Type of result to search for
Available options:
video, channel, playlist, all Max number of results
Required range:
x <= 1000First result page to fetch
Required range:
x <= 9007199254740991Last result page to fetch
Required range:
x <= 9007199254740991⌘I