Upload Tasks
curl --request POST \
--url https://api.lobstr.io/v1/tasks/upload \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"squid": "<string>"
}
'import requests
url = "https://api.lobstr.io/v1/tasks/upload"
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/tasks/upload', 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/tasks/upload",
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/tasks/upload"
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/tasks/upload")
.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/tasks/upload")
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>"
}Task
Upload Tasks
Upload a CSV/TSV file containing multiple tasks for a squid
POST
/
v1
/
tasks
/
upload
Upload Tasks
curl --request POST \
--url https://api.lobstr.io/v1/tasks/upload \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"squid": "<string>"
}
'import requests
url = "https://api.lobstr.io/v1/tasks/upload"
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/tasks/upload', 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/tasks/upload",
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/tasks/upload"
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/tasks/upload")
.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/tasks/upload")
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>"
}This endpoint allows you to upload a file (CSV/TSV) containing multiple tasks for a specific squid. The file should contain task parameters in columns matching the crawler’s expected keys. This is ideal for bulk task creation.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYstring
required
Must be multipart/form-data for file upload. Value:
multipart/form-dataForm Data Parameters
file
required
CSV or TSV file containing task data. Column headers should match crawler parameter keys. Example:
tasks.csvstring
required
The hash ID of the squid to add tasks to. Example:
"a1b2c3d4e5f6g7h8i9j0"Response Field Explanations
string
Upload task identifier for tracking progress. Example:
"427a7bfc54cf4ce483d83ba23425164b"string
Always “task_upload”. Example:
"task_upload"Use the returned task ID with Check Upload Status to monitor the upload progress.
CSV column headers must match the crawler’s expected parameter keys (e.g., ‘url’, ‘city’, ‘activity’).
Large files may take time to process. Always check upload status before running the squid.
TSV (tab-separated) files are also supported and may be easier to work with for URLs containing commas.
Code Examples
curl -X POST "https://api.lobstr.io/v1/tasks/upload" \
-H "Authorization: Token YOUR_API_KEY" \
-F "file=@tasks.csv" \
-F "squid=a1b2c3d4e5f6g7h8i9j0"
import requests
url = "https://api.lobstr.io/v1/tasks/upload"
headers = {
"Authorization": "Token YOUR_API_KEY"
}
# Prepare file upload
with open("tasks.csv", "rb") as f:
files = {"file": ("tasks.csv", f, "text/csv")}
data = {"squid": "a1b2c3d4e5f6g7h8i9j0"}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
upload_task_id = result['id']
print(f"Upload started with ID: {upload_task_id}")
print("Use Check Upload Status endpoint to monitor progress")
Response
200
{
"id": "427a7bfc54cf4ce483d83ba23425164b",
"object": "task_upload"
}