Cancel Crawl Job
curl --request DELETE \
--url https://api.spidra.io/api/crawl/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spidra.io/api/crawl/{jobId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spidra.io/api/crawl/{jobId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spidra.io/api/crawl/{jobId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.spidra.io/api/crawl/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/crawl/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "cancelled",
"jobId": "f3c2a1b0-4d5e-6f7a-8b9c-0d1e2f3a4b5c"
}{
"status": "error",
"message": "Cannot cancel a job with status: completed"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Crawl Endpoints
Cancel Crawl Job
Stop a crawl job that is queued or actively running. Pages already processed are kept.
DELETE
/
crawl
/
{jobId}
Cancel Crawl Job
curl --request DELETE \
--url https://api.spidra.io/api/crawl/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spidra.io/api/crawl/{jobId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spidra.io/api/crawl/{jobId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spidra.io/api/crawl/{jobId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.spidra.io/api/crawl/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/crawl/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "cancelled",
"jobId": "f3c2a1b0-4d5e-6f7a-8b9c-0d1e2f3a4b5c"
}{
"status": "error",
"message": "Cannot cancel a job with status: completed"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Stops a crawl job that is queued or currently running. Pages that were already processed before the cancellation are preserved — you can still retrieve them with GET /crawl//pages. The job status moves to
Only pages with
cancelled.
Cancelling a job that has already reached a terminal state (completed, failed, or cancelled) returns a 400.
Example Request
curl -X DELETE https://api.spidra.io/api/crawl/abc-123 \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
requests.delete(
"https://api.spidra.io/api/crawl/abc-123",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
await fetch("https://api.spidra.io/api/crawl/abc-123", {
method: "DELETE",
headers: { Authorization: "Bearer YOUR_API_KEY" }
});
Response
{
"status": "cancelled",
"jobId": "abc-123"
}
Retrieving Partial Results
After cancelling, call GET /crawl//pages to retrieve any pages that completed before the job was stopped.curl https://api.spidra.io/api/crawl/abc-123/pages \
-H "Authorization: Bearer YOUR_API_KEY"
status: "success" will have data. Any pages that were mid-flight when the job was cancelled will not appear.Was this page helpful?

