Skip to main content

Overview

The /browser endpoint fetches a URL with full JavaScript rendering. Unlike /fetch (which returns the raw HTTP response), /browser waits for dynamic content and returns the fully rendered page. When to use /browser instead of /fetch:
  • The page requires JavaScript to load content (SPAs, dynamic sites)
  • You need all cookies, including those set by client-side scripts
  • You want to execute custom JavaScript to extract data
  • You need a screenshot of the rendered page
The response format is the same as /fetch (meta, raw, raw_json), with additional fields for cookies, screenshots, and JS evaluation results.

Endpoint

GET https://scraping-api.55-tech.com/browser
Works just like /fetch — all parameters are passed via headers.

Request headers

HeaderRequiredDefaultDescription
X-API-KeyYesYour API key
X-Target-URLYesTarget URL to render
X-Wait-StrategyNoloadload, networkidle, or selector (details)
X-Wait-SelectorNoCSS selector to wait for (with selector strategy)
X-TimeoutNo30Timeout in seconds (max 120)
X-JS-ExpressionNoJavaScript to evaluate after the page is ready
X-ScreenshotNofalseCapture screenshot (1 or true)
X-Expect-SelectorNoCSS selector that must exist — retries on a different node if missing
X-Expect-ContainsNoSubstring that must exist in the body — retries if missing
X-ProxyNoRoute through a proxy (http:// or socks5://)
X-Block-ResourcesNoComma-separated resource types to block: image,font,stylesheet,media
X-GeoNoCountry filter for node selection (e.g. US, DE,AT)
X-AgentNoPin to a specific node (e.g. de1, us3)
CookieNoCookies to inject (name=value; name2=value2)
X-CookiesNoCookies as JSON array for full control (format)

Wait strategies

StrategyDescription
loadWait for DOMContentLoaded event (fastest, works for server-rendered pages)
networkidleWait until there are no more than 2 network connections for 500ms (best for SPAs)
selectorWait for X-Wait-Selector to appear in the DOM (most precise for specific content)

Cookies

Simple cookies — use the standard Cookie header:
Cookie: session=abc123; token=xyz
Full cookie objects — use the X-Cookies header with a JSON array when you need domain, path, or httpOnly control:
X-Cookies: [{"name":"session","value":"abc","domain":".example.com","secure":true}]
Cookie object fields: name, value, domain, path, secure, httpOnly, sameSite, expires.

Resource blocking

Block specific resource types to speed up rendering:
X-Block-Resources: image,font,stylesheet
Blocking images and fonts can reduce render time by 50%+ on media-heavy pages.

Response

{
  "meta": {
    "status": 200,
    "final_url": "https://example.com/",
    "http_version": "",
    "elapsed_ms": 3200,
    "blocked": false,
    "headers": { "content-type": "text/html; charset=utf-8" },
    "agent": { "id": "scraping-de5" },
    "bytes": 45210
  },
  "raw": "<!DOCTYPE html><html>...</html>",
  "raw_json": null,
  "cookies": [
    {
      "name": "session_id",
      "value": "a1b2c3...",
      "domain": ".example.com",
      "path": "/",
      "secure": true,
      "httpOnly": true,
      "sameSite": "Lax",
      "expires": 1735689600
    }
  ],
  "screenshot": null,
  "js_result": null
}
FieldDescription
metaSame as /fetch — status, final URL, headers, timing, node ID
rawRendered page body as text (HTML or other). null if body was valid JSON
raw_jsonParsed JSON object if the response was valid JSON, otherwise null
cookiesAll cookies set during rendering, including httpOnly cookies
screenshotBase64-encoded PNG of the full page (null if not requested)
js_resultReturn value of X-JS-Expression (null if not provided)

Response validation

Use X-Expect-Selector and X-Expect-Contains to verify the rendered page has the content you expect. If validation fails, the API automatically retries on a different node before returning an error.

Examples

Render a JavaScript-heavy page

curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com" \
  -H "X-Wait-Strategy: networkidle" \
  https://scraping-api.55-tech.com/browser

Wait for specific content

curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/dashboard" \
  -H "X-Wait-Strategy: selector" \
  -H "X-Wait-Selector: #data-table" \
  -H "X-Timeout: 45" \
  https://scraping-api.55-tech.com/browser

Extract data with JavaScript

curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com" \
  -H "X-Wait-Strategy: networkidle" \
  -H "X-JS-Expression: JSON.stringify({title: document.title, links: document.querySelectorAll('a').length})" \
  https://scraping-api.55-tech.com/browser
The js_result field in the response contains the return value:
{
  "js_result": "{\"title\":\"Example\",\"links\":42}"
}

Capture a screenshot

curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com" \
  -H "X-Screenshot: 1" \
  -H "X-Block-Resources: image,font" \
  https://scraping-api.55-tech.com/browser

With cookies

curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com" \
  -H "Cookie: session=abc123; token=xyz" \
  -H "X-Wait-Strategy: networkidle" \
  https://scraping-api.55-tech.com/browser

Route through a proxy

curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://geo-restricted-site.com" \
  -H "X-Proxy: http://user:pass@proxy.example.com:8080" \
  -H "X-Geo: US" \
  https://scraping-api.55-tech.com/browser

Validate response content

If the page doesn’t contain the expected content, the API retries on a different node:
curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/products" \
  -H "X-Wait-Strategy: selector" \
  -H "X-Wait-Selector: .product-list" \
  -H "X-Expect-Selector: .product-list" \
  -H "X-Expect-Contains: price" \
  https://scraping-api.55-tech.com/browser

Python

import requests

resp = requests.get("https://scraping-api.55-tech.com/browser", headers={
    "X-API-Key": "YOUR_API_KEY",
    "X-Target-URL": "https://example.com",
    "X-Wait-Strategy": "networkidle",
    "X-JS-Expression": "document.title",
    "X-Block-Resources": "image,font",
})

data = resp.json()
print(data["meta"]["status"])       # 200
print(data["raw"][:200])            # rendered HTML
print(data["js_result"])            # "Example Domain"

for c in data["cookies"]:
    print(f"{c['name']}={c['value']} (httpOnly={c['httpOnly']})")

JavaScript

const resp = await fetch("https://scraping-api.55-tech.com/browser", {
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "X-Target-URL": "https://example.com",
    "X-Wait-Strategy": "networkidle",
    "X-JS-Expression": "document.title",
  },
});

const data = await resp.json();
console.log(data.meta.status);       // 200
console.log(data.raw.slice(0, 200)); // rendered HTML
console.log(data.js_result);         // "Example Domain"
console.log(data.cookies.length);    // number of cookies captured

Browser Stream (SSE)

For live, long-running sessions, use /browser/stream. Instead of capturing a single snapshot, the browser stays open and streams events in real-time via Server-Sent Events. Use cases:
  • Capture WebSocket frames that the page receives (live data feeds)
  • Monitor network API calls the page makes (XHR/Fetch responses)
  • Watch DOM elements for changes (price updates, content changes)

Endpoint

GET https://scraping-api.55-tech.com/browser/stream

Headers

Same headers as /browser, plus:
HeaderDefaultDescription
X-Capturenetwork,ws,consoleComma-separated event types to stream
X-DOM-SelectorCSS selector to watch for DOM mutations (requires dom in capture)
X-Network-FilterRegex filter for network URLs (only matching are streamed)
X-WS-FilterRegex filter for WebSocket URLs (only matching are streamed)
X-JS-After-LoadJavaScript to execute after page load (e.g. click a button, trigger navigation)

SSE events

EventDescription
connectedBrowser loaded, streaming started (includes cookies)
networkHTTP response captured (XHR/Fetch) — includes body, status, content-type
ws_openPage opened a WebSocket connection
ws_messageWebSocket frame received by the page
ws_closePage WebSocket closed
domDOM mutation on watched selector
consoleConsole output (warn/error)
errorError, stream ends
doneSession ended (timeout or closed)

Example: Capture page WebSocket feed

curl -N -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/live" \
  -H "X-Capture: ws" \
  -H "X-Wait-Strategy: networkidle" \
  -H "X-Timeout: 120" \
  https://scraping-api.55-tech.com/browser/stream
Events arrive as SSE:
event: connected
data: {"type":"connected","url":"https://example.com/live","agent_id":"scraping-us5"}

event: ws_open
data: {"type":"ws_open","url":"wss://feed.example.com/ws","ws_id":"1234"}

event: ws_message
data: {"type":"ws_message","data":"{\"price\":1.95,\"event\":\"update\"}","ws_id":"1234"}

event: ws_message
data: {"type":"ws_message","data":"{\"price\":2.10,\"event\":\"update\"}","ws_id":"1234"}

Example: Monitor network API calls

curl -N -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/dashboard" \
  -H "X-Capture: network" \
  -H "X-Network-Filter: api\\.example\\.com" \
  -H "X-Wait-Strategy: networkidle" \
  https://scraping-api.55-tech.com/browser/stream

Example: Watch DOM element for changes

curl -N -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/prices" \
  -H "X-Capture: dom" \
  -H "X-DOM-Selector: #price-table" \
  -H "X-Wait-Strategy: selector" \
  -H "X-Wait-Selector: #price-table" \
  https://scraping-api.55-tech.com/browser/stream

Python

import requests
import json

resp = requests.get("https://scraping-api.55-tech.com/browser/stream", headers={
    "X-API-Key": "YOUR_API_KEY",
    "X-Target-URL": "https://example.com/live",
    "X-Capture": "ws",
    "X-Wait-Strategy": "networkidle",
    "X-Timeout": "120",
}, stream=True)

for line in resp.iter_lines():
    if line.startswith(b"data: "):
        event = json.loads(line[6:])
        if event["type"] == "ws_message":
            print(event["data"])

Next steps

HTTP Fetch

For pages that don’t need JavaScript rendering, use the faster /fetch endpoint.

Error handling

Status codes, block detection, and retry strategies.