Appearance
Usage
Dolphin Anty exposes two API surfaces:
- Cloud REST API (
https://dolphin-anty-api.com) for managing profiles (create, list, update, delete). Requires a Bearer token. Does not require the desktop app to be running. - Local CDP API (
http://localhost:3001) for launching and connecting to a profile browser. Requires the desktop app to be running and authenticated.
Step 1: Create a Browser Profile (Cloud API)
python
import requests
API_TOKEN = "YOUR_API_TOKEN"
payload = {
"name": "Profile",
"platform": "windows",
"browserType": "anty",
"mainWebsite": "",
"useragent": {
"mode": "manual",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
},
"webrtc": {"mode": "altered", "ipAddress": None},
"canvas": {"mode": "real"},
"webgl": {"mode": "real"},
"timezone": {"mode": "auto", "value": None},
"locale": {"mode": "auto", "value": None},
"cpu": {"mode": "manual", "value": 4},
"memory": {"mode": "manual", "value": 8},
"doNotTrack": False,
"osVersion": "10"
}
response = requests.post(
"https://dolphin-anty-api.com/browser_profiles",
json=payload,
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {API_TOKEN}"
}
)
profile = response.json()
profile_id = profile["data"]["id"]
print(f"Profile created: {profile_id}")Step 2: Authenticate the Local API
With the desktop app running, exchange your API token for a local session:
python
import requests
auth = requests.post(
"http://localhost:3001/v1.0/auth/login-with-token",
json={"token": "YOUR_API_TOKEN"},
headers={"Content-Type": "application/json"}
)
print(auth.json()) # {"success": true}Step 3: Start a Profile and Connect via Playwright
python
import requests
from playwright.sync_api import sync_playwright
PROFILE_ID = "YOUR_PROFILE_ID"
# Start the profile browser
start = requests.get(
f"http://localhost:3001/v1.0/browser_profiles/{PROFILE_ID}/start?automation=1"
)
data = start.json()
port = data["automation"]["port"]
ws_endpoint = data["automation"]["wsEndpoint"]
# Connect Playwright over CDP
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(f"ws://127.0.0.1:{port}{ws_endpoint}")
page = browser.contexts[0].pages[0]
page.goto("https://example.com")
print(page.title())
browser.close()
# Stop the profile
requests.get(f"http://localhost:3001/v1.0/browser_profiles/{PROFILE_ID}/stop")Node.js Equivalent (Puppeteer)
javascript
const puppeteer = require('puppeteer-core');
const fetch = require('node-fetch');
const PROFILE_ID = 'YOUR_PROFILE_ID';
const res = await fetch(
`http://localhost:3001/v1.0/browser_profiles/${PROFILE_ID}/start?automation=1`
);
const { automation: { port, wsEndpoint } } = await res.json();
const browser = await puppeteer.connect({
browserWSEndpoint: `ws://127.0.0.1:${port}${wsEndpoint}`
});
const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
await browser.close();
await fetch(`http://localhost:3001/v1.0/browser_profiles/${PROFILE_ID}/stop`);Local API Endpoints Reference
| Action | Method | Endpoint |
|---|---|---|
| Authenticate | POST | http://localhost:3001/v1.0/auth/login-with-token |
| Start profile | GET | http://localhost:3001/v1.0/browser_profiles/{id}/start?automation=1 |
| Start headless | GET | http://localhost:3001/v1.0/browser_profiles/{id}/start?automation=1&headless=1 |
| Stop profile | GET | http://localhost:3001/v1.0/browser_profiles/{id}/stop |
Cloud API Endpoints Reference
| Action | Method | Endpoint |
|---|---|---|
| Create profile | POST | https://dolphin-anty-api.com/browser_profiles |
| List profiles | GET | https://dolphin-anty-api.com/browser_profiles |
| Delete profile | DELETE | https://dolphin-anty-api.com/browser_profiles/{id} |