Skip to content
Account

Sync Account

Synchronize cookies for a platform account to enable authenticated scraping

The v1 API, for batchesSquids, tasks and runs: many calls on a schedule, delivered where you work. For one call that answers in seconds, use the API v2.
POSThttps://api.lobstr.io/v1/accounts/cookies

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

Authorizationstringheaderrequired

Your API authentication token. Value: Token YOUR_API_KEY

Content-Typestringheaderrequired

Must be application/json. Value: application/json

Request Body

typestringrequired

Account type identifier (e.g., twitter-sync, facebook-sync). Example: "twitter-sync"

cookiesobjectrequired

Object containing required cookie name-value pairs. Example: {"auth_token": "...", "ct0": "..."}

Response Field Explanations

idstring

Synchronization task identifier. Example: "984e0a7996aeae956793b8967cd3e122"

objectstring

Always "synchronize-cookies". Example: "synchronize-cookies"

status_codeinteger

Task status code (100 = created). Example: 100

status_textstring

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>"
    }
  }'

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."
}