Automating profiles with the local API
Three ways to automate PassKeel profiles, from a no-code recorder to Playwright scripts, and how the local API keeps each profile's identity intact while your tools drive it.
The PassKeel team · · 5 min read
- automation
- developers
- guides
Once you have more than a handful of profiles, the work inside them starts to repeat. Check the orders in twelve shops every morning. Post the same announcement on five client accounts. Run a test suite from eight locations. PassKeel gives you three ways to automate that work, and they share one idea: whatever drives a profile, the profile stays itself. Same fingerprint, same proxy, same cookies, same extensions.
This post walks through the three, starting with the one that needs no code, and spends most of its time on the local API, because that’s where everything else is built.
Three ways in
- The recorder. Record what you do in one profile, edit the steps, and run them in many profiles, optionally filling in different values from a CSV file. Schedule runs to repeat. No code.
- The window synchronizer. Work in one profile’s window and have every click, keystroke, scroll and tab action happen in up to 50 others at the same time.
- The local API. An HTTP API on your own computer, with Python and Node.js SDKs, and connections for Puppeteer, Playwright and Selenium.
They aren’t separate systems. The desktop app is itself a client of the local API: every screen you click through calls the same endpoints a script can call. That’s why the API covers everything the app does, and why the reference lists more than two hundred endpoints.
The recorder, briefly
Open Automation, choose Record in a profile, pick the profile and choose Open and record. Work as usual: clicks, typing, keys, scrolling and tab switches become steps, shown live in the recording bar. Stop and save when you’re done.
The step editor shows each step as a sentence: Go to a page, Type text in a field, Click a button, Wait for an element, Take a screenshot, Read text into a variable, If an element exists, Repeat. Write {{email}} or {{orderId}} in a step and the value comes from a CSV column at run time, one row per profile.
When you choose Run, you pick the profiles, load the CSV and set how many run at the same time, with random waits between steps and keys and an option to move the mouse like a person. Runs use real browser input. Each profile’s result, failing step, log and screenshots are kept. A schedule repeats a run at an interval or at cron-style times while PassKeel is running.
The recorder suits jobs that are the same every time and that someone who doesn’t write code should be able to change.
The local API
PassKeel’s background service listens on http://127.0.0.1:50325, on the loopback address only, so nothing else on your network can reach it. Every request carries an API key you create under Settings > API keys, shown once and labelled so you know which tool uses it.
curl -H "X-Api-Key: $PASSKEEL_API_KEY" http://127.0.0.1:50325/v1/profiles
The API describes itself in OpenAPI 3 at /openapi.json, so you can generate a client in any language or import it into Postman or Insomnia. A WebSocket at /v1/events streams what happens: profiles opening and closing, proxy checks, sync progress, run progress, resource use.
The API and the SDKs are included on every plan, Free included, with a rate limit of 3,000 requests a minute per key.
Opening a profile for your tool
The important call is POST /v1/profiles/{id}/open. It starts the profile in its own Keel browser, with its own settings, proxy and data, and returns an automation object:
browserWSEndpointfor Puppeteer’sconnectand Playwright’sconnectOverCDP;browserURLfor other DevTools Protocol clients;webDriverUrlfor Selenium’s Remote WebDriver. PassKeel runs the chromedriver that matches the profile’s browser version, so you don’t manage drivers.
With the Python SDK, the whole thing is a context manager that also closes the profile when you’re done, even after an error:
from playwright.sync_api import sync_playwright
from passkeel import PassKeel
pk = PassKeel() # reads PASSKEEL_API_KEY
with pk.session(profile_id) as opened, sync_playwright() as p:
browser = p.chromium.connect_over_cdp(**opened.playwright_connect_args())
page = browser.contexts[0].new_page()
page.goto("https://example.com")
print(page.title())
browser.close() # disconnects; the session closes the profile
Two details in that snippet matter. First, use the profile’s existing browser context, contexts[0]: a new context would be a blank, temporary one without the profile’s cookies. Second, browser.close() here only disconnects; the profile is closed through the API, which is what saves it and uploads its changes.
Why there’s a bridge
You may wonder why the endpoints point at PassKeel’s port instead of a debugging port on the browser. That’s deliberate. Keel Engine refuses remote-debugging ports entirely when it runs a PassKeel profile. Your tool talks to a bridge inside PassKeel’s service, through a URL that contains a session token, and the bridge talks to the browser over a private pipe.
The bridge lets standard DevTools Protocol commands for pages and targets through. It blocks the few that would change a profile’s launch settings or close the browser behind PassKeel’s back, answering “method not found” as Chrome does for unknown methods. That’s how a profile keeps its identity under automation: your script can’t accidentally relaunch it with different settings, and navigator.webdriver stays false because nothing about the launch changed.
Because the token in the URL is a credential, treat it like the API key. In a team, someone without the Export data and automate permission on a shared profile gets no automation connection for it at all.
Many profiles at once
Parallel work is just more of the same: open several profiles, connect to each, close each through the API. The practical limits are your computer’s memory, since each open profile is a full browser (plan for about 600 MB each), and, for the recorder and synchronizer, your plan. GET /v1/resources reports what each open profile uses.
Opening can fail for reasons a script should handle: the profile is already open (409 already_open; connect to the existing session instead), it’s open on another of your computers (409 sync_locked), the proxy failed its check (502), or it’s locked with a PIN (403). Errors come back as JSON with a stable code and a readable message, and the SDKs raise typed exceptions for them.
Headless, when you’re not watching
Add headless: true to the open request to start a profile without a window. Keel applies every setting exactly as it does with a window, so the identity pages see doesn’t change. Develop with a window, run unattended jobs headless.
What the API isn’t for
The API automates your own work in your own profiles. It doesn’t solve CAPTCHAs, and we don’t ship scripts for creating accounts in bulk. Automated traffic must follow each site’s rules and our acceptable use policy.
Getting started
- Create a key under Settings > API keys and call
GET /v1/profiles. - Read the local API guide for errors, events and limits.
- Copy a working example for your tool from Connect Puppeteer, Playwright or Selenium, in Node.js and Python.
- Browse every endpoint in the API reference.
The SDKs aren’t on npm or PyPI yet; the SDKs page explains how to get them meanwhile. If you’d rather not write code at all, the recorder and the synchronizer cover a surprising amount.