Start Run
curl --request POST \
--url https://api.lobstr.io/v1/runs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"squid": "<string>"
}
'import requests
url = "https://api.lobstr.io/v1/runs"
payload = { "squid": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({squid: '<string>'})
};
fetch('https://api.lobstr.io/v1/runs', 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",
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([
'squid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lobstr.io/v1/runs"
payload := strings.NewReader("{\n \"squid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"squid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"squid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"squid": "<string>",
"status": "<string>",
"is_done": true,
"started_at": "<string>",
"origin": "<string>"
}Run
Start Run
Initiate a new run for a specified squid
POST
/
v1
/
runs
Start Run
curl --request POST \
--url https://api.lobstr.io/v1/runs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"squid": "<string>"
}
'import requests
url = "https://api.lobstr.io/v1/runs"
payload = { "squid": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({squid: '<string>'})
};
fetch('https://api.lobstr.io/v1/runs', 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",
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([
'squid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lobstr.io/v1/runs"
payload := strings.NewReader("{\n \"squid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"squid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"squid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"squid": "<string>",
"status": "<string>",
"is_done": true,
"started_at": "<string>",
"origin": "<string>"
}This endpoint initiates a new run for a specified squid, starting the scraping process for all active tasks within that squid.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYstring
required
Must be application/json. Value:
application/jsonRequest Body
string
required
The hash ID of the squid to run. Example:
"b6c56d18cb0046949461ba9ca278e8ad"Response Field Explanations
string
Unique identifier of the new run. Example:
"dd3473abe4cb41b683551e851edded94"string
Always “run”. Example:
"run"string
The squid being executed. Example:
"b6c56d18cb0046949461ba9ca278e8ad"string
Initial run status (typically “pending”). Example:
"pending"boolean
Whether the run has completed (false for new runs). Example:
falsestring
Run start timestamp. Example:
"2025-02-10T14:27:45Z"string
Origin of the run (“user” for API-initiated runs). Example:
"user"Save the returned run ID to track progress using Get Run or Get Run Stats endpoints.
Ensure your squid has active tasks before starting a run, or the run will complete immediately with no results.
Only one run can be active per squid at a time. Starting a new run while one is active will return an error.
For crawlers requiring accounts (e.g., LinkedIn, Facebook), ensure you have synced accounts before starting a run.
Code Examples
curl -X POST "https://api.lobstr.io/v1/runs" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"squid": "b6c56d18cb0046949461ba9ca278e8ad"
}'
import requests
url = "https://api.lobstr.io/v1/runs"
headers = {
"Authorization": "Token YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"squid": "b6c56d18cb0046949461ba9ca278e8ad"
}
response = requests.post(url, headers=headers, json=payload)
run = response.json()
print(f"Run started successfully!")
print(f"Run ID: {run['id']}")
print(f"Status: {run['status']}")
print(f"Started at: {run['started_at']}")
# Save run ID for tracking progress
run_id = run['id']
print(f"\nUse run ID '{run_id}' to track progress with Get Run Stats endpoint")
Response
200
{
"id": "dd3473abe4cb41b683551e851edded94",
"object": "run",
"squid": "b6c56d18cb0046949461ba9ca278e8ad",
"is_done": false,
"started_at": "2025-02-10T14:27:45Z",
"total_results": 0,
"total_unique_results": 0,
"next_launch_at": null,
"ended_at": null,
"duration": 0,
"credit_used": 0,
"origin": "user",
"force_launch": false,
"status": "pending",
"export_done": null,
"export_count": 0,
"export_time": null,
"email_done": null,
"email_time": null,
"created_at": "2025-02-10T14:27:45Z",
"done_reason": null,
"done_reason_desc": null
}
400
{
"error": {
"message": "A run is already active for this squid",
"type": "validation_error",
"param": "squid"
}
}
⌘I