---
title: "Fetch a web page with X402 payment"
method: POST
path: "/x402/web/fetch"
---

# Fetch a web page with X402 payment

`POST /x402/web/fetch`

X402 payment endpoint. First request returns 402 with payment requirements. Retry with PAYMENT-SIGNATURE header containing cryptographic proof to get the actual data. See https://x402.gitbook.io/x402 for protocol details.

## Headers

- `PAYMENT-SIGNATURE` string

## Request body

- FetchParams
  - `url` string, required
  - `stealth` 'none' | 'auto' | 'ultra'
  - `outputs` FetchOutputOptions
    - `formats` union[]
      - union
        - FetchOutputMarkdown
          - `type` 'markdown', required
        - FetchOutputHtml
          - `type` 'html', required
        - FetchOutputLinks
          - `type` 'links', required
        - FetchOutputScreenshot
          - `fullPage` boolean
          - `format` 'jpeg' | 'png' | 'webp'
          - `cropToContent` boolean
          - `cropToContentMaxHeight` integer
          - `cropToContentMinHeight` integer
          - `type` 'screenshot', required
        - FetchOutputJson
          - `schema` object
          - `prompt` string — Natural language prompt describing what data to extract. If only prompt is provided, a schema is auto-generated from it. If both prompt and schema are provided, the schema defines the output structure while the prompt provides additional guidance for the extraction.
          - `type` 'json', required
        - FetchOutputBranding
          - `type` 'branding', required
        - 'markdown' | 'html' | 'links' | 'screenshot' | 'branding'
    - `sanitize` 'none' | 'basic' | 'advanced'
    - `includeSelectors` string[]
    - `excludeSelectors` string[]
    - `storageState` FetchStorageStateOptions
      - `localStorage` object
      - `sessionStorage` object
  - `browser` FetchBrowserOptions
    - `screen` ScreenConfig
      - `width` number
      - `height` number
    - `profileId` string
    - `solveCaptchas` string
    - `location` FetchBrowserLocationOptions
      - `country` string
      - `state` string
      - `city` string
  - `navigation` FetchNavigationOptions
    - `waitUntil` 'load' | 'domcontentloaded' | 'networkidle'
    - `timeoutMs` integer
    - `waitFor` integer
  - `cache` FetchCacheOptions
    - `maxAgeSeconds` integer

## Response `200`

Page fetched successfully (after valid payment)

- FetchResponse
  - `jobId` string, required
  - `status` 'completed' | 'failed' | 'pending' | 'running', required
  - `error` string, nullable
  - `data` FetchResponseData
    - `metadata` object
    - `html` string
    - `markdown` string
    - `links` string[]
    - `screenshot` string
    - `json` object
    - `branding` BrandingProfile — Visual brand profile extracted via DOM analysis + LLM enhancement. All fields optional; the server may return a partial profile when the LLM refuses or fails.
      - `colorScheme` string — Page color scheme. Common values: light, dark.
      - `colors` object — Color role assignments. Common keys: primary, secondary, accent, background, textPrimary, textSecondary, link.
      - `fonts` object[] — Cleaned brand fonts with roles.
        - `family` string
        - `role` string
      - `typography` object — Font families, stacks, and sizes. Keys: fontFamilies, fontStacks, fontSizes, lineHeights, fontWeights.
      - `spacing` object — Spacing scale. Common keys: baseUnit, borderRadius, padding, margins, gridGutter.
      - `components` object — Per-component style dictionaries. Common keys: buttonPrimary, buttonSecondary, input. Each value has background, textColor, borderColor, borderRadius, borderRadiusCorners, shadow.
      - `images` object — Brand images. Common keys: logo, logoHref, logoAlt, favicon, ogImage.
      - `personality` object — Brand personality. Common keys: tone, energy, targetAudience.
      - `designSystem` object — Detected design system. Common keys: framework, componentLibrary.
      - `confidence` object — Confidence scores (0-1). Common keys: buttons, colors, overall.

## Other responses

- `400` — Invalid request parameters
- `402` — Payment Required - returned on first request without PAYMENT-SIGNATURE header
- `500` — Server error

---

[API](https://skmtc.dev/hyperbrowser/apis/hyperbrowser-api.md) · [All operations](https://skmtc.dev/hyperbrowser/apis/hyperbrowser-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperbrowser/hyperbrowser-api/revisions/9d8b355ebbf2/schema)
