Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.55-tech.com/llms.txt

Use this file to discover all available pages before exploring further.

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 300 for /browser)
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-StepsNoJSON array of sequential browser actions (details)
X-Block-ResourcesNoComma-separated resource types to block: image,font,stylesheet,media. No default blocking
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.

Steps

Execute sequential browser actions after the page loads — login flows, multi-page navigation, form filling, clicking through to specific content. Pass a JSON array via the X-Steps header:
X-Steps: [{"action":"type","selector":"#email","value":"user@example.com"},{"action":"click","selector":"#submit"},{"action":"waitNavigation"}]
Available actions:
ActionParamsDescription
navigateurl, waitUntilNavigate to a new URL
clickselectorClick an element (human-like mouse movement)
typeselector, value, delayType text into an input (auto-clears first)
clearselectorClear an input field
selectselector, valueSelect a dropdown option by value
waitselector, timeoutWait for an element to appear
waitNavigationwaitUntilWait for page navigation to complete
waitHiddenselectorWait for an element to disappear
scrollselector or x, yScroll to an element or by pixels
hoverselectorHover over an element
presskeyPress a keyboard key (Enter, Tab, Escape)
focusselectorFocus an element
evaluateexpressionRun JavaScript in the page
screenshotfullPageCapture a screenshot (returned in step result)
sleepmsWait a fixed number of milliseconds
Each step runs after the previous completes. Add "continueOnError": true to a step to keep going if it fails. Example: Login → navigate → capture
curl -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/login" \
  -H 'X-Steps: [
    {"action": "wait", "selector": "#login-form"},
    {"action": "type", "selector": "#email", "value": "user@example.com"},
    {"action": "type", "selector": "#password", "value": "secret"},
    {"action": "click", "selector": "#submit"},
    {"action": "waitNavigation"},
    {"action": "navigate", "url": "https://example.com/dashboard"},
    {"action": "wait", "selector": ".data-table"}
  ]' \
  -H "X-Timeout: 120" \
  https://scraping-api.55-tech.com/browser
Example: Login then stream live data
curl -N -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Target-URL: https://example.com/login" \
  -H "X-Capture: ws,network" \
  -H 'X-Steps: [
    {"action": "type", "selector": "#email", "value": "user@example.com"},
    {"action": "type", "selector": "#password", "value": "secret"},
    {"action": "click", "selector": "#submit"},
    {"action": "waitNavigation"},
    {"action": "navigate", "url": "https://example.com/live-feed"},
    {"action": "wait", "selector": ".feed-container"}
  ]' \
  https://scraping-api.55-tech.com/browser/stream
Steps work on both /browser (capture after all steps complete) and /browser/stream (stream during and after steps — step results arrive as step_ok / step_error events).

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. Only data-carrying requests (XHR/Fetch API calls) are captured — full HTML pages and JavaScript bundles are filtered out. No resources are blocked by default so pages load fully and widgets initialize correctly. Default wait strategy is networkidle. All data is gzip-compressed. Use cases:
  • Capture WebSocket frames that the page receives (live data feeds)
  • Monitor XHR/Fetch API calls the page makes (the actual data endpoints)
  • Watch DOM elements for changes (price updates, content changes)

Endpoint

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

Headers

Same headers as /browser, with different defaults: X-Wait-Strategy defaults to networkidle, X-Timeout defaults to 0 (runs until disconnect, 24h safety cap), no resource blocking. 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, if set, or client disconnect)

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-Timeout: 120" \
  https://scraping-api.55-tech.com/browser/stream
{
  "type": "connected",
  "url": "https://example.com/live",
  "status": 200,
  "agent_id": "scraping-us5",
  "data": "{\"title\":\"Live Feed\",\"cookies\":[{\"name\":\"session\",\"value\":\"abc\"}]}",
  "timestamp": 1775511253069
}
The SSE stream runs until you disconnect. Each event arrives as event: type\ndata: json\n\n. Use curl -N (no buffering) to see events in real-time.

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" \
  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",
}, 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.