Skip to main content

How to launch CookieRobot using Script runner in Postman

CookieRobot is your go-to tool for automating cookie collection from your chosen websites, making your browser profiles appear more authentic without manual effort. In this guide, we'll walk you through the process of launching CookieRobot using the Script Runner endpoint in Postman.

Whether you're new to automation or a seasoned user, this step-by-step tutorial will help you configure, customize, and run CookieRobot efficiently. Use the table of contents to jump to specific sections if you've already completed some steps.

Prerequisites

Before you begin, ensure you have:

  • A Postman account and the Postman desktop or web app installed.
  • Access to the Indigo X API collection in Postman.
  • Agent 1.37.4 or newer installed. Check your agent version here.
  • An API token configured in Postman. Follow the setup guide How to Set Up Indigo X API with Postman to configure authentication and obtain your Bearer Token.
Stay Updated

Ensure your Agent is version 1.37.4 or higher to use Script Runner. Outdated versions may cause compatibility issues.

Step 1: Configure Postman Authentication

To interact with the Script Runner endpoint, you need to authenticate your Postman requests using a Bearer Token. If you haven’t set this up yet, follow these steps:

  1. Complete the authentication setup outlined in How to Set Up Indigo X API with Postman, including the Configure the Bearer Token for Requests section.
  2. Save your API token in a Postman variable or copy it to your clipboard for easy access.

With authentication configured, you’re ready to access the Script Runner endpoint and run CookieRobot!

Step 2: Open Script Runner in Postman

The Script Runner endpoint allows you to execute automation scripts like CookieRobot. Here’s how to set it up:

  1. In Postman, navigate to CollectionsIndigo X API folder.

  2. Open the Script Runner folder.

  3. Select the POST Start Script Runner endpoint to configure a new API request.

    Script Runner Endpoint

  4. Go to the Params tab and select the Authorization sub-tab.

  5. Set the Auth Type to Bearer Token.

  6. Paste your API token into the Token field (use the token saved in a variable or copied earlier).

    Bearer Token Configuration

Authorization Complete

Once the Bearer Token is set, you’re fully authorized to send requests to the Script Runner endpoint and launch CookieRobot.

Step 3: Add the CookieRobot Script

CookieRobot supports all browser profile types except mobile profiles. To configure the script, you’ll need to add the CookieRobot request body in Postman.

  1. In the POST Start Script Runner endpoint, go to the Body tab.

  2. Select the raw option and ensure the format is set to JSON.

  3. Paste the following sample CookieRobot request body:

    {
    "script_file": "cookie_robot.py",
    "profile_ids": [
    {
    "profile_id": "profile uuid"
    },
    {
    "profile_id": "profile uuid",
    "is_headless": true
    }
    ],
    "script_params": [
    {
    "name": "websites",
    "value": ["https://youtube.com", "https://google.com", "https://fb.com", "https://amazon.com"]
    },
    {
    "name": "randomOrder",
    "value": true
    },
    {
    "name": "fractionMode",
    "value": 0.7
    },
    {
    "name": "processCookieConsent",
    "value": true
    }
    ]
    }

    CookieRobot Request Body

  4. Note that the script_file is pre-set to cookie_robot.py. You don’t need to modify this field.

Profile UUIDs

Replace "profile uuid" in the profile_ids section with the actual UUIDs of the browser profiles you want to use. You can find these in your Indigo dashboard or through DevTools.

Step 4: Customize CookieRobot Parameters

CookieRobot offers several customizable parameters to tailor the cookie collection process to your needs. These are defined in the script_params section of the request body. Below is an overview of the key parameters:

Key Parameters

A list of browser profiles to run CookieRobot on. Each entry includes:

  • profile_id: The unique UUID of the browser profile.
  • is_headless (optional): Set to true to run in headless mode (no visible browser window). Note that headless mode may limit interactions with certain page elements.

Example:

"profile_ids": [
{
"profile_id": "123e4567-e89b-12d3-a456-426614174000"
},
{
"profile_id": "987fcdeb-12ab-34cd-5678-426614174001",
"is_headless": true
}
]

Step 5: Run CookieRobot

With your parameters configured, it’s time to launch CookieRobot:

  1. Click the Send button in Postman to execute the POST Start Script Runner request.

  2. Check the response:

    • Status 200 OK: The script launched successfully! If running in non-headless mode, you can watch the crawling process in real-time.
    • Status 401 Unauthorized: Your token may have expired. Re-authenticate by repeating the token setup steps.
  3. CookieRobot will now collect cookies for the specified profiles and websites.

Potential Issues

Using Cloudflare Zero Trust, external proxies, or VPNs may interfere with CookieRobot’s functionality. Disable these if you encounter issues.

Troubleshooting

  • 401 Unauthorized Error: Re-authenticate and update your Bearer Token.
  • Script Fails to Run: Ensure your Agent version is 1.37.4 or higher and that profile UUIDs are correct.
  • No Cookies Collected: Verify that the websites listed are accessible and that processCookieConsent is configured appropriately.

For more help, refer to the Script Runner documentation or contact Indigo Support.