Integration

Use browser.city with Apify (Actors + Crawlers)

Run large-scale crawling in Apify while delegating stealth browsing, extraction, and proxy egress to browser.city.

Apify is great at orchestration (Actors, scheduling, datasets). browser.city is great at stealth browsing + extraction. Pair them when you want:

  • reliable anti-bot handling (Cloudflare / DataDome / PerimeterX class targets)
  • clean markdown output for pipelines
  • predictable infra primitives (sessions, egress, fingerprints)

If you don’t need multi-step interaction, use the Request API and let Apify handle concurrency and storage.

Batch fetch + markdown (Node.js Actor)

main.ts
import { Actor } from "apify";await Actor.init();const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };const input = (await Actor.getInput()) as { urls: string[] };const res = await fetch("https://api.browser.city/v1/requests/batch", {  ...opts,  body: JSON.stringify({    // Up to 100 per batch; each item can override requestOptions/markdown/render    requests: input.urls.map((url) => ({ url, markdown: true })),  }),}).then((r) => r.json());for (const item of res.responses) {  await Actor.pushData({    url: item.url,    status: item.status,    contentType: item.contentType,    markdown: item.contentType === "markdown" ? item.content : null,    error: item.error ?? null,  });}await Actor.exit();

Why this pattern wins:

  • fewer moving parts than driving Playwright inside the Actor
  • better cost/control for simple extraction workloads
  • easier retry logic (retry individual URLs without keeping a browser alive)

Pattern B: Apify runs Playwright, browser.city provides the remote browser

For logins and multi-step flows, create a browser.city session and connect with Playwright.

session.ts
import { chromium } from "playwright";const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };const session = await fetch("https://api.browser.city/v1/sessions", {  ...opts,  body: JSON.stringify({    browser: "chromium",    egress: { mode: "managed", proxyType: "residential", country: "US" },  }),}).then((r) => r.json());const browser = await chromium.connect(session.endpoint, {  headers: { Authorization: `Bearer ${session.token}` },});

From here you can attach your existing Playwright scripts or crawler logic to browser.

Operational tips

  • Store the key as an Apify secret/env var: BROWSERCITY_API_KEY.
  • Use /v1/requests/batch to reduce per-URL overhead when you can.
  • Use egress and fingerprint options when you need consistent geo/device behavior across runs.
[ 06 / 06 ] — Get Started

Start building in under a minute

Free tier. No credit card. Full stealth from day one.