Retry Run Task
curl --request POST \
--url https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry', 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.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyRun
Retry Run Task
Retry a single failed or skipped task within a completed run
POST
/
v1
/
runs
/
{run_hash}
/
tasks
/
{task_hash}
/
retry
Retry Run Task
curl --request POST \
--url https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry', 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.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runs/{run_hash}/tasks/{task_hash}/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyRetry a single task from a completed run without restarting the entire run. The task is reset to
pending and the run relaunches to process it. Only one retry can be queued at a time per squid — no other run may be active.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYPath Parameters
string
required
Hash ID of the task to retry. Retrieve this from the Get Run Tasks endpoint (
data[].task).Constraints
- The run must be completed (
is_done: true). Retrying while the run is still active returnsRunInProgress. - No other run may be active for the same squid. If one is,
ClusterBusyis returned. - The run must not have already reached its
max_unique_results_per_runcap — if it has, retrying won’t scrape anything new andRunCapReachedis returned. Launch a new run instead. - A 5-minute cooldown applies between retries of the same task. Retrying too soon returns
RetryCooldown.
Code Examples
curl -X POST "https://api.lobstr.io/v1/runs/RUN_HASH/tasks/TASK_HASH/retry" \
-H "Authorization: Token YOUR_API_KEY"
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lobstr.io/v1"
headers = {"Authorization": f"Token {API_KEY}"}
run_hash = "RUN_HASH"
task_hash = "TASK_HASH"
response = requests.post(f"{BASE_URL}/runs/{run_hash}/tasks/{task_hash}/retry", headers=headers)
data = response.json()
print(f"Task status: {data['status']}")
Response
200
{
"id": "RUNTASK_HASH",
"status": "pending",
"is_done": false,
"has_errors": null,
"errors": null,
"done_reason": null,
"ended_at": null,
"params": {
"url": "https://example.com/listing/123"
}
}
Error Responses
400 RunInProgress
{
"error": "RunInProgress",
"message": "Cannot retry a task while the run is still active."
}
400 ClusterBusy
{
"error": "ClusterBusy",
"message": "Another run is currently active for this squid."
}
400 RunCapReached
{
"error": "RunCapReached",
"message": "This run already reached its max unique results limit (200); retrying won't scrape anything new. Launch a new run instead."
}
400 RetryCooldown
{
"error": "RetryCooldown",
"message": "This task was retried too recently, please wait a few minutes."
}