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

# Fetch with JavaScript rendering

> Fetch a URL with full JavaScript rendering. Works just like /fetch — all parameters via headers.

Use this instead of /fetch when the target requires JavaScript to load content.

If X-Expect-Selector or X-Expect-Contains is set and the page doesn't match, the API retries on a different node.



## OpenAPI

````yaml /zh/scraping-api/openapi.json get /browser
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:
    get:
      tags:
        - Browser
      summary: Fetch with JavaScript rendering
      description: >-
        Fetch a URL with full JavaScript rendering. Works just like /fetch — all
        parameters via headers.


        Use this instead of /fetch when the target requires JavaScript to load
        content.


        If X-Expect-Selector or X-Expect-Contains is set and the page doesn't
        match, the API retries on a different node.
      operationId: browser_fetch
      parameters:
        - $ref: '#/components/parameters/XTargetURL'
        - name: X-Wait-Strategy
          in: header
          description: >-
            When the page is ready: load (DOMContentLoaded), networkidle (no
            pending requests), or selector (wait for CSS selector).
          schema:
            type: string
            enum:
              - load
              - networkidle
              - selector
            default: load
        - name: X-Wait-Selector
          in: header
          description: 'CSS selector to wait for (only with X-Wait-Strategy: selector).'
          schema:
            type: string
        - name: X-Screenshot
          in: header
          description: Capture a full-page PNG screenshot. Set to 1 or true.
          schema:
            type: string
        - name: X-JS-Expression
          in: header
          description: >-
            JavaScript to evaluate after the page is ready. Result returned in
            js_result.
          schema:
            type: string
        - name: X-Expect-Selector
          in: header
          description: >-
            CSS selector that must exist in the rendered page. Retries on a
            different node if missing.
          schema:
            type: string
        - name: X-Expect-Contains
          in: header
          description: >-
            Substring that must exist in the page body. Retries on a different
            node if missing.
          schema:
            type: string
        - name: X-Steps
          in: header
          description: >-
            JSON array of sequential browser actions (navigate, click, type,
            wait, evaluate, screenshot, sleep, etc.). Executes after page load,
            before capture.
          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 for /browser.
          schema:
            type: string
        - name: Cookie
          in: header
          description: >-
            Cookies to inject before navigation (standard format: name=value;
            name2=value2).
          schema:
            type: string
        - name: X-Cookies
          in: header
          description: >-
            Cookies as JSON array for full control:
            [{"name":"s","value":"v","domain":".example.com"}].
          schema:
            type: string
        - $ref: '#/components/parameters/XGeo'
        - $ref: '#/components/parameters/XAgent'
        - $ref: '#/components/parameters/XTimeout'
      responses:
        '200':
          description: Rendered page with metadata, cookies, and optional screenshot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrowserFetchResponse'
              example:
                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
        '401':
          description: Missing API key.
        '403':
          description: Invalid API key.
        '429':
          description: Rate limit exceeded.
        '502':
          description: No healthy agent available, or browser/validation error.
        '504':
          description: Browser timeout.
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
  schemas:
    BrowserFetchResponse:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MetaInfo'
        raw:
          type: string
          nullable: true
          description: Rendered page body as text (when not JSON).
        raw_json:
          nullable: true
          description: Parsed JSON body (when response is valid JSON, otherwise null).
        cookies:
          type: array
          items:
            $ref: '#/components/schemas/BrowserCookie'
          description: All cookies captured during rendering, including httpOnly cookies.
        screenshot:
          type: string
          nullable: true
          description: Base64-encoded full-page PNG screenshot (null if not requested).
        js_result:
          nullable: true
          description: Return value of jsExpression evaluation (null if not provided).
    MetaInfo:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code from the origin.
        final_url:
          type: string
          description: Final URL after any redirects.
        http_version:
          type: string
          description: HTTP version used (e.g. HTTP/2).
        elapsed_ms:
          type: integer
          description: Round-trip time in milliseconds.
        blocked:
          type: boolean
          description: true if bot detection patterns were found in the response.
        headers:
          type: object
          additionalProperties:
            type: string
          description: Response headers from the origin.
        agent:
          type: object
          properties:
            id:
              type: string
              description: Node ID that served the request, e.g. scraping-de1.
        bytes:
          type: integer
          description: Response body size in bytes.
    BrowserCookie:
      type: object
      properties:
        name:
          type: string
          description: Cookie name.
        value:
          type: string
          description: Cookie value.
        domain:
          type: string
          description: Cookie domain (e.g. .example.com).
        path:
          type: string
          default: /
          description: Cookie path.
        secure:
          type: boolean
          default: false
          description: Secure flag.
        httpOnly:
          type: boolean
          default: false
          description: HttpOnly flag.
        sameSite:
          type: string
          default: Lax
          description: SameSite attribute (Strict, Lax, None).
        expires:
          type: number
          default: 0
          description: Expiry as Unix epoch. 0 = session cookie.
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key passed in the X-API-Key header.

````