Add Task Params
curl --request POST \
--url https://api.lobstr.io/v1/tasks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.lobstr.io/v1/tasks"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.lobstr.io/v1/tasks', 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",
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>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/tasks"
req, _ := http.NewRequest("POST", url, nil)
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")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/tasks")
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>'
response = http.request(request)
puts response.read_bodyGoogle Maps Leads Scraper
Add Task Params
Add structured search tasks using city, category, and location parameters
POST
/
v1
/
tasks
Add Task Params
curl --request POST \
--url https://api.lobstr.io/v1/tasks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.lobstr.io/v1/tasks"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.lobstr.io/v1/tasks', 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",
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>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/tasks"
req, _ := http.NewRequest("POST", url, nil)
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")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/tasks")
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>'
response = http.request(request)
puts response.read_bodyUse this format to dynamically define search inputs using structured metadata like city, category, and country. Location values can be obtained from the Get Geolocation endpoint. This method is ideal for automation and scaling across regions.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYstring
required
Request body format. Value:
application/jsonTask Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| city | string | Yes | City name with postal code (e.g., Alpine 91901) |
| category | string | Yes | Business category to search (e.g., restaurant) |
| country | string | No | Country name (e.g., United States) |
| region | string | No | State or province (e.g., California) |
| district | string | No | County or local district (e.g., San Diego) |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| squid | string | Yes | Hash of your squid configured with the google-maps-leads-scraper crawler |
| tasks | array | Yes | Array of task objects with location parameters |
Use the Get Geolocation endpoint to fetch valid values for city, region, and district.
The
city field must include the postal code (e.g., Anaheim 92801).Code Examples
curl -X POST "https://api.lobstr.io/v1/tasks" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tasks": [
{
"city": "Alpine 91901",
"category": "restaurant",
"country": "United States",
"region": "California",
"district": "San Diego"
},
{
"city": "Anaheim 92801",
"category": "restaurant",
"country": "United States"
}
],
"squid": "YOUR_SQUID_HASH"
}'
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lobstr.io/v1"
headers = {"Authorization": f"Token {API_KEY}"}
squid_id = "YOUR_SQUID_HASH"
# Add parameter-based tasks
response = requests.post(f"{BASE_URL}/tasks",
headers=headers,
json={
"squid": squid_id,
"tasks": [
{
"city": "Alpine 91901",
"category": "restaurant",
"country": "United States",
"region": "California",
"district": "San Diego"
},
{
"city": "Anaheim 92801",
"category": "restaurant",
"country": "United States"
}
]
}
)
data = response.json()
print(f"Added {len(data['tasks'])} tasks")
for task in data["tasks"]:
print(f" {task['id']}: {task['params']['city']} - {task['params']['category']}")
Response
200
{
"duplicated_count": 0,
"tasks": [
{
"id": "c3113ec3820d0253e2130b23f5b01a74",
"created_at": "2025-06-24T11:11:30.222467",
"is_active": true,
"params": {
"city": "Alpine 91901",
"category": "restaurant",
"country": "United States",
"region": "California",
"district": "San Diego"
},
"module": 5,
"object": "task"
},
{
"id": "d3deeac80b3dff7be992bb7f5d4ce63d",
"created_at": "2025-06-24T11:11:30.222613",
"is_active": true,
"params": {
"city": "Anaheim 92801",
"category": "restaurant",
"country": "United States"
},
"module": 5,
"object": "task"
}
]
}
⌘I