Check Sync Status
curl --request GET \
--url https://api.lobstr.io/v1/synchronize/{sync_task_id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/synchronize/{sync_task_id}"
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/synchronize/{sync_task_id}', 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/synchronize/{sync_task_id}",
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/synchronize/{sync_task_id}"
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/synchronize/{sync_task_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/synchronize/{sync_task_id}")
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{
"id": "<string>",
"object": "<string>",
"status_code": 123,
"status_text": "<string>",
"account_hash": "<string>"
}Account
Check Sync Status
Monitor the synchronization status of a cookie update task
GET
/
v1
/
synchronize
/
{sync_task_id}
Check Sync Status
curl --request GET \
--url https://api.lobstr.io/v1/synchronize/{sync_task_id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/synchronize/{sync_task_id}"
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/synchronize/{sync_task_id}', 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/synchronize/{sync_task_id}",
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/synchronize/{sync_task_id}"
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/synchronize/{sync_task_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/synchronize/{sync_task_id}")
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{
"id": "<string>",
"object": "<string>",
"status_code": 123,
"status_text": "<string>",
"account_hash": "<string>"
}This endpoint checks the synchronization status of a cookie update task using its hash ID. Use this to monitor whether your account cookies have been successfully synchronized.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYPath Parameters
string
required
The synchronization task ID returned from Sync Account or Refresh Cookies. Example:
75bed0d425c4bc1912a17fe9fc4dd2a1Response Field Explanations
string
Synchronization task identifier. Example:
"75bed0d425c4bc1912a17fe9fc4dd2a1"string
Always “synchronize-cookies”. Example:
"synchronize-cookies"integer
Task status code (100=created, 120=synchronizing, 200=synchronized). Example:
200string
Human-readable status. Example:
"synchronized"string
Hash of the created/updated account. Example:
"84efd37ebd21c0f232826b7763b403d3"Poll this endpoint every few seconds after initiating a sync until status_code reaches 200 (synchronized) or an error state.
Once status_code is 200, use the returned account_hash to access the synchronized account with Get Account Details.
If synchronization remains at status_code 120 for more than 30 seconds, the cookies may be invalid. Try re-syncing with fresh cookies.
Code Examples
curl -X GET "https://api.lobstr.io/v1/synchronize/75bed0d425c4bc1912a17fe9fc4dd2a1" \
-H "Authorization: Token YOUR_API_KEY"
import requests
import time
sync_task_id = "75bed0d425c4bc1912a17fe9fc4dd2a1"
url = f"https://api.lobstr.io/v1/synchronize/{sync_task_id}"
headers = {
"Authorization": "Token YOUR_API_KEY"
}
# Poll until synchronization completes
while True:
response = requests.get(url, headers=headers)
data = response.json()
status_code = data['status_code']
status_text = data['status_text']
print(f"Status: {status_code} - {status_text}")
if status_code == 100:
print(" Task created, waiting...")
elif status_code == 120:
print(" Synchronizing cookies...")
elif status_code == 200:
print(f"\n✓ Success! Account hash: {data['account_hash']}")
break
elif status_code >= 400:
print(f"\n✗ Failed: {status_text}")
break
time.sleep(2)
Response
120
{
"id": "75bed0d425c4bc1912a17fe9fc4dd2a1",
"object": "synchronize-cookies",
"status_code": 120,
"status_text": "synchronizing",
"account_hash": "84efd37ebd21c0f232826b7763b403d3"
}
200
{
"id": "75bed0d425c4bc1912a17fe9fc4dd2a1",
"object": "synchronize-cookies",
"status_code": 200,
"status_text": "synchronized",
"account_hash": "84efd37ebd21c0f232826b7763b403d3"
}
404
{
"detail": "Synchronization task not found."
}