Sync Account
curl --request POST \
--url https://api.lobstr.io/v1/accounts/cookies \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "<string>",
"cookies": {}
}
'import requests
url = "https://api.lobstr.io/v1/accounts/cookies"
payload = {
"type": "<string>",
"cookies": {}
}
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({type: '<string>', cookies: {}})
};
fetch('https://api.lobstr.io/v1/accounts/cookies', 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/accounts/cookies",
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([
'type' => '<string>',
'cookies' => [
]
]),
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/accounts/cookies"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"cookies\": {}\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/accounts/cookies")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"<string>\",\n \"cookies\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/accounts/cookies")
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 \"type\": \"<string>\",\n \"cookies\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"status_code": 123,
"status_text": "<string>"
}Account
Sync Account
Synchronize cookies for a platform account to enable authenticated scraping
POST
/
v1
/
accounts
/
cookies
Sync Account
curl --request POST \
--url https://api.lobstr.io/v1/accounts/cookies \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "<string>",
"cookies": {}
}
'import requests
url = "https://api.lobstr.io/v1/accounts/cookies"
payload = {
"type": "<string>",
"cookies": {}
}
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({type: '<string>', cookies: {}})
};
fetch('https://api.lobstr.io/v1/accounts/cookies', 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/accounts/cookies",
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([
'type' => '<string>',
'cookies' => [
]
]),
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/accounts/cookies"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"cookies\": {}\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/accounts/cookies")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"<string>\",\n \"cookies\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/accounts/cookies")
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 \"type\": \"<string>\",\n \"cookies\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"status_code": 123,
"status_text": "<string>"
}This endpoint allows you to synchronize cookies for a specific platform account type. It accepts a JSON payload containing the account type and required cookie values, and returns a task ID to track the synchronization process.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYstring
required
Must be application/json. Value:
application/jsonRequest Body
string
required
Account type identifier (e.g., twitter-sync, facebook-sync). Example:
"twitter-sync"object
required
Object containing required cookie name-value pairs. Example:
{"auth_token": "...", "ct0": "..."}Response Field Explanations
string
Synchronization task identifier. Example:
"984e0a7996aeae956793b8967cd3e122"string
Always “synchronize-cookies”. Example:
"synchronize-cookies"integer
Task status code (100 = created). Example:
100string
Human-readable status. Example:
"created"Use browser developer tools to extract cookies. Open DevTools → Application → Cookies, and copy the required cookie values.
The returned task ID can be used with the Check Sync Status endpoint to monitor synchronization progress.
Ensure cookies are fresh and valid. Expired or invalid cookies will result in synchronization failure.
Use List Account Types endpoint first to discover which cookies are required for each platform.
Code Examples
curl -X POST "https://api.lobstr.io/v1/accounts/cookies" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "twitter-sync",
"cookies": {
"auth_token": "<cookie.auth_token>",
"ct0": "<cookie.ct0>"
}
}'
import requests
import time
url = "https://api.lobstr.io/v1/accounts/cookies"
headers = {
"Authorization": "Token YOUR_API_KEY",
"Content-Type": "application/json"
}
# Synchronize Twitter cookies
payload = {
"type": "twitter-sync",
"cookies": {
"auth_token": "<cookie.auth_token>",
"ct0": "<cookie.ct0>"
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(f"Sync task created: {data['id']}")
print(f"Status: {data['status_text']}")
# Poll for completion
task_id = data['id']
while True:
status_response = requests.get(
f"https://api.lobstr.io/v1/synchronize/{task_id}",
headers=headers
)
status = status_response.json()
if status['status_code'] == 200:
print(f"\n✓ Synchronized! Account hash: {status['account_hash']}")
break
elif status['status_code'] >= 400:
print(f"\n✗ Failed: {status['status_text']}")
break
print(f"Status: {status['status_text']}...")
time.sleep(2)
Response
200
{
"id": "984e0a7996aeae956793b8967cd3e122",
"object": "synchronize-cookies",
"status_code": 100,
"status_text": "created"
}
400
{
"detail": "Invalid account type or missing required cookies."
}
401
{
"detail": "Invalid token."
}
⌘I