Scrape
Scrape URL
Render a URL in a browser and return the page content as HTML or Markdown.
POST
/
v1
/
scrape
Scrape URL
curl --request POST \
--url https://qk.driver.dev/v1/scrape \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"url": "https://example.com",
"output": "html",
"smartdoor": {
"nodes": [
{
"type": "hosted",
"country": "US"
}
],
"timeout": 60000,
"delay": 2500,
"retryFresh": true,
"retryCount": 2,
"refreshWhile": {
"expression": "document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')",
"maxRefreshes": 3,
"minDelayMs": 700,
"maxDelayMs": 1300
}
}
}
EOFimport requests
url = "https://qk.driver.dev/v1/scrape"
payload = {
"url": "https://example.com",
"output": "html",
"smartdoor": {
"nodes": [
{
"type": "hosted",
"country": "US"
}
],
"timeout": 60000,
"delay": 2500,
"retryFresh": True,
"retryCount": 2,
"refreshWhile": {
"expression": "document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')",
"maxRefreshes": 3,
"minDelayMs": 700,
"maxDelayMs": 1300
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com',
output: 'html',
smartdoor: {
nodes: [{type: 'hosted', country: 'US'}],
timeout: 60000,
delay: 2500,
retryFresh: true,
retryCount: 2,
refreshWhile: {
expression: 'document.body?.innerText?.includes(\'ERR_CONNECTION_RESET\') || location.href.includes(\'/risk/challenge\')',
maxRefreshes: 3,
minDelayMs: 700,
maxDelayMs: 1300
}
}
})
};
fetch('https://qk.driver.dev/v1/scrape', 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://qk.driver.dev/v1/scrape",
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([
'url' => 'https://example.com',
'output' => 'html',
'smartdoor' => [
'nodes' => [
[
'type' => 'hosted',
'country' => 'US'
]
],
'timeout' => 60000,
'delay' => 2500,
'retryFresh' => true,
'retryCount' => 2,
'refreshWhile' => [
'expression' => 'document.body?.innerText?.includes(\'ERR_CONNECTION_RESET\') || location.href.includes(\'/risk/challenge\')',
'maxRefreshes' => 3,
'minDelayMs' => 700,
'maxDelayMs' => 1300
]
]
]),
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://qk.driver.dev/v1/scrape"
payload := strings.NewReader("{\n \"url\": \"https://example.com\",\n \"output\": \"html\",\n \"smartdoor\": {\n \"nodes\": [\n {\n \"type\": \"hosted\",\n \"country\": \"US\"\n }\n ],\n \"timeout\": 60000,\n \"delay\": 2500,\n \"retryFresh\": true,\n \"retryCount\": 2,\n \"refreshWhile\": {\n \"expression\": \"document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')\",\n \"maxRefreshes\": 3,\n \"minDelayMs\": 700,\n \"maxDelayMs\": 1300\n }\n }\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://qk.driver.dev/v1/scrape")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com\",\n \"output\": \"html\",\n \"smartdoor\": {\n \"nodes\": [\n {\n \"type\": \"hosted\",\n \"country\": \"US\"\n }\n ],\n \"timeout\": 60000,\n \"delay\": 2500,\n \"retryFresh\": true,\n \"retryCount\": 2,\n \"refreshWhile\": {\n \"expression\": \"document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')\",\n \"maxRefreshes\": 3,\n \"minDelayMs\": 700,\n \"maxDelayMs\": 1300\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qk.driver.dev/v1/scrape")
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 \"url\": \"https://example.com\",\n \"output\": \"html\",\n \"smartdoor\": {\n \"nodes\": [\n {\n \"type\": \"hosted\",\n \"country\": \"US\"\n }\n ],\n \"timeout\": 60000,\n \"delay\": 2500,\n \"retryFresh\": true,\n \"retryCount\": 2,\n \"refreshWhile\": {\n \"expression\": \"document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')\",\n \"maxRefreshes\": 3,\n \"minDelayMs\": 700,\n \"maxDelayMs\": 1300\n }\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"success": true,
"error": "<string>"
}"<string>"Authorizations
Your Driver API key. Get one at https://app.driver.dev
Body
application/json
Response
Successfully scraped the URL. The response body is the scraped content.
The response is of type string.
⌘I
Scrape URL
curl --request POST \
--url https://qk.driver.dev/v1/scrape \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"url": "https://example.com",
"output": "html",
"smartdoor": {
"nodes": [
{
"type": "hosted",
"country": "US"
}
],
"timeout": 60000,
"delay": 2500,
"retryFresh": true,
"retryCount": 2,
"refreshWhile": {
"expression": "document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')",
"maxRefreshes": 3,
"minDelayMs": 700,
"maxDelayMs": 1300
}
}
}
EOFimport requests
url = "https://qk.driver.dev/v1/scrape"
payload = {
"url": "https://example.com",
"output": "html",
"smartdoor": {
"nodes": [
{
"type": "hosted",
"country": "US"
}
],
"timeout": 60000,
"delay": 2500,
"retryFresh": True,
"retryCount": 2,
"refreshWhile": {
"expression": "document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')",
"maxRefreshes": 3,
"minDelayMs": 700,
"maxDelayMs": 1300
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com',
output: 'html',
smartdoor: {
nodes: [{type: 'hosted', country: 'US'}],
timeout: 60000,
delay: 2500,
retryFresh: true,
retryCount: 2,
refreshWhile: {
expression: 'document.body?.innerText?.includes(\'ERR_CONNECTION_RESET\') || location.href.includes(\'/risk/challenge\')',
maxRefreshes: 3,
minDelayMs: 700,
maxDelayMs: 1300
}
}
})
};
fetch('https://qk.driver.dev/v1/scrape', 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://qk.driver.dev/v1/scrape",
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([
'url' => 'https://example.com',
'output' => 'html',
'smartdoor' => [
'nodes' => [
[
'type' => 'hosted',
'country' => 'US'
]
],
'timeout' => 60000,
'delay' => 2500,
'retryFresh' => true,
'retryCount' => 2,
'refreshWhile' => [
'expression' => 'document.body?.innerText?.includes(\'ERR_CONNECTION_RESET\') || location.href.includes(\'/risk/challenge\')',
'maxRefreshes' => 3,
'minDelayMs' => 700,
'maxDelayMs' => 1300
]
]
]),
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://qk.driver.dev/v1/scrape"
payload := strings.NewReader("{\n \"url\": \"https://example.com\",\n \"output\": \"html\",\n \"smartdoor\": {\n \"nodes\": [\n {\n \"type\": \"hosted\",\n \"country\": \"US\"\n }\n ],\n \"timeout\": 60000,\n \"delay\": 2500,\n \"retryFresh\": true,\n \"retryCount\": 2,\n \"refreshWhile\": {\n \"expression\": \"document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')\",\n \"maxRefreshes\": 3,\n \"minDelayMs\": 700,\n \"maxDelayMs\": 1300\n }\n }\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://qk.driver.dev/v1/scrape")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com\",\n \"output\": \"html\",\n \"smartdoor\": {\n \"nodes\": [\n {\n \"type\": \"hosted\",\n \"country\": \"US\"\n }\n ],\n \"timeout\": 60000,\n \"delay\": 2500,\n \"retryFresh\": true,\n \"retryCount\": 2,\n \"refreshWhile\": {\n \"expression\": \"document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')\",\n \"maxRefreshes\": 3,\n \"minDelayMs\": 700,\n \"maxDelayMs\": 1300\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qk.driver.dev/v1/scrape")
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 \"url\": \"https://example.com\",\n \"output\": \"html\",\n \"smartdoor\": {\n \"nodes\": [\n {\n \"type\": \"hosted\",\n \"country\": \"US\"\n }\n ],\n \"timeout\": 60000,\n \"delay\": 2500,\n \"retryFresh\": true,\n \"retryCount\": 2,\n \"refreshWhile\": {\n \"expression\": \"document.body?.innerText?.includes('ERR_CONNECTION_RESET') || location.href.includes('/risk/challenge')\",\n \"maxRefreshes\": 3,\n \"minDelayMs\": 700,\n \"maxDelayMs\": 1300\n }\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"success": true,
"error": "<string>"
}"<string>"