Automation
Local API
Start and stop profiles from your own scripts with Puppeteer, Playwright or Selenium.

Turn it on
DiceLogin desktop app → Settings → Automation → Local API. It is off by default. When on, it listens on http://127.0.0.1:17900 (port can be changed) and only programs on the same computer can reach it.
Every request needs the API key from that page:
Authorization: Bearer <API key>DiceLogin must be open and signed in. Requests run in the team currently selected in the app, with your role and group access, and they use the same profile locks as the app (a profile open on another computer answers 409 unless you send "force": true).
Endpoints
| Method | Path | Body / query | Returns |
|---|---|---|---|
| GET | /api/v1/status | — | version, signedIn |
| GET | /api/v1/profiles | ?group=<name or id>&q=<text> | profile_id, name, browser, os, group, tags, proxy, running_here, open_on |
| POST | /api/v1/browser/start | { "profile_id": "...", "force": false, "headless": false, "pin": "1234" } | ws_endpoint, debug_port, protocol (cdp for DiceCore, webDriverBiDi for DiceFox); already_open: true if the API had already started it |
| POST | /api/v1/browser/stop | { "profile_id": "..." } | stopped |
| GET | /api/v1/browser/status | ?profile_id=... | running, ws_endpoint, protocol |
Create, change and delete — passed on to DiceLogin with your account, so your role in the team and the plan's limits apply. The bodies are the same as the cloud API.
| Method | Path |
|---|---|
| POST | /api/v1/profiles |
| GET, PATCH, DELETE | /api/v1/profiles/{id} |
| GET | /api/v1/profiles/{id}/activity |
| GET, POST | /api/v1/groups |
| PATCH, DELETE | /api/v1/groups/{id} |
| GET, POST | /api/v1/proxies |
| PATCH | /api/v1/proxies/{id} |
| POST | /api/v1/proxies/bulk-delete |
Headless: "headless": true opens the profile without a window. Its user-agent, proxy, time zone and other settings are the same as with a window. A headless profile shows as Running (headless) in the app.
Responses are { "success": true, "data": ... } or { "success": false, "error": { "code", "message" } }.
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | missing or wrong API key |
| 403 | FORBIDDEN | called from a web page, or with a host other than 127.0.0.1 / localhost |
| 409 | OPEN_ON_ANOTHER_COMPUTER | someone has this profile open; retry with "force": true to take it over |
| 409 | OPEN_WITHOUT_AUTOMATION | the profile was opened by hand in DiceLogin; stop it first |
| 423 | PIN_REQUIRED | the profile has a PIN; send it as "pin": "1234" in the start request |
| 403 | WRONG_PIN | the PIN isn't right |
| 429 | PIN_LOCKED | 5 wrong PINs; wait 15 minutes |
| 422 | LAUNCH_FAILED | the browser could not start (e.g. the proxy is down) |
| 503 | APP_NOT_READY | DiceLogin isn't open or signed in |
Start a profile
Starting a profile gives you ws_endpoint (and debug_port) to connect your script to:
curl -X POST http://127.0.0.1:17900/api/v1/browser/start \
-H "Authorization: Bearer $DICELOGIN_KEY" \
-H "Content-Type: application/json" \
-d '{ "profile_id": "PROFILE_ID" }'const api = "http://127.0.0.1:17900/api/v1";
const headers = { Authorization: `Bearer ${process.env.DICELOGIN_KEY}`, "Content-Type": "application/json" };
const res = await fetch(`${api}/browser/start`, {
method: "POST",
headers,
body: JSON.stringify({ profile_id: "PROFILE_ID" }),
});
const { data } = await res.json();
console.log(data.ws_endpoint, data.debug_port);import os, requests
API = "http://127.0.0.1:17900/api/v1"
H = {"Authorization": f"Bearer {os.environ['DICELOGIN_KEY']}"}
r = requests.post(f"{API}/browser/start", headers=H, json={"profile_id": "PROFILE_ID"})
r.raise_for_status()
data = r.json()["data"]
print(data["ws_endpoint"], data["debug_port"])Drive it with your script
Connect to the profile that is already running — don't launch a new browser. Its cookies, sign-ins, proxy and fingerprint are already in place.
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({ browserWSEndpoint: data.ws_endpoint, defaultViewport: null });
const page = await browser.newPage();
await page.goto("https://example.com");
await browser.disconnect(); // the profile keeps runningimport { chromium } from "playwright";
const browser = await chromium.connectOverCDP(data.ws_endpoint);
const context = browser.contexts()[0]; // the profile's own cookies and storage
const page = await context.newPage();
await page.goto("https://example.com");from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(data["ws_endpoint"])
context = browser.contexts[0] # the profile's own cookies and storage
page = context.new_page()
page.goto("https://example.com")from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_experimental_option("debuggerAddress", f"127.0.0.1:{data['debug_port']}")
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")Stop a profile
curl -X POST http://127.0.0.1:17900/api/v1/browser/stop \
-H "Authorization: Bearer $DICELOGIN_KEY" \
-H "Content-Type: application/json" \
-d '{ "profile_id": "PROFILE_ID" }'await fetch(`${api}/browser/stop`, {
method: "POST",
headers,
body: JSON.stringify({ profile_id: "PROFILE_ID" }),
});requests.post(f"{API}/browser/stop", headers=H, json={"profile_id": "PROFILE_ID"})DiceFox (Firefox) profiles
DiceFox is driven with WebDriver BiDi: protocol is webDriverBiDi and ws_endpoint looks like ws://127.0.0.1:PORT/session.
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({ browserWSEndpoint: data.ws_endpoint, protocol: "webDriverBiDi" });Selenium 4 can use the same endpoint through its BiDi support. Playwright can't drive DiceFox: it only works with its own patched Firefox. Use DiceCore profiles with Playwright.
Limits
- The automation port the browser opens is bound to 127.0.0.1 and exists only while that profile runs.
- To open profiles from another machine, use the cloud API with remote control on. Scripts that drive the browser still run on this computer.
