Cancel Job
curl --request DELETE \
--url https://api.skop.dev/scrape/{job_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.skop.dev/scrape/{job_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.skop.dev/scrape/{job_id}', 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.skop.dev/scrape/{job_id}",
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.skop.dev/scrape/{job_id}"
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.skop.dev/scrape/{job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skop.dev/scrape/{job_id}")
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{
"job_id": "<string>",
"status": "cancelled",
"message": "Job cancelled successfully",
"cancelled_at": "2023-11-07T05:31:56Z"
}{
"error": true,
"message": "<string>",
"status_code": 123,
"path": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": true,
"message": "<string>",
"status_code": 123,
"path": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}API Endpoints
Cancel Job
Cancel a running job. Only jobs with status ‘pending’ or ‘in_progress’ can be cancelled.
DELETE
/
scrape
/
{job_id}
Cancel Job
curl --request DELETE \
--url https://api.skop.dev/scrape/{job_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.skop.dev/scrape/{job_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.skop.dev/scrape/{job_id}', 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.skop.dev/scrape/{job_id}",
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.skop.dev/scrape/{job_id}"
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.skop.dev/scrape/{job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skop.dev/scrape/{job_id}")
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{
"job_id": "<string>",
"status": "cancelled",
"message": "Job cancelled successfully",
"cancelled_at": "2023-11-07T05:31:56Z"
}{
"error": true,
"message": "<string>",
"status_code": 123,
"path": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": true,
"message": "<string>",
"status_code": 123,
"path": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Cancels a running scraping job and stops further processing.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
job_id | string | Unique job identifier |
Example Request
const cancelJob = async (jobId) => {
const response = await fetch(`https://api.skop.dev/scrape/${jobId}`, {
method: 'DELETE',
headers: {
'Authorization': 'Bearer sk-your-api-key'
}
})
return await response.json()
}
Response (200 OK)
{
"message": "Job job_123456789 cancelled successfully",
"status": "cancelled"
}
Response Fields
| Field | Type | Description |
|---|---|---|
message | string | Confirmation message with job ID |
status | string | New job status (always “cancelled”) |
Error Responses
| Status | Description |
|---|---|
404 | Job not found or access denied |
500 | Internal server error |
Use Cases
- Resource Management: Cancel jobs that are taking too long
- Cost Control: Stop jobs to avoid unnecessary charges
- Queue Management: Cancel queued jobs that are no longer needed
- Error Recovery: Cancel stuck or problematic jobs
Once cancelled, a job cannot be restarted. You’ll need to create a new job if you want to retry the same scraping task.
Authorizations
API key in format 'sk-xxxxxxxxxxxxx' or 'sk_xxxxxxxxxxxxx'
Path Parameters
Unique job identifier
Pattern:
^job_[a-z0-9]+$