Sync Account
Synchronize cookies for a platform account to enable authenticated scraping
https://api.lobstr.io/v1/accounts/cookiesThis 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
AuthorizationstringheaderrequiredYour API authentication token. Value: Token YOUR_API_KEY
Content-TypestringheaderrequiredMust be application/json. Value: application/json
Request Body
typestringrequiredAccount type identifier (e.g., twitter-sync, facebook-sync). Example: "twitter-sync"
cookiesobjectrequiredObject containing required cookie name-value pairs. Example: {"auth_token": "...", "ct0": "..."}
Response Field Explanations
idstringSynchronization task identifier. Example: "984e0a7996aeae956793b8967cd3e122"
objectstringAlways "synchronize-cookies". Example: "synchronize-cookies"
status_codeintegerTask status code (100 = created). Example: 100
status_textstringHuman-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
{ "id": "984e0a7996aeae956793b8967cd3e122", "object": "synchronize-cookies", "status_code": 100, "status_text": "created" }
{ "detail": "Invalid account type or missing required cookies." }
{ "detail": "Invalid token." }