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": "profil dengan pengaturan acak", // Nama profil di program "os": "Windows", // Konfigurasi OS yang akan digunakan "browser": "Chrome", // Konfigurasi browser yang akan digunakan "cpu": 8, // Jumlah inti, nilai yang mungkin: 32, 24, 20, 16, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0 "memory": 8, // Jumlah memori, nilai yang mungkin: 8, 4, 2, 1, 0 "tags": ["tag1", "tag2"], // Mengatur tag pada profil "geolocation": "12.44, 13.524", // Mengatur geolokasi, jika nilai kosong atau tidak valid, maka akan menggunakan pengaturan default "resolution": "1024x768", // Resolusi layar, nilai yang mungkin: "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", // Mengganti proxy dalam profil (proxy dapat berupa http, https, socks5, dengan atau tanpa login/sandi) "notes": "Teks", // Mengganti catatan dalam profil "folder": "testFolder", // Folder tempat profil akan disimpan "language": "ru-RU, en-US", // Dapat mengatur 2 bahasa "cookies": [{}], // Mengimpor cookie ke dalam profil "type": "cloud", // Jenis profil: cloud, local "group": "group_example", // Jika grup yang dimasukkan tidak ada, maka akan menggunakan pengaturan default, jika grup yang dimasukkan salah, maka akan menampilkan pesan kesalahan "configid": "id", // ID Konfigurasi, jika dimasukkan, maka parameter OS dan Browser akan diabaikan, parameter lainnya jika memungkinkan, misalnya jika konfigurasi adalah Android, maka resolusi layar tidak akan berubah "accounts": [ // Mengimpor akun dari berbagai situs ke dalam profil {"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...", // ID unik profil "name": "profil dengan pengaturan acak" // Nama profil di program }}
Memulai Profil
- Path:
/profile/start/<profileID>
- Method: GET
Deskripsi: Memulai profil dengan <profileID>
yang dipilih. Anda dapat menambahkan parameter di tautan:
- chrome_flags dan mengirimkan bendera apa pun yang ingin Anda jalankan, hanya perlu mengodekannya dalam URL encoding, misalnya: ?chrome_flags=—blink-settings%3DimagesEnabled%3Dfalse%20—disable-webgl2
- start-pages dan menentukan halaman awal, hanya perlu mengodekannya dalam URL encoding, misalnya: ?start-pages=https%3A%2F%2Fgoogle.com%2Chttps%3A%2F%2Fya.ru
{ "code":0, "status":"success", "data":{ "name": "Profile1" // Nama profil di program "websocket_link":"ws://127.0.0.1:xxxx/devtools/browser/xxxxxx", // tautan ke browser, digunakan untuk otomatisasi (nilai kosong jika profil tidak berjalan). Hanya untuk browser Chromium "debug_port": "xxxx", // debug port browser Chromium, digunakan untuk otomatisasi (nilai kosong jika profil tidak berjalan). Hanya untuk browser Chromium "folder": "Name", // Nama folder profil "tags": ["tag1", "tag2", "tag3"] // Tag-tag profil },}
Menghentikan Profil
- Path:
/profile/stop/<profileID>
- Method: GET
Deskripsi: Menghentikan profil dengan <profileID>
yang dipilih
{ "code": 0, "status": "success", "data": {}}
Memperbarui Profil
- Path:
/profile/update/<profileID>
- Method: POST
Deskripsi: Memperbarui informasi dalam profil dengan <profileID>
yang diperlukan. Semua parameter bersifat opsional dan mungkin tidak ada
Format: JSON
{ "proxy": "socks5://127.0.0.1:5555:login:pass", // Mengubah proxy dalam profil (proxy dapat berupa http, https, socks5, ada opsi dengan login/sandi dan tanpa login/sandi) "notes": "Text", // Mengubah catatan dalam profil "name": "Nama Profil", // Mengubah nama profil "folder":"TestFolder", // Mengubah folder dalam profil "tags": ["tag1", "tag2"], // Mengatur tag pada profil, tag lama akan ditimpa, jika array kosong, semua tag akan dihapus dari profil "geolocation": "12.44, 13.524", // Mengatur geolokasi, jika nilai kosong atau tidak valid, akan menggunakan pengaturan default "cookies":[{}], // Mengimpor cookie ke dalam profil "type": "cloud", // Jenis profil: cloud, local "group": "group_example", // Jika grup yang dimasukkan tidak ada, akan mengambil dari Pengaturan Default, jika ada dan tidak valid, akan menampilkan kesalahan "accounts": [ // Mengimpor akun dari berbagai situs ke dalam profil {"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": {}}
Menghapus Profil
- Path:
/profile/delete/<profileID>
- Method: GET
Deskripsi: Menghapus profil dengan <profileID>
yang dipilih
{ "code": 0, "status": "success", "data": {}}
Membersihkan Data dalam Profil
- Path:
/profile/cleardata/<profileID>
- Method: GET
Deskripsi: Menghapus semua data (cookie, riwayat, catatan, cache, dll.) dalam profil dengan <profileID>
yang dipilih
{ "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": {}}
Cookie Profil
- Path:
/profile/cookies/<profileID>
- Method: GET
Deskripsi: Meminta cookie dalam profil dengan <profileID>
yang dipilih
{ "code": 0, "status": "success", "data": {}}
Mengirim ke Cloud
- Path:
/profile/tocloud
- Method: POST
Deskripsi: Mengirimkan profil yang dipilih ke cloud
Format: JSON
{ "profiles": ["9b24cd2604d1b8260123242ab1f30c", "f4cbe3c89618bfc9647ba8a47c13f6"], "group": "test"}
{ "code": 0, "status": "success", "data": {}}
Membuat Lokal
- Path:
/profile/tolocal
- Method: POST
Deskripsi: Membuat profil yang dipilih menjadi lokal
Format: JSON
{ "profiles": ["9b24cd2604d1b8260123242ab1f30c", "f4cbe3c89618bfc9647ba8a47c13f6"]}
{ "code": 0, "status": "success", "data": {}}
Memperbarui Versi Browser
- Path:
/profile/updatebrowser/<profileID>
- Method: GET
Deskripsi: Memperbarui versi browser dalam profil dengan <profileID>
yang dipilih
Format: JSON
{ "code": 0, "status": "success", "data": {}}
Daftar Konfigurasi
- Path:
/configslist
- Method: GET
Deskripsi: Mengembalikan daftar konfigurasi aktif
Format: JSON
{ "code":0, "status":"sukses", "data": { "config_id1": { "os": "Windows 10" // Sistem Operasi "browser":"Chrome 115", // Jenis dan versi browser "useragent": "xxxx", // UserAgent dalam konfigurasi "webgl": "Apple GPU", // WebGL dalam konfigurasi "screen": "1024x768", // Resolusi layar }, "config_id2": { … }, … },
}
Daftar Grup
- Path:
/groupslist
- Method: GET
Deskripsi: Mengembalikan daftar grup
Format: JSON
{ "code":0, "status": "sukses", "data": {["group1", "group2"]},}
Informasi Profil
- Path:
/profile//<profileID>
- Method: GET
Deskripsi: Mengambil informasi profil dengan <profileID>
yang dipilih
Format: JSON
{ "code":0, "status": "sukses", "data": { "name": "Profil1" // Nama profil dalam program "status": "Tersedia", // status profil, bisa berupa: "Dimulai","Terkunci", "Tersedia" "debug_port": "xxxx", // debug port browser, digunakan untuk otomatisasi (nilai kosong jika profil tidak berjalan) "websocket_link": "ws://127.0.0.1:xxxx/devtools/browser/xxxxxx", // tautan browser, digunakan untuk otomatisasi (nilai kosong jika profil tidak berjalan) "configid": "id" // ID Konfigurasi "cloud_id": "" "type": "cloud" // Jenis profil: cloud, lokal "proxy": "socks5://127.0.0.1:5555:login:pass", // Proxy profil "folder": "Nama", // Nama folder profil "tags": ["tag1", "tag2", "tag3"], // Tag profil "notes": "Teks", // Catatan profil "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", // useragent profil "browser": "Edge 114.0.1823.43", // Browser profil "os": "Windows 10", // Sistem Operasi profil "screen": "1366x768", // Resolusi layar profil "language": "en-US,en;q=0.9,ak-GH;q=0.8,ak;q=0.7", // Bahasa profil "cpu": 8, // Jumlah inti "memory": 4, // Jumlah memori "creation_date": 123456789, // Tanggal pembuatan Unix Timestamp "modify_date": 123456789, // Tanggal modifikasi 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": { }}
Contoh
Puppeteer (Node.js)
Node.js Puppeteer Menjalankan profil dengan nama tertentu dan membuka halaman undetectable.io di profil tersebut:
const puppeteer = require('puppeteer');const axios = require('axios');
const port = 25325; // Portconst ip = '127.0.0.1'; // IP Lokalconst profileName = ‘TestProfile’; // Nama profil
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) { ///// Memulai profil tertentu dan pergi ke halaman 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 Menjalankan profil yang berada di folder tertentu dan membuka beberapa situs:
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" # Alamat IP API lokal (jika Anda bekerja dari komputer lain dalam jaringan yang sama atau jika port terbuka dalam pengaturan router, Anda dapat mengakses API lokal secara remote dan alamat ini harus diubah)port_from_settings_browser = '25325' # Port API lokal (dapat ditemukan di pengaturan program)chrome_driver_path = "chromedriver.exe" # Path ke chromedriver untuk v110ser = Service(chrome_driver_path)chrome_options = Options()list_response = requests.get(f'http://{address}:{port_from_settings_browser}/list').json()['data'] # Mengirim permintaan ke API lokal untuk mendapatkan daftar profilprofile_id = ''
for key, value in list_response.items(): # Melakukan iterasi melalui daftar profil dan menjalankannya satu per satu if value['folder'] == 'test': # Di sini Anda dapat menambahkan pemeriksaan untuk hanya menjalankan profil yang diperlukan (dalam contoh ini, kami menjalankan profil yang berada dalam folder 'test') profile_id = key if value['status'] == 'Available': # Jika profil tidak berjalan, maka jalankan profil dan dapatkan 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': # Jika profil berjalan, cukup ambil debug_port dari data yang tersedia debug_port = value['debug_port'] if value['status'] == 'Locked': # Jika profil terkunci, lewati continue if debug_port: # Periksa apakah browser memiliki port koneksi (profil WebEngine tidak memiliki port, jadi kami langsung menutupnya) chrome_options.debugger_address = f'{address}:{debug_port}' driver = webdriver.Chrome(service=ser, options=chrome_options) driver.get("https://whoer.net/") # Buka whoer.net di tab aktif driver.switch_to.new_window('tab') # Buat tab baru dan beralih ke tab tersebut driver.get(url='https://browserleaks.com/js') # Buka browserleaks.com/js di tab aktif # Di sini Anda dapat menambahkan tindakan lainnya sleep(5) # Tunggu selama 5 detik requests.get(f'http://{address}:{port_from_settings_browser}/profile/stop/{profile_id}') # Hentikan profil