> ## 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.

# Live browser session with event streaming (SSE)

> Open a browser, navigate to the target URL, and stream back events in real-time via Server-Sent Events. Only captures XHR/Fetch API responses and WebSocket frames — HTML documents and scripts are filtered out. No resources are blocked by default so pages load fully. Default wait strategy is networkidle. All data is gzip-compressed.

The session runs until the client disconnects (24h safety cap). Set X-Timeout to limit the duration.



## OpenAPI

````yaml /zh/scraping-api/openapi.json get /browser/stream
openapi: 3.1.0
info:
  title: 55 Tech Scraping API
  description: >-
    Distributed fetch network. Route HTTP, browser, WebSocket, and AMQP requests
    through 80+ geo-distributed agents with health-aware routing and block
    detection.
  version: 2.2.0
  contact:
    name: 55 Tech Support
    email: contact@55-tech.com
servers:
  - url: https://scraping-api.55-tech.com
    description: Production
security:
  - ApiKeyHeader: []
tags:
  - name: Fetch
    description: Proxy HTTP requests through the agent network.
  - name: Browser
    description: Fetch with full JavaScript rendering, cookies, and screenshots.
  - name: Network
    description: Agent registry, network status, and domain health.
  - name: AMQP
    description: AMQP/RabbitMQ consumer relay via SSE.
  - name: Usage
    description: Per-key usage metrics.
  - name: Debug
    description: Debug and diagnostic endpoints.
  - name: System
    description: Health checks and system endpoints.
paths:
  /browser/stream:
    get:
      tags:
        - Browser
      summary: Live browser session with event streaming (SSE)
      description: >-
        Open a browser, navigate to the target URL, and stream back events in
        real-time via Server-Sent Events. Only captures XHR/Fetch API responses
        and WebSocket frames — HTML documents and scripts are filtered out. No
        resources are blocked by default so pages load fully. Default wait
        strategy is networkidle. All data is gzip-compressed.


        The session runs until the client disconnects (24h safety cap). Set
        X-Timeout to limit the duration.
      operationId: browser_stream
      parameters:
        - $ref: '#/components/parameters/XTargetURL'
        - name: X-Capture
          in: header
          description: 'Comma-separated event types to stream: network, ws, dom, console.'
          schema:
            type: string
            default: network,ws,console
        - name: X-DOM-Selector
          in: header
          description: CSS selector to watch for DOM mutations (requires dom in X-Capture).
          schema:
            type: string
        - name: X-Network-Filter
          in: header
          description: Regex filter for network URLs. Only matching responses are streamed.
          schema:
            type: string
        - name: X-WS-Filter
          in: header
          description: >-
            Regex filter for WebSocket URLs. Only matching connections are
            streamed.
          schema:
            type: string
        - name: X-JS-After-Load
          in: header
          description: >-
            JavaScript to execute after page load (e.g. click a button, trigger
            navigation).
          schema:
            type: string
        - name: X-Steps
          in: header
          description: >-
            JSON array of sequential browser actions (navigate, click, type,
            wait, etc.). Executes after page load, before streaming starts. Step
            results arrive as step_ok/step_error SSE events.
          schema:
            type: string
        - name: X-Wait-Strategy
          in: header
          description: >-
            When the page is ready before streaming starts: load, networkidle,
            or selector.
          schema:
            type: string
            default: networkidle
        - name: X-Wait-Selector
          in: header
          description: 'CSS selector to wait for (with X-Wait-Strategy: selector).'
          schema:
            type: string
        - name: X-Proxy
          in: header
          description: Route through a proxy (http:// or socks5://).
          schema:
            type: string
        - name: X-Block-Resources
          in: header
          description: >-
            Comma-separated resource types to block: image, font, stylesheet,
            media. No default blocking — pages load fully.
          schema:
            type: string
        - name: Cookie
          in: header
          description: Cookies to inject (name=value; name2=value2).
          schema:
            type: string
        - name: X-Cookies
          in: header
          description: Cookies as JSON array for full control.
          schema:
            type: string
        - $ref: '#/components/parameters/XGeo'
        - $ref: '#/components/parameters/XAgent'
        - $ref: '#/components/parameters/XTimeout'
      responses:
        '200':
          description: >-
            SSE event stream. Events: connected, network, ws_open, ws_message,
            ws_close, dom, console, error, done.
          content:
            text/event-stream:
              schema:
                type: string
              example: >+
                event: connected

                data:
                {"type":"connected","url":"https://example.com","agent_id":"scraping-us5"}


                event: ws_message

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

        '401':
          description: Missing API key.
        '403':
          description: Invalid API key.
        '429':
          description: Rate limit exceeded.
        '502':
          description: No healthy agent available.
components:
  parameters:
    XTargetURL:
      name: X-Target-URL
      in: header
      description: >-
        Target URL (no encoding needed). Recommended for URLs with query
        parameters.
      schema:
        type: string
    XGeo:
      name: X-Geo
      in: header
      description: >-
        Target countries as comma-separated ISO codes (e.g. US,DE,AT). Aliases:
        X-Geo-CC, X-CC, X-Country, X-Geo-Strict.
      schema:
        type: string
    XAgent:
      name: X-Agent
      in: header
      description: >-
        Route through specific agent(s) by slug (e.g. de1) or comma-separated
        list for random pick (e.g. de1,at5,us3).
      schema:
        type: string
    XTimeout:
      name: X-Timeout
      in: header
      description: 'Override request timeout in seconds (default: 30).'
      schema:
        type: string
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key passed in the X-API-Key header.

````