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.
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:
- Complete the authentication setup outlined in How to Set Up Indigo X API with Postman, including the Configure the Bearer Token for Requests section.
- 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:
-
In Postman, navigate to Collections → Indigo X API folder.
-
Open the Script Runner folder.
-
Select the POST Start Script Runner endpoint to configure a new API request.
-
Go to the Params tab and select the Authorization sub-tab.
-
Set the Auth Type to Bearer Token.
-
Paste your API token into the Token field (use the token saved in a variable or copied earlier).
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.
-
In the POST Start Script Runner endpoint, go to the Body tab.
-
Select the raw option and ensure the format is set to JSON.
-
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
}
]
} -
Note that the
script_file
is pre-set tocookie_robot.py
. You don’t need to modify this field.
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
- profile_ids
- websites
- randomOrder
- fractionMode
- processCookieConsent
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 totrue
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
}
]
A list of URLs to collect cookies from. You can include URLs with or without www.
, http://
, or https://
.
Default List (used if no websites are specified):
[
"https://aliexpress.com",
"https://amazon.com",
"https://ebay.com",
"https://fiverr.com",
"https://google.com",
"https://reddit.com",
"https://twitch.com",
"https://twitter.com",
"https://yahoo.com",
"https://youtube.com",
"https://en.wikipedia.org"
]
Example:
{
"name": "websites",
"value": ["https://youtube.com", "https://google.com", "https://fb.com"]
}
Collect cookies from multiple websites to create a more realistic browser fingerprint. Check out our Collecting Cookies: Tips guide for best practices.
Controls the order in which websites are visited:
true
: Visit websites in random order.false
: Visit websites in the order listed.
Example:
{
"name": "randomOrder",
"value": true
}
Specifies the portion of the website list to process (requires randomOrder
to be true
):
- Value: A float between
0.0
and1.0
. - Example:
"fractionMode": 0.5
processes 50% of the websites in random order.
Example:
{
"name": "fractionMode",
"value": 0.7
}
Handles cookie consent pop-ups (e.g., GDPR banners):
true
: Automatically detects and clicks the "Allow Cookies" button (default).false
: Ignores cookie consent pop-ups, useful for non-EU websites or when GDPR compliance isn’t a concern.
Example:
{
"name": "processCookieConsent",
"value": true
}
Set processCookieConsent
to false
if you’re using proxies outside the EU or targeting websites without cookie banners.
Step 5: Run CookieRobot
With your parameters configured, it’s time to launch CookieRobot:
-
Click the Send button in Postman to execute the POST Start Script Runner request.
-
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.
-
CookieRobot will now collect cookies for the specified profiles and websites.
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.