Re-Extract from Existing Crawl
curl --request POST \
--url https://api.spidra.io/api/crawl/{jobId}/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transformInstruction": "Extract only the product price and availability status"
}
'import requests
url = "https://api.spidra.io/api/crawl/{jobId}/extract"
payload = { "transformInstruction": "Extract only the product price and availability status" }
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: 'Extract only the product price and availability status'})
};
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' => 'Extract only the product price and availability status'
]),
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\": \"Extract only the product price and availability status\"\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\": \"Extract only the product price and availability status\"\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\": \"Extract only the product price and availability status\"\n}"
response = http.request(request)
puts response.read_body{
"status": "queued",
"jobId": "661e8400-e29b-41d4-a716-446655441111",
"message": "Extraction job queued. Poll /api/crawl/661e8400-e29b-41d4-a716-446655441111 for results."
}
Crawl Endpoints
Extract from Crawl
Run a new extraction on pages from a completed crawl job without re-crawling the site
POST
/
crawl
/
{jobId}
/
extract
Re-Extract from Existing Crawl
curl --request POST \
--url https://api.spidra.io/api/crawl/{jobId}/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transformInstruction": "Extract only the product price and availability status"
}
'import requests
url = "https://api.spidra.io/api/crawl/{jobId}/extract"
payload = { "transformInstruction": "Extract only the product price and availability status" }
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: 'Extract only the product price and availability status'})
};
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' => 'Extract only the product price and availability status'
]),
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\": \"Extract only the product price and availability status\"\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\": \"Extract only the product price and availability status\"\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\": \"Extract only the product price and availability status\"\n}"
response = http.request(request)
puts response.read_body{
"status": "queued",
"jobId": "661e8400-e29b-41d4-a716-446655441111",
"message": "Extraction job queued. Poll /api/crawl/661e8400-e29b-41d4-a716-446655441111 for results."
}
This does not re-crawl the website. Spidra reads the HTML and markdown already saved from the original crawl.
Prerequisites
The source crawl job must have a
completed status before you call this endpoint. Calling /extract on a job that is still running, pending, or failed will return a 400 Bad Request.Poll GET /crawl/{jobId} and wait for "status": "completed" before proceeding.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
transformInstruction | string | Yes | The extraction prompt to apply to every page from the source crawl. Maximum 5,000 characters. |
How It Works
- Pass the
jobIdof a completed crawl job. If you ran the crawl previously, this is theidfield shown in your crawl history. - Provide a
transformInstructiondescribing what you want to extract. - Spidra loads the saved content for each page and runs your prompt against it.
- A new crawl job is created with the results, which you can poll and download the same way as any other job.
When to Use This
- You want to extract different fields from pages you already crawled
- Your first extraction prompt wasn’t quite right and you want to try again
- You need the same pages in two different formats, like JSON and CSV
Polling Results
The response returns a newjobId. Use the standard crawl endpoints to check progress and get results:
| Endpoint | Purpose |
|---|---|
GET /crawl/{jobId} | Poll job status |
GET /crawl/{jobId}/pages | Get extracted data per page |
GET /crawl/{jobId}/download | Download results as ZIP |
POST /crawl/{jobId}/retry/{pageId} | Retry a specific page |
Common Errors
| Status | Error message | Cause |
|---|---|---|
400 | Source crawl job has not completed successfully | You called /extract before the source job finished. Wait for status: "completed". |
422 | Missing required field: transformInstruction | The request body is missing the transformInstruction field. |
422 | transformInstruction must be 5000 characters or fewer | Your prompt exceeds the 5,000 character limit. |
403 | You have exceeded your monthly credit limit. | Not enough credits remaining. Check your usage at GET /usage. |
404 | Source crawl job not found | The jobId does not exist or does not belong to your account. |
Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the completed source crawl job to extract from
Body
application/json
Extraction prompt to apply to all pages from the source crawl. Maximum 5,000 characters.
Maximum string length:
5000Was this page helpful?

