API
Introduction
With the API v1.5 in Undetectable, you will be able to get a list of profiles, create, launch, update, and close them. Additionally, with the obtained information, you can connect various automation tools such as Puppeteer, Playwright, and others to profiles on the Chromium core.
You can download Chromedriver for working with Selenium here:
Windows
MacOS M series
MacOS Intel
The program must be running to work with the API.
By default, the local server runs on port 25325. If this port is occupied, it will start on another port. You can check the port in the program settings and change it if necessary.
To access the local server, use the IP 127.0.0.1, localhost, or the local IP within your network, and the port from the settings plus the path you want to execute, for example, http://localhost:25325/status
.
All API responses look like:
{"code": `<status code>`,"status": `<status>`,"data": `<return object>`,}
where <status code>
and <status>
reflect the status:
<status code> | <status> | Description |
---|---|---|
0 | ”success” | success |
1 | ”error” | error, <return object> = {“error”:“error description”} |
<return object>
- various data sent by the API, for example, a list of profiles.
Errors have the following format:
{ "code":1, "status":"error", "data": {"error": "error description"},}
Requests
Status
- Path:
/status
- Method: GET
Description: Returns the status of the local server, whether it is running or not.
{ "code":0, "status":"success", "data":{},}
List of Profiles
- Path:
/list
- Method: GET
Description: Returns a list of profiles available in the program on the Chromium browser.
{ "code": 0, "status": "success", "data" { "profile_id1": { "name": "Profile1", // Profile name in the program "status": "Available", // Profile status, can be: "Started", "Locked", "Available" "debug_port": "xxxx", // browser debug port used for automation (empty if the profile is not running). Only for Chromium browser "websocket_link": "ws://127.0.0.1:xxxx/devtools/browser/xxxxxx", // browser link used for automation (empty if the profile is not running). Only for Chromium browser "folder": "Name", // Profile folder name "tags": ["tag1", "tag2", "tag3"], // Profile tags "cloud_id": "", // Cloud profile ID "creation_date": 123456789, // Creation date Unix Timestamp "modify_date": 123456789, // Modification date Unix Timestamp }, "profile_id2": { …}, … },}
Create Profile
- Path:
/profile/create
- Method: POST
Description: Creates a profile with the selected parameters. All parameters are optional and may not be present. The list of browsers for the command: Chrome, Edge, FireFox, IE, Opera, Safari, Yandex. The list of OS for the command: Windows, Windows 7, Windows 8, Windows 8.1, Windows 10, Android, iPhone, iPad, Linux, Mac. If there are no configurations with the selected OS or Browser, a random OS or Browser type will be used.
Format: JSON
{ "name": "profile with random settings", // Profile name in the program "os": "Windows", // Configuration with which OS to use "browser": "Chrome", // Configuration with which browser to use "cpu": 8, // Number of cores, possible values: 32, 24, 20, 16, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0 "memory": 8, // Amount of memory, possible values: 8, 4, 2, 1, 0 "tags": ["tag1", "tag2"], // Set tags on the profile "geolocation": "12.44, 13.524", // Set geolocation, if you enter an empty or incorrect value, the default settings will be used "resolution": "1024x768", // Screen resolution, possible values: "800x600", "960x540", "1024x768", "1152x864", "1280x720", "1280x768", "1280x800", "1280x1024", "1366x768", "1408x792", "1440x900", "1400x1050", "1440x1080", "1536x864", "1600x900", "1600x1024", "1600x1200", "1680x1050", "1920x1080", "1920x1200", "2048x1152", "2560x1080", "2560x1440", "3440x1440", "3840x2160", "5120x1440" "proxy": "socks5://127.0.0.1:5555:login:pass", // Change the proxy in the profile (proxies can be http, https, socks5, there may be options with and without login/password). You can use proxy ID too. "notes": "Text", // Change the notes in the profile "folder": "testFolder", // In which folder the profile will be "language": "ru-RU, en-US", // You can set 2 languages "cookies": [{}], // Import cookies into the profile "type": "cloud", // Profile type: cloud, local "group": "group_example", // If there is no entered group, it takes from the default settings, if there is and it is incorrect, an error is displayed "configid": "id", // Config ID, if entered, then the OS and Browser parameters are ignored, other parameters if possible, for example, if the config is for Android, the screen resolution will not change "accounts": [ // Import accounts from different sites into the profile {"website": "facebook.com", "username": "test@gmail.com", "password": "123456"}, {"website": "mail.com","username": "test@gmail.com","password": "123456"} ], "timezone": "Pacific/Niue" ("Auto", "System") // set timezone or timezone mode}
{ "code": 0, "status": "success", "data": { "profile_id": "xxxxxxxx...", // Unique profile ID "name": "profile with random settings" // Profile name in the program }}
Starting a profile
- Path:
/profile/start/<profileID>
- Method: GET
Description: Starts the profile with the selected <profileID>
. You can add parameters to the link:
- chrome_flags and pass any launch flags you want, just encode them in URL encoding, for example: ?chrome_flags=—blink-settings%3DimagesEnabled%3Dfalse%20—disable-webgl2
- start-pages and specify the start pages, just encode them in URL encoding, for example: ?start-pages=https%3A%2F%2Fgoogle.com%2Chttps%3A%2F%2Fya.ru
{ "code":0, "status":"success", "data":{ "name": "Profile1" // Profile name in the program "websocket_link":"ws://127.0.0.1:xxxx/devtools/browser/xxxxxx", // link to the browser, used for automation (empty value if the profile is not running). Only for Chromium browser "debug_port": "xxxx", // Chromium browser debug port, used for automation (empty value if the profile is not running). Only for Chromium browser "folder": "Name", // Profile folder name "tags": ["tag1", "tag2", "tag3"] // Profile tags },}
Closing a profile
- Path:
/profile/stop/<profileID>
- Method: GET
Description: Stops the profile with the selected <profileID>
{ "code": 0, "status": "success", "data": {}}
Profile Update
- Path:
/profile/update/<profileID>
- Method: POST
Description: Updates the information in the profile with the specified <profileID>
. All parameters are optional and may not be present.
Format: JSON
{ "proxy": "socks5://127.0.0.1:5555:login:pass", // Change the proxy in the profile (proxies can be http, https, socks5, with or without login/password). You can use proxy ID too. "notes": "Text", // Change the notes in the profile "name": "Profile Name", // Change the profile name "folder":"TestFolder", // Change the folder in the profile "tags": ["tag1", "tag2"], // Set tags for the profile, old tags will be overwritten, if the array is empty, all tags will be removed from the profile "geolocation": "12.44, 13.524", // Set the geolocation, if an empty or incorrect value is entered, the default settings will be used "cookies":[{}], // Import cookies into the profile "type": "cloud", // Profile type: cloud, local "group": "group_example", // If no group is entered, it takes the default settings, if there is a group and it is incorrect, an error is displayed "accounts": [ // Import accounts from different sites into the profile {"website": "facebook.com", "username": "test@gmail.com", "password": "123456"}, {"website": "mail.com","username": "test@gmail.com","password": "123456"} ], "timezone": "Pacific/Niue" ("Auto", "System") // set timezone or timezone mode}
{ "code": 0, "status": "success", "data": {}}
Profile Deletion
- Path:
/profile/delete/<profileID>
- Method: GET
Description: Deletes the profile with the selected <profileID>
{ "code": 0, "status": "success", "data": {}}
Clear Profile Data
- Path:
/profile/cleardata/<profileID>
- Method: GET
Description: Clears all data (cookies, history, notes, cache, etc.) of the profile with the selected <profileID>
{ "code": 0, "status": "success", "data": {}}
Clear profile cookies
- Path:
/profile/clearcookies/<profileID>
- Method: GET
Description: Clear only cookies from profile with selected <profileID>
{ "code": 0, "status": "success", "data": {}}
Profile Cookies
- Path:
/profile/cookies/<profileID>
- Method: GET
Description: Requests the cookies of the profile with the selected <profileID>
{ "code": 0, "status": "success", "data": {}}
Send to Cloud
- Path:
/profile/tocloud
- Method: POST
Description: Sends the selected profiles to the cloud
Format: JSON
{ "profiles": ["9b24cd2604d1b8260123242ab1f30c", "f4cbe3c89618bfc9647ba8a47c13f6"], "group": "test"}
{ "code": 0, "status": "success", "data": {}}
Make Local
- Path:
/profile/tolocal
- Method: POST
Description: Makes the selected profiles local
Format: JSON
{ "profiles": ["9b24cd2604d1b8260123242ab1f30c", "f4cbe3c89618bfc9647ba8a47c13f6"]}
{ "code": 0, "status": "success", "data": {}}
Update Browser Version
- Path:
/profile/updatebrowser/<profileID>
- Method: GET
Description: Updates the browser version in the profile with the selected <profileID>
Format: JSON
{ "code": 0, "status": "success", "data": {}}
Configuration List
- Path:
/configslist
- Method: GET
Description: Returns a list of active configurations
Format: JSON
{ "code":0, "status":"success", "data": { "config_id1": { "os": "Windows 10", // Operating system "browser":"Chrome 115", // Browser type and version "useragent": "xxxx", // UserAgent in the config "webgl": "Apple GPU", // WebGL in the config "screen": "1024x768", // Screen resolution }, "config_id2": { … }, … },
}
Group List
- Path:
/groupslist
- Method: GET
Description: Returns a list of groups
Format: JSON
{ "code":0, "status": "success", "data": {["group1", "group2"]},}
Profile Information
- Path:
/profile/getinfo/<profileID>
- Method: GET
Description: Requests information about the profile with the selected <profileID>
Format: JSON
{ "code":0, "status": "success", "data": { "name": "Profile1", // Profile name in the program "status": "Available", // Profile status, can be: "Started","Locked", "Available" "debug_port": "xxxx", // browser debug port, used for automation (empty if profile is not running) "websocket_link": "ws://127.0.0.1:xxxx/devtools/browser/xxxxxx", // browser link, used for automation (empty if profile is not running) "configid": "id", // Config ID "cloud_id": "", "type": "cloud", // Profile type: cloud, local "proxy": "socks5://127.0.0.1:5555:login:pass", // Profile proxy "folder": "Name", // Profile folder name "tags": ["tag1", "tag2", "tag3"], // Profile tags "notes": "Text", // Profile notes "useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.43", // Profile useragent "browser": "Edge 114.0.1823.43", // Profile browser "os": "Windows 10", // Profile OS "screen": "1366x768", // Profile screen resolution "language": "en-US,en;q=0.9,ak-GH;q=0.8,ak;q=0.7", // Profile language "cpu": 8, // Number of cores "memory": 4, // Amount of memory "creation_date": 123456789, // Creation date Unix Timestamp "modify_date": 123456789, // Modification date Unix Timestamp },}
Check IP
- Path:
/profile/checkconnection/<profileID>
- Method: GET
Description: Checks the connection in the profile with the selected
Format: JSON
{ "code":0, "status": "success", "data": { "ip": "127.0.0.1" // Returns the IP address in this profile }}
Get timezones list
- Path:
/timezoneslist
- Method: GET
Description: Returning timezones list
Format: JSON
{ "code":0, "status": "success", "data": { "Pacific/Niue": "GMT-11:00", "America/Cambridge_Bay": "GMT-7:00", ... }}
Get proxies list
- Path:
/proxies/list
- Method: GET
Description: Returning proxies list
Format: JSON
{ "code":0, "status": "success", "data": { "proxy_id1": { "name": "Proxy1" "type": "http", "host": "127.0.0.1", "port": "2222", "login": "12345", "password": "12345", "ipchangelink": "", } "proxy_id2": { … }, … }}
Add proxy
- Path:
/proxies/add
- Method: POST
Description: Add a proxy to the proxy manager, the parameters login, password, ipchangelink are optional, the rest are required
Format: JSON
{ "name": "Proxy1", "type": "http", "host": "127.0.0.1", "port": "2222", "login": "12345", "password": "12345", "ipchangelink": ""}
{ "code": 0, "status": "success", "data": { "proxy_id": "12345" }}
Delete proxy
- Path:
/proxies/delete/<ProxyID>
- Method: GET
Description: Removes a proxy with the selected ID. Proxy will be deleted for all profiles with that proxy, the same as during normal deletion from the manager
Format: JSON
{ "code":0, "status":"success", "data": { },}
Update proxy
- Path:
/proxies/update/<ProxyID>
- Method: POST
Description: Updates the proxy with the selected ID, all parameters are optional
Format: JSON
{ "name": "Proxy1", "type": "http", "host": "127.0.0.1", "port": "2222", "login": "12345", "password": "12345", "ipchangelink": ""}
{ "code": 0, "status": "success", "data": { }}
Examples
Puppeteer (Node.js)
Node.js Puppeteer Launch a profile with a specific name and open the undetectable.io page in that profile:
const puppeteer = require('puppeteer');const axios = require('axios');
const port = 25325; // Portconst ip = '127.0.0.1'; // Local IPconst profileName = ‘TestProfile’; // Profile name
const sleep = (ms) => { return new Promise((resolve) => setTimeout(resolve, ms));};
axios.get('http://' + ip + ':' + port + '/status').then(response => { if (response.data.code == 0) { axios.get('http://' + ip + ':' + port + '/list').then(async response => {
for (var profile in response.data.data) { ///// Start a specific profile and navigate to a page if (response.data.data[profile].name == profileName ) { axios.get('http://' + ip + ':' + port + '/profile/start/' + profile).then(async response => { try { const browser = await puppeteer.connect({ browserWSEndpoint: response.data.data.websocket_link, defaultViewport: null }); const page = await browser.newPage(); await sleep(1000); await page.goto('https://undetectable.io'); } catch (e) { console.log(e); } }) .catch(error => { console.log(error); }); } } }) .catch(error => { console.log(error); }); }}).catch(error => { console.log(error);});
Selenium (Python)
Python + Selenium Launch profiles located in a specific folder and open multiple websites:
from time import sleepimport requestsfrom selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsfrom selenium.webdriver.chrome.service import Service
address = "127.0.0.1" # Local API IP address (if you work from another PC on the same network or a port is open in the router settings, you can access the local API remotely and this address will need to be changed)port_from_settings_browser = '25325' # Local API port (can be found in the program settings)chrome_driver_path = "chromedriver.exe" # Path to chromedriver for v110ser = Service(chrome_driver_path)chrome_options = Options()list_response = requests.get(f'http://{address}:{port_from_settings_browser}/list').json()['data'] # Send a request to the local API to get a list of profilesprofile_id = ''
for key, value in list_response.items(): # Loop through the list of profiles and run them one by one if value['folder'] == 'test': # Here you can add a check to run only the profiles you need (in this example, we run the profiles that are in the 'test' folder) profile_id = key if value['status'] == 'Available': # If the profile is not running, then run the profile and take the debug_port start_profile_response = requests.get(f'http://{address}:{port_from_settings_browser}/profile/start/{profile_id}', timeout=5).json()['data'] debug_port = start_profile_response['debug_port'] if value['status'] == 'Started': # If the profile is running, then we simply take the debug_port from the available data debug_port = value['debug_port'] if value['status'] == 'Locked': # If the profile is Locked, then skip continue if debug_port: # We check if the browser has a connection port (WebEngine profiles doesnt have ports, so we close them immediately) chrome_options.debugger_address = f'{address}:{debug_port}' driver = webdriver.Chrome(service=ser, options=chrome_options) driver.get("https://whoer.net/") # Open whoer.net in active tab driver.switch_to.new_window('tab') # Create a new tab and switch to it driver.get(url='https://browserleaks.com/js') # Open browserleaks.com/js in active tab # You can add any other actions here sleep(5) # Wait 5 sec requests.get(f'http://{address}:{port_from_settings_browser}/profile/stop/{profile_id}') # Stop profile