Basics
The API runs inside the desktop app at http://127.0.0.1:7777 and accepts connections only from your own PC. Copy the API key from the “Automation API” page in the app and send it with every request, in one of these headers:
Authorization: Bearer YOUR_API_KEY
X-Morpho-Token: YOUR_API_KEY
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | /api/v1/profiles | Lists profiles: ID, name, engine and whether it is open. |
POST | /api/v1/profiles/{id}/start | Starts a profile and returns its ws_endpoint. Waits up to ?timeout=60 seconds, at most 180. |
GET | /api/v1/profiles/{id} | Shows the status, with the connection address when the profile is open. |
POST | /api/v1/profiles/{id}/stop | Closes the profile. |
Start a profile with curl
curl -X POST -H "Authorization: Bearer $MORPHO_KEY" \
"http://127.0.0.1:7777/api/v1/profiles/PROFILE_ID/start?timeout=60"
# -> {"ws_endpoint": "ws://127.0.0.1:<port>/devtools/browser/...", ...}
Connect with Playwright (Python)
import requests
from playwright.sync_api import sync_playwright
API = "http://127.0.0.1:7777/api/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
ws = requests.post(f"{API}/profiles/PROFILE_ID/start", headers=HEADERS,
params={"timeout": 60}).json()["ws_endpoint"]
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(ws)
context = browser.contexts[0] # the profile's own context
page = context.new_page()
page.goto("https://example.com")
print(page.title())
requests.post(f"{API}/profiles/PROFILE_ID/stop", headers=HEADERS)
Connect with Puppeteer (Node.js)
import puppeteer from "puppeteer-core";
const API = "http://127.0.0.1:7777/api/v1";
const headers = { Authorization: "Bearer YOUR_API_KEY" };
const res = await fetch(`${API}/profiles/PROFILE_ID/start?timeout=60`, { method: "POST", headers });
const { ws_endpoint } = await res.json();
const browser = await puppeteer.connect({ browserWSEndpoint: ws_endpoint });
const page = await browser.newPage();
await page.goto("https://example.com");
console.log(await page.title());
browser.disconnect(); // leaves the profile running; stop it with POST .../stop
Notes
- Only Chromium profiles return a DevTools endpoint.
- The profile keeps its own fingerprint and proxy while your script drives it.
- For Selenium, attach ChromeDriver to the host and port from the ws_endpoint (debuggerAddress).
- You can replace the API key in the app at any time; the old key stops working at once.