KryptixDocs
06 · Scraper

Connection code

Attach Playwright, Puppeteer or plain code to a profile in a few lines.

Pro planPython 3 + Playwright3 min readUpdated November 2026

Attach your own tool to a profile. Pick a Tool / language, press Copy code, paste it into a file and run it. The code opens the profile itself and attaches to it, so your script uses that profile's fingerprint and proxy.

python test.py     # Python tools
node test.js       # Node tools
ButtonWhat it does
Open a test sessionA fresh identity (fingerprint + optional proxy). It shows in the Scraper sessions folder of the profile list and is deleted when the job ends or its time runs out. The row shows the minutes left.
Close and delete allRemoves every open test session right away.
Save the SDK fileWrites kryptix_sdk.py: one file, standard library only. Put it next to your script. It holds kx.playwright_page, wait_challenge, structured_data, kx.run_many and the command-line commands.

Tools#

Each tool's install note and example code; the command-line examples are under Examples.

Python · Playwright

Install: pip install playwright. Recommended for most scrapers. Attaches over CDP; the profile keeps its fingerprint and proxy. close() only disconnects: the profile stays open until you close it.

# The window fills in your real API address and profile id for you.
import json, os, urllib.request

BASE = "http://127.0.0.1:API_PORT"
KEY = os.environ.get("KRYPTIX_API_KEY", "")
OPENER = urllib.request.build_opener(urllib.request.ProxyHandler({}))


def api(path, body=None):
    headers = {"Content-Type": "application/json"}
    if KEY:
        headers["X-Api-Key"] = KEY
    req = urllib.request.Request(BASE + path, data=json.dumps(body or {}).encode(),
                                 headers=headers, method="POST")
    with OPENER.open(req, timeout=90) as r:
        return json.load(r)


ep = api("/api/automation/start", {"id": "PROFILE_ID"})
if not ep.get("ok"):
    raise SystemExit(ep.get("error"))

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(ep["browserUrl"])
    context = browser.contexts[0]
    page = context.pages[0] if context.pages else context.new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()
Node · Puppeteer

Install: npm i puppeteer-core. Node 18+ (built-in fetch). Use puppeteer-core: Kryptix brings its own browser.

// The window fills in your real API address and profile id for you.
const puppeteer = require("puppeteer-core");
const BASE = "http://127.0.0.1:API_PORT";
const KEY = process.env.KRYPTIX_API_KEY || "";

async function api(path, body) {
  const headers = { "Content-Type": "application/json" };
  if (KEY) headers["X-Api-Key"] = KEY;
  const r = await fetch(BASE + path, { method: "POST", headers, body: JSON.stringify(body || {}) });
  return r.json();
}

(async () => {
  const ep = await api("/api/automation/start", { id: "PROFILE_ID" });
  if (!ep.ok) throw new Error(ep.error);
  const browser = await puppeteer.connect({
    browserWSEndpoint: ep.webSocketDebuggerUrl, defaultViewport: null });
  const page = (await browser.pages())[0] || (await browser.newPage());
  await page.goto("https://example.com");
  console.log(await page.title());
  await browser.disconnect();
})();
Node · Playwright

Install: npm i playwright-core. Node 18+. close() only disconnects.

// The window fills in your real API address and profile id for you.
const { chromium } = require("playwright-core");
const BASE = "http://127.0.0.1:API_PORT";
const KEY = process.env.KRYPTIX_API_KEY || "";

async function api(path, body) {
  const headers = { "Content-Type": "application/json" };
  if (KEY) headers["X-Api-Key"] = KEY;
  const r = await fetch(BASE + path, { method: "POST", headers, body: JSON.stringify(body || {}) });
  return r.json();
}

(async () => {
  const ep = await api("/api/automation/start", { id: "PROFILE_ID" });
  if (!ep.ok) throw new Error(ep.error);
  const browser = await chromium.connectOverCDP(ep.browserUrl);
  const context = browser.contexts()[0];
  const page = context.pages()[0] || (await context.newPage());
  await page.goto("https://example.com");
  console.log(await page.title());
  await browser.close();
})();
Python · SeleniumBase (CDP)

Install: python -m pip install seleniumbase. Only SeleniumBase's CDP driver can attach to Kryptix. Its own UC Mode / BaseCase helpers launch a separate Chrome and would bypass this profile's proxy and fingerprint. browser_executable_path is only checked, never launched.

# The window fills in your real API address and profile id for you.
import json, os, urllib.request

BASE = "http://127.0.0.1:API_PORT"
KEY = os.environ.get("KRYPTIX_API_KEY", "")
OPENER = urllib.request.build_opener(urllib.request.ProxyHandler({}))


def api(path, body=None):
    headers = {"Content-Type": "application/json"}
    if KEY:
        headers["X-Api-Key"] = KEY
    req = urllib.request.Request(BASE + path, data=json.dumps(body or {}).encode(),
                                 headers=headers, method="POST")
    with OPENER.open(req, timeout=90) as r:
        return json.load(r)


ep = api("/api/automation/start", {"id": "PROFILE_ID"})
if not ep.get("ok"):
    raise SystemExit(ep.get("error"))

import asyncio, sys
from seleniumbase.undetected.cdp_driver import cdp_util


async def main():
    driver = await cdp_util.start_async(host="127.0.0.1", port=ep["port"],
                                        browser_executable_path=sys.executable)
    page = await driver.get("https://example.com")
    await asyncio.sleep(2)
    print(await page.evaluate("document.title"))


asyncio.run(main())
Python · nodriver

Install: pip install nodriver. nodriver is AGPL-3.0: check that the license fits your project before you ship it. browser_executable_path is only checked, never launched.

# The window fills in your real API address and profile id for you.
import json, os, urllib.request

BASE = "http://127.0.0.1:API_PORT"
KEY = os.environ.get("KRYPTIX_API_KEY", "")
OPENER = urllib.request.build_opener(urllib.request.ProxyHandler({}))


def api(path, body=None):
    headers = {"Content-Type": "application/json"}
    if KEY:
        headers["X-Api-Key"] = KEY
    req = urllib.request.Request(BASE + path, data=json.dumps(body or {}).encode(),
                                 headers=headers, method="POST")
    with OPENER.open(req, timeout=90) as r:
        return json.load(r)


ep = api("/api/automation/start", {"id": "PROFILE_ID"})
if not ep.get("ok"):
    raise SystemExit(ep.get("error"))

import sys
import nodriver as uc


async def main():
    browser = await uc.start(host="127.0.0.1", port=ep["port"],
                             browser_executable_path=sys.executable)
    page = await browser.get("https://example.com")
    print(await page.evaluate("document.title"))


uc.loop().run_until_complete(main())
Python · Selenium (WebDriver)

Install: pip install selenium. Needs a chromedriver that matches Kryptix's Chromium version. WebDriver is easier for sites to notice than CDP; prefer Playwright or SeleniumBase CDP when stealth matters.

# The window fills in your real API address and profile id for you.
import json, os, urllib.request

BASE = "http://127.0.0.1:API_PORT"
KEY = os.environ.get("KRYPTIX_API_KEY", "")
OPENER = urllib.request.build_opener(urllib.request.ProxyHandler({}))


def api(path, body=None):
    headers = {"Content-Type": "application/json"}
    if KEY:
        headers["X-Api-Key"] = KEY
    req = urllib.request.Request(BASE + path, data=json.dumps(body or {}).encode(),
                                 headers=headers, method="POST")
    with OPENER.open(req, timeout=90) as r:
        return json.load(r)


ep = api("/api/automation/start", {"id": "PROFILE_ID"})
if not ep.get("ok"):
    raise SystemExit(ep.get("error"))

from selenium import webdriver

opts = webdriver.ChromeOptions()
opts.debugger_address = "127.0.0.1:%d" % ep["port"]
driver = webdriver.Chrome(options=opts)
driver.get("https://example.com")
print(driver.title)
Python · Kryptix SDK (disposable identity)

Download kryptix_sdk.py with the “Save the SDK file” button in the Connection code tab and put it next to your script (pip install playwright). The session is created, used and deleted for you. proxy="http://user:pass@host:port" is optional; wait_challenge waits out a "Just a moment..." page; structured_data reads JSON-LD, __NEXT_DATA__ and OpenGraph.

import kryptix_sdk as kx

with kx.playwright_page(os="windows", proxy="") as page:
    page.goto("https://example.com")
    kx.wait_challenge(page)
    data = kx.structured_data(page)
    print(data["jsonld"])

with kx.playwright_page(profile_id="YOUR_PROFILE_ID") as page:
    page.goto("https://example.com")
Python · Bulk (many URLs at once)

Download kryptix_sdk.py with the “Save the SDK file” button in the Connection code tab; put it, this script and urls.txt (one URL per line) in the same folder (pip install playwright). Several browsers run at once, each with a fresh identity; a failed page is retried with a new identity; results are written to results.csv as they finish and a second run continues where the first stopped. Add proxies=kx.read_lines("proxies.txt") to rotate proxies, domain_delay=2 to wait between hits on one site, validate=... to catch pages that load but hold no data, evidence=True to keep screenshots of failures.

import kryptix_sdk as kx


def work(page, url):
    page.goto(url)
    kx.require_clear(page)
    return {"title": page.title()}


results = kx.run_many(kx.read_lines("urls.txt"), work, concurrency=3, out="results.csv")
for r in results:
    print(r.ok, r.job, r.data or r.error)
PowerShell (quick check)

Starts the profile and prints the CDP address. Add -Headers @{"X-Api-Key"=$env:KRYPTIX_API_KEY} if you set an API key.

# The window fills in your real API address and profile id for you.
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:1/api/automation/start" `
  -ContentType "application/json" -Body '{"id":"PROFILE_ID"}'