Examples
Use these REST API examples to perform quick, common tasks.
Fetch rendered HTML from a URL Capture fully rendered HTML from a webpage after JavaScript execution.
Take a screenshot of the visible viewport Capture a screenshot of a fully rendered webpage from a URL or custom HTML.
Take a screenshot of the full page Capture a screenshot of an entire scrollable webpage, not just the visible viewport.
Take a screenshot of an authenticated page Capture a screenshot of a webpage that requires login by providing session cookies.
Generate a PDF Generate a PDF from a URL or custom HTML and CSS.
Extract Markdown from a URL Convert a webpage's content into Markdown format.
Capture a snapshot from a URL Capture both the rendered HTML and a screenshot from a webpage in a single request.
Scrape headings and links from a URL Extract structured data from specific elements on a webpage using CSS selectors.
Capture structured data with an AI prompt and JSON schema Extract structured data from a webpage using AI using a prompt or JSON schema.
Retrieve links from a URL Retrieve all links from a webpage, including hidden ones.
Use Workers Bindings for dynamic, multi-step browser automation with Puppeteer, Playwright, or Stagehand.
Get page metrics with Puppeteer Use Puppeteer to navigate to a page and retrieve performance metrics in a Worker.
Take a screenshot with Playwright Use Playwright to navigate to a page, interact with elements, and capture a screenshot.
Run test assertions with Playwright Use Playwright assertions to test web applications in a Worker.
Generate a trace with Playwright Capture detailed execution logs for debugging with Playwright tracing.
Reuse browser sessions Improve performance by reusing browser sessions across requests.
Persist sessions with Durable Objects Use Durable Objects to maintain long-running browser sessions.
AI-powered browser automation with Stagehand Use natural language instructions to automate browser tasks with AI.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2026 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-