curl --request POST \
--url https://api.spidra.io/api/crawl/{jobId}/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"transformInstruction": "Return the book's title and whether it is in stock"
}
EOFimport requests
url = "https://api.spidra.io/api/crawl/{jobId}/extract"
payload = { "transformInstruction": "Return the book's title and whether it is in stock" }
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({transformInstruction: 'Return the book\'s title and whether it is in stock'})
};
fetch('https://api.spidra.io/api/crawl/{jobId}/extract', 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.spidra.io/api/crawl/{jobId}/extract",
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([
'transformInstruction' => 'Return the book\'s title and whether it is in stock'
]),
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.spidra.io/api/crawl/{jobId}/extract"
payload := strings.NewReader("{\n \"transformInstruction\": \"Return the book's title and whether it is in stock\"\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.spidra.io/api/crawl/{jobId}/extract")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transformInstruction\": \"Return the book's title and whether it is in stock\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/crawl/{jobId}/extract")
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 \"transformInstruction\": \"Return the book's title and whether it is in stock\"\n}"
response = http.request(request)
puts response.read_body{
"status": "queued",
"jobId": "1b4dc02b-f146-404e-9fd2-3e444f1e01cc",
"message": "Extraction job queued. Poll /api/crawl/1b4dc02b-f146-404e-9fd2-3e444f1e01cc for results."
}Extract from a crawl
Runs a new transformInstruction on every page a finished crawl saved, without visiting the site again, and returns a new jobId. Poll it with Get a crawl. The original crawl isn’t changed.
Use it to pull different data from pages you’ve already crawled. The new job shows in List crawls with source_job_id set to the original crawl.
Credits: only the AI tokens used, about 1 credit per 3,300 input tokens or 400 output tokens, rounded up. 1 credit per page is held while it runs, and the difference comes back.
Rate limits: 60 requests a minute, shared with POST /crawl and page retries. It counts toward your 5 unfinished crawls.
curl --request POST \
--url https://api.spidra.io/api/crawl/{jobId}/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"transformInstruction": "Return the book's title and whether it is in stock"
}
EOFimport requests
url = "https://api.spidra.io/api/crawl/{jobId}/extract"
payload = { "transformInstruction": "Return the book's title and whether it is in stock" }
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({transformInstruction: 'Return the book\'s title and whether it is in stock'})
};
fetch('https://api.spidra.io/api/crawl/{jobId}/extract', 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.spidra.io/api/crawl/{jobId}/extract",
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([
'transformInstruction' => 'Return the book\'s title and whether it is in stock'
]),
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.spidra.io/api/crawl/{jobId}/extract"
payload := strings.NewReader("{\n \"transformInstruction\": \"Return the book's title and whether it is in stock\"\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.spidra.io/api/crawl/{jobId}/extract")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transformInstruction\": \"Return the book's title and whether it is in stock\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/crawl/{jobId}/extract")
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 \"transformInstruction\": \"Return the book's title and whether it is in stock\"\n}"
response = http.request(request)
puts response.read_body{
"status": "queued",
"jobId": "1b4dc02b-f146-404e-9fd2-3e444f1e01cc",
"message": "Extraction job queued. Poll /api/crawl/1b4dc02b-f146-404e-9fd2-3e444f1e01cc for results."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The jobId of a completed crawl.
Body
What to extract from each page, in plain English.
5000Was this page helpful?

