Skip to main content

Introduction

Setting custom cookies in the browser enables you to manipulate browser behavior and simulate specific user scenarios for scraping purposes. It allows you to effectively crawl web pages, protected by authentication, without the need to login during each request. The structure of a single cookie object is the following:
name - required, string
value - required, string
path - optional, string
domain - optional, string
secure - optional, boolean
httpOnly - optional, boolean
expiry - optional, unix timestamp
sameSite - optional, possible values: "Strict", "Lax", "None"
See MDN docs for more details on cookie attributes.

Setting custom cookies

You can pass custom cookies that will be added to the browser before making a request by setting field custom_cookies:
{
    "custom_cookies": [
      {
        "name": "sessionid",
        "value": "mysession123"
      },
      {
        "name": "aaabbb",
        "value": "abc123",
        "path": "/products",
        "secure": true,
        "domain": "example.com"
      }
    ]
}