Skip to content

Quick start Beta ​

Create a browser, connect to its connect_url, and drive it as usual. Replace YOUR_API_KEY with your API key.

js
import puppeteer from 'puppeteer-core';

const res = await fetch('https://api.bitfetcher.io/v1/browsers?api_key=YOUR_API_KEY', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ os: 'windows', proxy: 'premium', country: 'us' }),
});
const session = await res.json();
if (!res.ok) throw new Error(JSON.stringify(session));

// defaultViewport: null keeps the identity's own window size.
const browser = await puppeteer.connect({ browserWSEndpoint: session.connect_url, defaultViewport: null });
const [page] = await browser.pages();
try {
  await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
  console.log(await page.title());
} finally {
  await browser.close(); // ends the session
}
js
import { chromium } from 'playwright';

const res = await fetch('https://api.bitfetcher.io/v1/browsers?api_key=YOUR_API_KEY', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ os: 'windows', proxy: 'premium', country: 'us' }),
});
const session = await res.json();
if (!res.ok) throw new Error(JSON.stringify(session));

const browser = await chromium.connectOverCDP(session.connect_url);
// Use the existing context and page: a new context would be incognito
// and would emulate its own viewport.
const page = browser.contexts()[0].pages()[0];
try {
  await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
  console.log(await page.title());
} finally {
  await browser.close(); // ends the session
}
python
import requests
from playwright.sync_api import sync_playwright

res = requests.post(
    "https://api.bitfetcher.io/v1/browsers",
    params={"api_key": "YOUR_API_KEY"},
    json={"os": "windows", "proxy": "premium", "country": "us"},
)
res.raise_for_status()
session = res.json()

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(session["connect_url"])
    # Use the existing context and page: a new context would be incognito
    # and would emulate its own viewport.
    page = browser.contexts[0].pages[0]
    try:
        page.goto("https://example.com", wait_until="domcontentloaded")
        print(page.title())
    finally:
        browser.close()  # ends the session

TIP

Use the page the browser already has, as in these examples. Setting a viewport, a user agent or a new incognito context replaces the identity's own values with emulated ones, which websites can tell apart.

All options are listed in Parameters and API.