cURL
curl -X POST https://api.scrapio.dev/v1/jobs \
-H "Authorization: Bearer $SCRAPIO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: my-job-001" \
-d '{"kind":"fetch","input":{"url":"https://example.com","output":["markdown"]}}'import os, requests
resp = requests.post(
"https://api.scrapio.dev/v1/jobs",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}", "Idempotency-Key": "my-job-001"},
json={"kind": "fetch", "input": {"url": "https://example.com", "output": ["markdown"]}},
)
print(resp.json()["job_id"])const resp = await fetch("https://api.scrapio.dev/v1/jobs", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "my-job-001" },
body: JSON.stringify({ kind: "fetch", input: { url: "https://example.com", output: ["markdown"] } }),
});
const { job_id } = await resp.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/jobs",
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([
'kind' => 'fetch',
'input' => [
'url' => 'https://example.com',
'render_js' => true,
'output' => [
'markdown'
]
]
]),
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/jobs"
payload := strings.NewReader("{\n \"kind\": \"fetch\",\n \"input\": {\n \"url\": \"https://example.com\",\n \"render_js\": true,\n \"output\": [\n \"markdown\"\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://api.scrapio.dev/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"fetch\",\n \"input\": {\n \"url\": \"https://example.com\",\n \"render_js\": true,\n \"output\": [\n \"markdown\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/jobs")
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 \"kind\": \"fetch\",\n \"input\": {\n \"url\": \"https://example.com\",\n \"render_js\": true,\n \"output\": [\n \"markdown\"\n ]\n }\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
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}Jobs
Create an async job
Submit any surface operation (fetch, crawl, interact, search, map) as an async job.
POST
/
v1
/
jobs
cURL
curl -X POST https://api.scrapio.dev/v1/jobs \
-H "Authorization: Bearer $SCRAPIO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: my-job-001" \
-d '{"kind":"fetch","input":{"url":"https://example.com","output":["markdown"]}}'import os, requests
resp = requests.post(
"https://api.scrapio.dev/v1/jobs",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}", "Idempotency-Key": "my-job-001"},
json={"kind": "fetch", "input": {"url": "https://example.com", "output": ["markdown"]}},
)
print(resp.json()["job_id"])const resp = await fetch("https://api.scrapio.dev/v1/jobs", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "my-job-001" },
body: JSON.stringify({ kind: "fetch", input: { url: "https://example.com", output: ["markdown"] } }),
});
const { job_id } = await resp.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/jobs",
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([
'kind' => 'fetch',
'input' => [
'url' => 'https://example.com',
'render_js' => true,
'output' => [
'markdown'
]
]
]),
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/jobs"
payload := strings.NewReader("{\n \"kind\": \"fetch\",\n \"input\": {\n \"url\": \"https://example.com\",\n \"render_js\": true,\n \"output\": [\n \"markdown\"\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://api.scrapio.dev/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"fetch\",\n \"input\": {\n \"url\": \"https://example.com\",\n \"render_js\": true,\n \"output\": [\n \"markdown\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/jobs")
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 \"kind\": \"fetch\",\n \"input\": {\n \"url\": \"https://example.com\",\n \"render_js\": true,\n \"output\": [\n \"markdown\"\n ]\n }\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
}
}{
"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
⌘I