Get Run Tasks
curl --request GET \
--url https://api.lobstr.io/v1/runtasks \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/runtasks"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/runtasks', 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/runtasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/runtasks"
req, _ := http.NewRequest("GET", 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.get("https://api.lobstr.io/v1/runtasks")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runtasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"total_results": 123,
"data": [
{}
],
"data[].id": "<string>",
"data[].object": "<string>",
"data[].task": "<string>",
"data[].run": "<string>",
"data[].status": "<string>",
"data[].params": {},
"data[].started_at": "<string>",
"data[].ended_at": "<string>",
"data[].total_results": 123,
"data[].last_result": 123,
"data[].total_pages": 123,
"data[].done_reason": "<string>"
}Run
Get Run Tasks
Retrieve a list of all tasks executed within a specific run
GET
/
v1
/
runtasks
Get Run Tasks
curl --request GET \
--url https://api.lobstr.io/v1/runtasks \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/runtasks"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/runtasks', 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/runtasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/runtasks"
req, _ := http.NewRequest("GET", 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.get("https://api.lobstr.io/v1/runtasks")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runtasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"total_results": 123,
"data": [
{}
],
"data[].id": "<string>",
"data[].object": "<string>",
"data[].task": "<string>",
"data[].run": "<string>",
"data[].status": "<string>",
"data[].params": {},
"data[].started_at": "<string>",
"data[].ended_at": "<string>",
"data[].total_results": 123,
"data[].last_result": 123,
"data[].total_pages": 123,
"data[].done_reason": "<string>"
}This endpoint retrieves a paginated list of all tasks executed within a specific run, including their individual status, results, and parameters.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| run | string | Yes | The run hash ID to get tasks for |
| page | integer | No | Page number for pagination. Default: 1 |
| limit | integer | No | Results per page. Default: 50, Max: 100 |
Response Field Explanations
integer
Total number of run tasks. Example:
1array
Array of run task objects. Example:
[...]string
Unique run task identifier. Example:
"1262f6f99dac7dffb05a513fff0ded77"string
Always “runtask”. Example:
"runtask"string
Original task identifier. Example:
"d30334cd8d21ab16048c5e2e7136a9f1"string
Parent run identifier. Example:
"300e9c5c127d421c90f431478d9a2cfb"string
Task execution status (completed, aborted, error, etc.). Example:
"aborted"object
Task parameters. Example:
{"url": "https://..."}string
When task execution started. Example:
"2025-02-10T14:30:58Z"string
When task execution ended. Example:
"2025-02-10T14:31:10Z"integer
Total results expected from this task. Example:
138integer
Number of results actually collected. Example:
6integer
Total pages processed. Example:
1string
Reason for task completion. Example:
"run_aborted"Use this endpoint to debug which specific tasks failed or were incomplete in a run.
The done_reason field on individual tasks can differ from the overall run’s done_reason.
Compare total_results vs last_result to see if a task collected all expected data.
Code Examples
curl -X GET "https://api.lobstr.io/v1/runtasks?run=300e9c5c127d421c90f431478d9a2cfb&page=1&limit=50" \
-H "Authorization: Token YOUR_API_KEY"
import requests
url = "https://api.lobstr.io/v1/runtasks"
headers = {
"Authorization": "Token YOUR_API_KEY"
}
params = {
"run": "300e9c5c127d421c90f431478d9a2cfb",
"page": 1,
"limit": 50
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(f"Total tasks in run: {data['total_results']}\n")
for task in data['data']:
status_icon = "✓" if task['status'] == "completed" else "✗"
print(f"{status_icon} Task: {task['id']}")
print(f" Status: {task['status']}")
print(f" Results: {task['last_result']}/{task['total_results']}")
print(f" Done Reason: {task['done_reason']}")
print(f" Params: {task['params']}")
print()
Response
200
{
"total_results": 1,
"limit": 50,
"page": 1,
"total_pages": 1,
"result_from": 1,
"result_to": 1,
"data": [
{
"object": "runtask",
"id": "1262f6f99dac7dffb05a513fff0ded77",
"started_at": "2025-02-10T14:30:58Z",
"ended_at": "2025-02-10T14:31:10Z",
"total_results": 138,
"last_result": 6,
"total_pages": 1,
"done_reason": "run_aborted",
"last_page": 0,
"status": "aborted",
"run": "300e9c5c127d421c90f431478d9a2cfb",
"task": "d30334cd8d21ab16048c5e2e7136a9f1",
"params": {
"url": "https://www.google.com/maps/search/restaurant/@43.2928346,5.3662584,17z"
},
"last_collection_at": "2025-02-10T14:31:10Z",
"done_reason_desc": null
}
],
"next": null,
"previous": null
}