Skip to main content
Fetch loads a URL in a cloud browser and returns the outputs you specify—markdown, HTML, links, screenshots, structured JSON, or a branding profile. It’s the core building block for web scraping with Hyperbrowser.
For the full API schema, see the Fetch API Reference.

Quick Start

1

Install the SDK

2

Fetch a page


Response

The response includes a jobId, overall status, and the outputs under data:

Outputs

Use outputs.formats to specify what data you want returned.
outputs.formats cannot contain duplicate output types (e.g. two screenshots).
Extract structured data from the page using prompt, schema, or both:
  • prompt only — Describe what you want in natural language. A schema is auto-generated from the prompt.
  • schema only — Provide a JSON Schema (or Zod/Pydantic equivalent) defining the exact output structure.
  • prompt and schema — The schema defines the output structure, while the prompt provides additional guidance for the extraction.
For best results, provide both a schema and a prompt. The schema defines exactly how you want the data formatted, and the prompt provides context to guide the extraction.
Prompt only (schema auto-generated):
Schema only:
Both prompt and schema (recommended):
Node SDK: You can pass a Zod schema directly to the schema field, and it will be automatically converted to JSON Schema.Python SDK: You can pass a Pydantic model class directly to the schema field, and it will be automatically converted to JSON Schema.
Screenshot cropping rules:
  • fullPage and cropToContent are mutually exclusive.
  • If both cropToContentMaxHeight and cropToContentMinHeight are set, max must be ≥ min.
  • Crop dimensions must be between 100 and 8000 pixels.
Extract a structured brand profile for the page: color roles (primary, secondary, accent, background, text), typography, logo + favicon, primary/secondary button styles, personality, and confidence scores. Combines in-browser DOM analysis with an LLM pass over the detected elements.
The response data.branding object includes:
Branding works identically in Crawl — each crawled page gets its own branding profile.

Output Controls

Control what gets extracted and returned:

Browser & Stealth

Configure how the cloud browser runs: Control page load behavior and timing:

Cache Controls

Control caching behavior for fetch results:
Using cache can improve response times for frequently accessed pages. Set maxAgeSeconds based on how fresh you need the data to be.

X402 Support

For agentic workflows, Hyperbrowser supports x402 payment for the Fetch API, enabling agents to programmatically pay for browser sessions at request time using USDC, with payment handled inline via HTTP 402 responses. See the X402 Integration page for details.