# Scrapfly Documentation

## Table of Contents

### Dashboard

- [Intro](https://scrapfly.io/docs)
- [Project](https://scrapfly.io/docs/project)
- [Account](https://scrapfly.io/docs/account)
- [Workspace & Team](https://scrapfly.io/docs/workspace-and-team)
- [Billing](https://scrapfly.io/docs/billing)

### Products

#### MCP Server

- [Getting Started](https://scrapfly.io/docs/mcp/getting-started)
- [Tools & API Spec](https://scrapfly.io/docs/mcp/tools)
- [Authentication](https://scrapfly.io/docs/mcp/authentication)
- [Examples & Use Cases](https://scrapfly.io/docs/mcp/examples)
- [FAQ](https://scrapfly.io/docs/mcp/faq)
##### Integrations

- [Overview](https://scrapfly.io/docs/mcp/integrations)
- [Claude Desktop](https://scrapfly.io/docs/mcp/integrations/claude-desktop)
- [Claude Code](https://scrapfly.io/docs/mcp/integrations/claude-code)
- [Codex](https://scrapfly.io/docs/mcp/integrations/codex)
- [Gemini CLI](https://scrapfly.io/docs/mcp/integrations/gemini-cli)
- [Antigravity](https://scrapfly.io/docs/mcp/integrations/antigravity)
- [OpenCode](https://scrapfly.io/docs/mcp/integrations/opencode)
- [ChatGPT](https://scrapfly.io/docs/mcp/integrations/chatgpt)
- [Cursor](https://scrapfly.io/docs/mcp/integrations/cursor)
- [Cline](https://scrapfly.io/docs/mcp/integrations/cline)
- [Windsurf](https://scrapfly.io/docs/mcp/integrations/windsurf)
- [Zed](https://scrapfly.io/docs/mcp/integrations/zed)
- [Roo Code](https://scrapfly.io/docs/mcp/integrations/roo-code)
- [VS Code](https://scrapfly.io/docs/mcp/integrations/vscode)
- [LangChain](https://scrapfly.io/docs/mcp/integrations/langchain)
- [LlamaIndex](https://scrapfly.io/docs/mcp/integrations/llamaindex)
- [CrewAI](https://scrapfly.io/docs/mcp/integrations/crewai)
- [OpenAI](https://scrapfly.io/docs/mcp/integrations/openai)
- [n8n](https://scrapfly.io/docs/mcp/integrations/n8n)
- [Make](https://scrapfly.io/docs/mcp/integrations/make)
- [Zapier](https://scrapfly.io/docs/mcp/integrations/zapier)
- [Vapi AI](https://scrapfly.io/docs/mcp/integrations/vapi)
- [Agent Builder](https://scrapfly.io/docs/mcp/integrations/agent-builder)
- [Custom Client](https://scrapfly.io/docs/mcp/integrations/custom-client)


#### Web Scraping API

- [Getting Started](https://scrapfly.io/docs/scrape-api/getting-started)
- [API Specification]()
- [Monitoring](https://scrapfly.io/docs/monitoring)
- [Monitoring - Prometheus Metrics](https://scrapfly.io/docs/monitoring/prometheus)
- [Customize Request](https://scrapfly.io/docs/scrape-api/custom)
- [Debug](https://scrapfly.io/docs/scrape-api/debug)
- [Unblocker (formerly ASP)](https://scrapfly.io/docs/scrape-api/unblocker)
- [Proxy](https://scrapfly.io/docs/scrape-api/proxy)
- [Proxy Mode](https://scrapfly.io/docs/scrape-api/proxy-mode)
- [Proxy Mode - Screaming Frog](https://scrapfly.io/docs/scrape-api/proxy-mode/screaming-frog)
- [Proxy Mode - Apify](https://scrapfly.io/docs/scrape-api/proxy-mode/apify)
- [(Auto) Data Extraction](https://scrapfly.io/docs/scrape-api/extraction)
- [Javascript Rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering)
- [Javascript Scenario](https://scrapfly.io/docs/scrape-api/javascript-scenario)
- [SSL](https://scrapfly.io/docs/scrape-api/ssl)
- [DNS](https://scrapfly.io/docs/scrape-api/dns)
- [Cache](https://scrapfly.io/docs/scrape-api/cache)
- [Batch (Multi-URL Scraping)](https://scrapfly.io/docs/scrape-api/batch)
- [Session](https://scrapfly.io/docs/scrape-api/session)
- [Webhook](https://scrapfly.io/docs/scrape-api/webhook)
- [Schedule](https://scrapfly.io/docs/scrape-api/schedule)
- [Screenshot](https://scrapfly.io/docs/scrape-api/screenshot)
- [Errors](https://scrapfly.io/docs/scrape-api/errors)
- [Timeout](https://scrapfly.io/docs/scrape-api/understand-timeout)
- [Throttling](https://scrapfly.io/docs/throttling)
- [Troubleshoot](https://scrapfly.io/docs/scrape-api/troubleshoot)
- [Billing](https://scrapfly.io/docs/scrape-api/billing)
- [FAQ](https://scrapfly.io/docs/scrape-api/faq)

#### Crawler API

- [Getting Started](https://scrapfly.io/docs/crawler-api/getting-started)
- [API Specification]()
- [Retrieving Results](https://scrapfly.io/docs/crawler-api/results)
- [WARC Format](https://scrapfly.io/docs/crawler-api/warc-format)
- [Data Extraction](https://scrapfly.io/docs/crawler-api/extraction-rules)
- [Search](https://scrapfly.io/docs/crawler-api/search)
- [Prompt & Extract](https://scrapfly.io/docs/crawler-api/prompt)
- [Auto Refresh](https://scrapfly.io/docs/crawler-api/refresh)
- [Webhook](https://scrapfly.io/docs/crawler-api/webhook)
- [Schedule](https://scrapfly.io/docs/crawler-api/schedule)
- [Billing](https://scrapfly.io/docs/crawler-api/billing)
- [Errors](https://scrapfly.io/docs/crawler-api/errors)
- [Troubleshoot](https://scrapfly.io/docs/crawler-api/troubleshoot)
- [FAQ](https://scrapfly.io/docs/crawler-api/faq)

#### Screenshot API

- [Getting Started](https://scrapfly.io/docs/screenshot-api/getting-started)
- [API Specification]()
- [Accessibility Testing](https://scrapfly.io/docs/screenshot-api/accessibility)
- [Webhook](https://scrapfly.io/docs/screenshot-api/webhook)
- [Schedule](https://scrapfly.io/docs/screenshot-api/schedule)
- [Billing](https://scrapfly.io/docs/screenshot-api/billing)
- [Errors](https://scrapfly.io/docs/screenshot-api/errors)

#### Extraction API

- [Getting Started](https://scrapfly.io/docs/extraction-api/getting-started)
- [API Specification]()
- [Rules Template](https://scrapfly.io/docs/extraction-api/rules-and-template)
- [LLM Extraction](https://scrapfly.io/docs/extraction-api/llm-prompt)
- [AI Auto Extraction](https://scrapfly.io/docs/extraction-api/automatic-ai)
- [Webhook](https://scrapfly.io/docs/extraction-api/webhook)
- [Billing](https://scrapfly.io/docs/extraction-api/billing)
- [Errors](https://scrapfly.io/docs/extraction-api/errors)
- [FAQ](https://scrapfly.io/docs/extraction-api/faq)

#### Data API


#### Proxy Saver

- [Getting Started](https://scrapfly.io/docs/proxy-saver/getting-started)
- [Fingerprints](https://scrapfly.io/docs/proxy-saver/fingerprints)
- [Optimizations](https://scrapfly.io/docs/proxy-saver/optimizations)
- [SSL Certificates](https://scrapfly.io/docs/proxy-saver/certificates)
- [Protocols](https://scrapfly.io/docs/proxy-saver/protocols)
- [Pacfile](https://scrapfly.io/docs/proxy-saver/pacfile)
- [Secure Credentials](https://scrapfly.io/docs/proxy-saver/security)
- [Billing](https://scrapfly.io/docs/proxy-saver/billing)

#### Cloud Browser API

- [Getting Started](https://scrapfly.io/docs/cloud-browser-api/getting-started)
- [Proxy & Geo-Targeting](https://scrapfly.io/docs/cloud-browser-api/proxy)
- [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock)
- [Captcha Solver](https://scrapfly.io/docs/cloud-browser-api/captcha-solver)
- [Network Policy](https://scrapfly.io/docs/cloud-browser-api/network-policy)
- [File Downloads](https://scrapfly.io/docs/cloud-browser-api/file-downloads)
- [Session Resume](https://scrapfly.io/docs/cloud-browser-api/session-resume)
- [Human-in-the-Loop](https://scrapfly.io/docs/cloud-browser-api/human-in-the-loop)
- [Debug Mode](https://scrapfly.io/docs/cloud-browser-api/debug-mode)
- [Browser Extensions](https://scrapfly.io/docs/cloud-browser-api/extensions)
- [Credential Vault](https://scrapfly.io/docs/cloud-browser-api/credential-vault)
- [Native Browser MCP](https://scrapfly.io/docs/cloud-browser-api/mcp)
- [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
##### Integrations

- [Puppeteer](https://scrapfly.io/docs/cloud-browser-api/puppeteer)
- [Playwright](https://scrapfly.io/docs/cloud-browser-api/playwright)
- [Selenium](https://scrapfly.io/docs/cloud-browser-api/selenium)
- [Vercel Agent Browser](https://scrapfly.io/docs/cloud-browser-api/agent-browser)
- [Browser Use](https://scrapfly.io/docs/cloud-browser-api/browser-use)
- [Stagehand](https://scrapfly.io/docs/cloud-browser-api/stagehand)
- [1Password](https://scrapfly.io/docs/cloud-browser-api/1password)

- [Billing](https://scrapfly.io/docs/cloud-browser-api/billing)
- [Errors](https://scrapfly.io/docs/cloud-browser-api/errors)


### Tools

- [Antibot Detector](https://scrapfly.io/docs/tools/antibot-detector)

### SDK

- [Golang](https://scrapfly.io/docs/sdk/golang)
- [PHP](https://scrapfly.io/docs/sdk/php)
- [Python](https://scrapfly.io/docs/sdk/python)
- [Rust](https://scrapfly.io/docs/sdk/rust)
- [TypeScript](https://scrapfly.io/docs/sdk/typescript)
- [Scrapy](https://scrapfly.io/docs/sdk/scrapy)

### Integrations

- [Getting Started](https://scrapfly.io/docs/integration/getting-started)
- [LangChain](https://scrapfly.io/docs/integration/langchain)
- [LlamaIndex](https://scrapfly.io/docs/integration/llamaindex)
- [CrewAI](https://scrapfly.io/docs/integration/crewai)
- [Zapier](https://scrapfly.io/docs/integration/zapier)
- [Make](https://scrapfly.io/docs/integration/make)
- [n8n](https://scrapfly.io/docs/integration/n8n)

### Academy

- [Overview](https://scrapfly.io/academy)
- [Web Scraping Overview](https://scrapfly.io/academy/scraping-overview)
- [Tools](https://scrapfly.io/academy/tools-overview)
- [Reverse Engineering](https://scrapfly.io/academy/reverse-engineering)
- [Static Scraping](https://scrapfly.io/academy/static-scraping)
- [HTML Parsing](https://scrapfly.io/academy/html-parsing)
- [Dynamic Scraping](https://scrapfly.io/academy/dynamic-scraping)
- [Hidden API Scraping](https://scrapfly.io/academy/hidden-api-scraping)
- [Headless Browsers](https://scrapfly.io/academy/headless-browsers)
- [Hidden Web Data](https://scrapfly.io/academy/hidden-web-data)
- [JSON Parsing](https://scrapfly.io/academy/json-parsing)
- [Data Processing](https://scrapfly.io/academy/data-processing)
- [Scaling](https://scrapfly.io/academy/scaling)
- [Walkthrough Summary](https://scrapfly.io/academy/walkthrough-summary)
- [Scraper Blocking](https://scrapfly.io/academy/scraper-blocking)
- [Proxies](https://scrapfly.io/academy/proxies)

---

# MCP Tools &amp; API Specification

 The Scrapfly MCP Server provides **10 powerful tools** covering web scraping, screenshots, and live Cloud Browser sessions with AI-native MCP integration.

 **Pro Tip:** Call `scraping_instruction_enhanced` for a cheat-sheet of the scraping options when you are unsure which ones a target needs.

## Tools Overview

### Quick Jump

  **Scraping &amp; Anti-bot** [scraping\_instruction\_enhanced](#tool-instructions) [web\_get\_page](#tool-web-get-page) [web\_scrape](#tool-web-scrape) [screenshot](#tool-screenshot) [check\_if\_blocked](#tool-check-if-blocked)

  **Cloud Browser** [cloud\_browser\_open](#tool-cloud-browser-open) [cloud\_browser\_navigate](#tool-cloud-browser-navigate) [cloud\_browser\_close](#tool-cloud-browser-close) [cloud\_browser\_sessions](#tool-cloud-browser-sessions)

  **Documentation** [docs\_search](#tool-docs-search)

  **Monitoring** [monitoring\_get\_metrics](#tool-monitoring-get-metrics) [monitoring\_get\_target\_metrics](#tool-monitoring-get-target-metrics)

  **Alerting Beta** [alert\_metric\_families](#tool-alert-metric-families) [alert\_preview](#tool-alert-preview) [alert\_create](#tool-alert-create) [alert\_list / get / series / count-active](#tool-alert-list) [alert\_update / snooze / test / delete](#tool-alert-manage)

  **Account** [info\_account](#tool-info-account)

##  Scraping &amp; Anti-bot

##  scraping\_instruction\_enhanced

 Returns critical instructions and best practices for using Scrapfly scraping tools. Helps AI models make intelligent decisions about which parameters to use.

 **Optional:** No scraping tool requires this call. It returns option guidance for `web_get_page` and `web_scrape` when the right settings are unclear.

### Provides:

- **Parameter guidance** - When to use which options
- **Best practices** - Optimize for success rate and cost

- **Error handling** - What to do when things fail

### Example Usage

```
{ "tool": "scraping_instruction_enhanced" }
```

##  web\_get\_page

 Quick page fetch with sane defaults. Perfect for when you just need the content fast without complex configuration.

###  What it does automatically:

- Renders JavaScript by default
- Returns clean markdown or text content

- Handles anti-bot protection with the Unblocker
- Uses optimal defaults for most websites

| Parameter | Type | Description |
|---|---|---|
| **Required Parameters** |
| `url` | string | Target URL to scrape (must start with http:// or https://) |
| **Optional Parameters** |
| `format` | string | Output format: `markdown` (default), `axtree`, `text`, `json`, `clean_html`, `raw` |
| `format_options` | array | Format modifiers: `no_links`, `no_images`, `only_content` |
| `country` | string | ISO country code for proxy (e.g., `us`, `gb`, `de`) |
| `proxy_pool` | string | Proxy type: `public_datacenter_pool` (default), `public_residential_pool` |
| `rendering_wait` | integer | Wait time in milliseconds before capturing content |
| `capture_page` | boolean | Also capture a screenshot of the page |
| `capture_flags` | array | Screenshot options: `load_images`, `dark_mode`, `block_banners`, `print_media_format`, `high_quality` |
| `extraction_model` | string | Auto-extract structured data: `article`, `product`, `job_posting`, etc. |

### Example Usage

```
{
  "tool": "web_get_page",
  "parameters": {
    "url": "https://news.ycombinator.com",
    "format": "markdown",
    "format_options": ["only_content"]
  }
}
```

##  web\_scrape

 Advanced scraping tool with full control over every aspect. JavaScript rendering, custom headers, cookies, POST requests, and sophisticated browser automation scenarios.

###  Enterprise-grade control:

- **Browser automation** - Multi-step interactions
- **Authentication** - Login flows with cookies

- **Custom requests** - POST/PUT/PATCH
- **LLM extraction** - AI-powered data extraction

| Parameter | Type | Description |
|---|---|---|
| **Required Parameters** |
| `url` | string | Target URL to scrape |
| **Optional Parameters** |
| `render_js` | boolean | Enable JavaScript rendering with headless browser (default: true)  [ JavaScript rendering guide](https://scrapfly.io/docs/scrape-api/javascript-rendering) |
| `js_scenario` | array | Browser automation steps: `click`, `fill`, `scroll`, `wait`, `execute`, `condition`  [ Complete JS scenario reference](https://scrapfly.io/docs/scrape-api/javascript-scenario) |
| `unblocker` | boolean | Enable the Unblocker, formerly `asp` (default: true)  [ Learn about the Unblocker](https://scrapfly.io/docs/scrape-api/unblocker) |
| `extraction_prompt` | string | LLM prompt for AI-powered data extraction  [ LLM extraction guide](https://scrapfly.io/docs/scrape-api/extraction#llm_extraction) |
| `extraction_model` | string | Pre-trained extraction model (product, article, etc.)  [ Available models](https://scrapfly.io/docs/scrape-api/extraction#ai_automatic_extraction) |
| `format` | string | Output format: `markdown` (default), `axtree`, `text`, `json`, `clean_html`, `raw` |
| `format_options` | array | Format modifiers: `no_links`, `no_images`, `only_content` |
| `method` | string | HTTP method: GET (default), POST, PUT, PATCH, OPTIONS |
| `headers` | object | Custom HTTP headers |
| `cookies` | array | Cookies to send with request  [ Session management](https://scrapfly.io/docs/scrape-api/session) |
| `body` | string | Request body for POST/PUT/PATCH |
| `screenshots` | array | Capture multiple screenshots (fullpage or CSS selector)  [ Screenshot API reference](https://scrapfly.io/docs/scrape-api/screenshot) |
| `screenshot_flags` | array | Screenshot options: `load_images`, `dark_mode`, `block_banners`, `print_media_format`, `high_quality` |
| `cache` | boolean | Enable response caching  [ Caching guide](https://scrapfly.io/docs/scrape-api/cache) |
| `cache_ttl` | integer | Cache TTL in seconds when cache is true |
| `cache_clear` | boolean | If true, bypass &amp; clear cache for this URL |
| `retry` | boolean | Enable automatic retry on transient errors (default: true) |
| `timeout` | integer | Server-side timeout in milliseconds, 150000 at most. With the Unblocker (on by default) or `retry: true` the tool sends no timeout and the API sets its own |
| `rendering_wait` | integer | Wait time in milliseconds before returning response  [ Learn about JavaScript rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering) |
| `wait_for_selector` | string | Wait for this CSS selector to appear in the page when rendering JS |
| `js` | string | JavaScript to execute on the page |
| `lang` | array | Languages to use for the request (Accept-Language header) |
| `country` | string | Proxy location (ISO 3166-1 alpha-2 code, e.g., "us", "gb", "de")  [ Geo-targeting options](https://scrapfly.io/docs/scrape-api/proxy#geo) |
| `proxy_pool` | string | `public_datacenter_pool` (default) or `public_residential_pool`  [ Compare proxy pools](https://scrapfly.io/docs/scrape-api/proxy#proxy-pools) |

### Example: Login Flow

```
{
  "tool": "web_scrape",
  "parameters": {
    "url": "https://web-scraping.dev/login",
    "render_js": true,
    "js_scenario": [
      { "fill": { "selector": "input[name='username']", "value": "myuser" } },
      { "fill": { "selector": "input[name='password']", "value": "mypass" } },
      { "click": { "selector": "button[type='submit']" } },
      { "wait_for_navigation": { "timeout": 5000 } }
    ]
  }
}
```

### Example: LLM Extraction

```
{
  "tool": "web_scrape",
  "parameters": {
    "url": "https://web-scraping.dev/products",
    "extraction_prompt": "Extract all product names, prices, and ratings as a JSON array"
  }
}
```

##  screenshot

 Capture high-quality screenshots of any webpage. Full page or specific elements using CSS selectors.

  [ Complete Screenshot API documentation](https://scrapfly.io/docs/scrape-api/screenshot)

### Parameters

| Parameter | Type | Description |
|---|---|---|
| **Required Parameters** |
| `url` | string | Target URL to capture |
| **Optional Parameters** |
| `capture` | string | `fullpage` (default) or CSS selector |
| `format` | string | Image format: `jpg` (default), `png`, `webp`, `gif` |
| `resolution` | string | Screen resolution (e.g., "1920x1080", default) |
| `options` | array | Options: `load_images`, `dark_mode`, `block_banners`, `print_media_format`  [ Options reference](https://scrapfly.io/docs/scrape-api/screenshot#options) |
| `auto_scroll` | boolean | Automatically scroll to load lazy content |
| `wait_for_selector` | string | CSS selector to wait for before capturing |
| `rendering_wait` | integer | Wait time in milliseconds before capturing |
| `js` | string | JavaScript to execute before capturing |
| `country` | string | Proxy location (ISO 3166-1 alpha-2 code)  [ Geo-targeting](https://scrapfly.io/docs/scrape-api/proxy#geo) |
| `cache` | boolean | Enable response caching |
| `cache_ttl` | integer | Cache time-to-live in seconds |
| `cache_clear` | boolean | Bypass &amp; clear cache for this request |
| `webhook` | string | Webhook to call after the request completes |

### Example Usage

```
{
  "tool": "screenshot",
  "parameters": {
    "url": "https://web-scraping.dev/pricing",
    "capture": ".pricing-table",
    "format": "png",
    "options": ["load_images", "block_banners"]
  }
}
```

##  Account

##  info\_account

 Get real-time information about your Scrapfly account, including subscription details, usage statistics, rate limits, and billing information.

### Returns:

- **Account** - ID, currency, timezone, status
- **Project** - Name, quota, budget, networks

- **Subscription** - Plan, billing period, concurrency
- **Usage** - Credits, remaining quota, concurrent requests

 **No Parameters Required:** This tool uses your authenticated API key and requires no additional parameters.

### Example Usage

```
{ "tool": "info_account" }
```

##  Cloud Browser

##  cloud\_browser\_open

 Open a Cloud Browser session with [**Scrapium**](https://scrapfly.io/scrapium)'s **native MCP** enabled. Navigates to a URL, discovers [WebMCP tools](https://scrapfly.io/docs/cloud-browser-api/mcp) exposed by the page, and dynamically registers them as first-class callable tools in your current MCP session.

###  Dynamic WebMCP Tool Discovery

 Scrapium ships with a built-in MCP server that exposes page-registered tools via the [WebMCP](https://scrapfly.io/docs/cloud-browser-api/mcp) standard. When you call `cloud_browser_open`, the Scrapfly MCP server:

1. Allocates a Cloud Browser with the `DevToolsWebMCPSupport` browser feature and the `WebMCP` Blink feature
2. Enables the WebMCP CDP domain before navigating, so every tool the page registers on load is captured
3. Returns the names of those page tools in the `webmcp_tools` field of the response

 Your agent reads that list, calls `list_webmcp_tools` when it needs each tool's description and input schema, and runs one with `call_webmcp_tool`. The Scrapfly MCP server **proxies the call** to the browser session, which executes the tool in the page context and returns the result.

```
Your AI Agent
    │
    │ cloud_browser_open → response lists webmcp_tools: ["search", "addToCart"]
    │
    │ tools/call "call_webmcp_tool"
    │   args: {"tool_name": "search", "input": "{\"query\": \"laptop\"}"}
    ▼
Scrapfly MCP Server
    │
    │ proxies to the open browser session
    ▼
Scrapium (WebMCP)
    │
    │ navigator.modelContext executes search()
    ▼
Page returns structured result
```

 **Tools are page-specific.** Different pages register different WebMCP tools. When you call `cloud_browser_navigate`, the old tools are removed and new ones are discovered on the target page. Not all websites register WebMCP tools, it's an [early-preview standard](https://developer.chrome.com/blog/webmcp-epp) currently adopted by a growing number of sites.

### Parameters

| Parameter | Type | Description |
|---|---|---|
| `url` required | string | Target URL to open in the cloud browser |
| `country` | string | Proxy country code (ISO 3166-1 alpha-2) |
| `proxy_pool` | string | `datacenter` or `residential` |
| `timeout` | integer | Session timeout in seconds (default 900, max 1800) |
| `block_images` | boolean | Stub image requests to save bandwidth |
| `block_styles` | boolean | Stub stylesheet requests |
| `block_media` | boolean | Stub video/audio requests |
| `cache` | boolean | Enable HTTP cache for static resources |
| `debug` | boolean | Enable session recording for replay |

### Returns

- **session\_id**: use with `cloud_browser_navigate` and `cloud_browser_close`
- **url**: the URL the session landed on
- **status**: `connected`, or `reused` when a session was already open on that URL
- **mode**: `direct`, `unblock-auto` when a challenge was detected and bypassed on the way in, or `unblock` when opened through `browser_unblock`
- **webmcp\_tools**: names of the WebMCP tools the page registered, callable with `call_webmcp_tool`

An accessibility snapshot of the loaded page follows the JSON body in the same tool result.

 **Captchas are solved for you, and billed per captcha.** A session the MCP server opens, with `cloud_browser_open` or `browser_unblock`, has the [captcha solver](https://scrapfly.io/docs/cloud-browser-api/captcha-solver) on. Each captcha it solves is billed its price, $0.000375 to $0.0039 ($0.375 to $3.90 / 1K), 5 to 51 API credits by type and plan, on top of the session's time and bandwidth, and a captcha whose solve has started is billed however it ends ([captcha billing](https://scrapfly.io/docs/cloud-browser-api/captcha-solver#billing)).

### Example Usage

```
{
  "tool": "cloud_browser_open",
  "parameters": {
    "url": "https://shop.example.com/products",
    "country": "us",
    "proxy_pool": "residential"
  }
}
```

### Example Response

```
{
  "session_id": "5F3A9C1D2B8E4706A1C3D5E7F9B0C2A4",
  "url": "https://shop.example.com/products",
  "status": "connected",
  "mode": "direct",
  "webmcp_tools": ["search", "addToCart", "getFilters"]
}
```

 After this response, your agent runs a page tool with `call_webmcp_tool` (`tool_name: "search"`), and the Scrapfly server proxies the call to Scrapium's native MCP. [Learn more about Native Browser MCP →](https://scrapfly.io/docs/cloud-browser-api/mcp)

##  cloud\_browser\_navigate

 Navigate an active Cloud Browser session to a new URL. Re-discovers WebMCP tools on the new page, old page tools are removed and new ones are registered automatically.

### Parameters

| Parameter | Type | Description |
|---|---|---|
| `session_id` required | string | Active session ID from `cloud_browser_open` |
| `url` required | string | URL to navigate to |

### Example Usage

```
{
  "tool": "cloud_browser_navigate",
  "parameters": {
    "session_id": "unblock-abc123-example.com-01ABCD",
    "url": "https://shop.example.com/cart"
  }
}
```

##  cloud\_browser\_close

 Close a Cloud Browser session and release all resources. Any dynamically registered WebMCP tools for this session are removed from `tools/list`.

 **Always close your sessions.** Open sessions continue to consume credits until the timeout expires. Call `cloud_browser_close` when you're done to stop billing immediately.

### Parameters

| Parameter | Type | Description |
|---|---|---|
| `session_id` required | string | Session ID to terminate |

### Example Usage

```
{
  "tool": "cloud_browser_close",
  "parameters": {
    "session_id": "unblock-abc123-example.com-01ABCD"
  }
}
```

##  cloud\_browser\_sessions

 List all running Cloud Browser sessions for your account.

 **No Parameters Required:** This tool uses your authenticated API key and requires no additional parameters.

### Example Usage

```
{ "tool": "cloud_browser_sessions" }
```

##  check\_if\_blocked

 Checks whether a scrape result is a block page. When it is, names the anti-bot product that blocked it (or says the site blocked it with a page of its own) and says what to try next.

 **Server-side check:** This tool calls the Scrapfly `/classify` endpoint, which checks the response you submit with the same block detection as a live Scrapfly scrape. New detections reach it without an MCP client update. Each call costs 1 API credit.

###  What gets classified

The check recognizes two kinds of block:

- **Anti-bot products**: Cloudflare, DataDome, PerimeterX, Akamai, Kasada, Imperva/Incapsula, AWS WAF, Azure WAF, F5, CloudFront, Radware, Vercel, Fastly, QueueIt and others.
- **A site's own block page**: some websites block with a page of their own instead of an anti-bot product. Pass the `url` so the check can recognize those.

### Parameters

| Parameter | Type | Description |
|---|---|---|
| **Required Parameters** |
| `url` | string | URL the scraped response came from. Lets the check recognize the block page of that website. |
| `content` | string | Page content (HTML/text) from a scrape result. Use `raw` or `clean_html` format for best detection accuracy. |
| `status_code` | integer | HTTP status code from the scrape result (e.g. `200`, `403`, `429`, `503`). Some block pages are recognized by their status. |
| **Optional Parameters** |
| `response_headers` | object | Response headers from the scrape result. Lets the check recognize the headers anti-bot products send (e.g. `cf-mitigated`, `x-datadome`, the cookies they set). |

### Example Usage

After scraping a page, pass the URL, status, body, and headers to `check_if_blocked`:

```
{
  "tool": "check_if_blocked",
  "parameters": {
    "url": "https://web-scraping.dev/products",
    "content": "<html><head><title>Attention Required! | Cloudflare</title></head><body>...",
    "status_code": 403,
    "response_headers": {
      "cf-mitigated": "challenge",
      "cf-ray": "abc123-IAD"
    }
  }
}
```

### Example Response, Blocked

```
{
  "is_blocked": true,
  "antibot": "cloudflare",
  "block_type": "challenge",
  "confidence": "high",
  "details": "Cloudflare challenge detected via cf-mitigated header.",
  "recommendation": "Enable unblocker=true with render_js=true; if still blocked, switch to residential proxy pool.",
  "insights": [
    "Cloudflare challenge page recognized in the body and the headers"
  ]
}
```

### Example Response, Not Blocked

```
{
  "is_blocked": false,
  "confidence": "high",
  "details": "No antibot blocking detected. The page content appears to be legitimate.",
  "recommendation": "No action needed, the page was fetched successfully.",
  "insights": []
}
```

 **Tip:** For best results, scrape with `format: "raw"` or `format: "clean_html"`. The `markdown` format strips HTML tags that contain antibot detection signals. Status-code and header detection works regardless of content format; the `url` lets the check recognize a website's own block page.

##  Documentation

 Search the Scrapfly documentation corpus via hybrid vector + lexical retrieval. The index is rebuilt periodically from `/docs/*` markdown sections, so deep-link anchors resolve to specific subsections rather than the whole page.

###  `docs_search`

 Hybrid vector + lexical search over the full Scrapfly documentation. Use BEFORE answering product questions, interpreting error codes, or recommending parameters, the docs are authoritative. Reads the official `/docs/*` corpus (indexed via sitemap-driven crawl, refreshed periodically).

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| `query` | required | Free-form natural language, 2-200 characters. Examples: *"how do I configure proxy\_pool"*, *"ERR::ASP::SHIELD\_PROTECTION\_FAILED"*. |
| `limit` | optional | Max results to return. Default 10, max 100. |
| `product` | optional | Hard filter. Allowed: `web_scraping_api`, `screenshot_api`, `extraction_api`, `crawler_api`, `cloud_browser`, `proxy_saver`. |
| `product_context` | optional | Soft hint, lifts matching results without excluding others. Use when the user mentioned a product but you don't want a hard filter. |
| `include_generic` | optional | When combined with `product`, also keep cross-product/generic docs. Default `false`. |

#### Example Usage

```
{
  "tool": "docs_search",
  "parameters": {
    "query": "how do I configure proxy_pool",
    "limit": 5,
    "product_context": "web_scraping_api"
  }
}
```

#### Response Shape

```
{
  "count": 5,
  "query": "how do I configure proxy_pool",
  "results": [
    {
      "id": "abc123",
      "title": "Proxy Pool Configuration",
      "location": "https://scrapfly.io/docs/scrape-api/proxy#configuration",
      "text": "Configure proxy pool with public_residential_pool or public_datacenter_pool...",
      "product": "web_scraping_api",
      "score": 0.034,
      "highlights": ["how do I configure proxy_pool", "configure", "proxy_pool"]
    }
  ]
}
```

##  Monitoring

 Read-only tools that expose the Scrapfly Monitoring API to AI agents. Use them to ground threshold pickers, dashboards, and weekly-report agents in real account behavior, no more guessing what "normal" looks like.

 **Enterprise plan.** The underlying Monitoring API ships on the Enterprise tier and above. Requests from accounts without that entitlement return an authorization error; the tool descriptions stay visible so the agent can still reason about your data shape.

###  `monitoring_get_metrics`

 Fetch per-product aggregates over a time window. Pick `product` to scope to one of `scrape`, `screenshot`, `extraction`, `crawl`, or `browser` (Cloud Browser is session-based and has a distinct envelope shape from the request-based products).

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| `product` | required | One of `scrape`, `screenshot`, `extraction`, `crawl`, `browser`. |
| `period` | optional | Pre-set window: `last5m`, `last1h`, `last24h` (default), `last7d`, `subscription` (~1 month). Mutually exclusive with explicit `start`/`end`. |
| `aggregation` | optional | Request-based products only. One or more of `account`, `project`, `target`. |
| `include_webhook` | optional | Fold `origin=WEBHOOK` requests into the totals. Default `false`. |
| `proxy_pool` | optional | Cloud Browser only. Filter to one proxy pool name. |
| `start` / `end` | optional | Cloud Browser only. Explicit window in RFC3339 or `YYYY-MM-DD HH:MM:SS`. Both required together. Request-based products use `period`. |

#### Example Usage

```
{
  "tool": "monitoring_get_metrics",
  "parameters": {
    "product": "scrape",
    "period": "last7d",
    "aggregation": ["account", "target"]
  }
}
```

###  `monitoring_get_target_metrics`

 Per-domain aggregates for one target. Use when the user asks to alert on a specific site, or after `monitoring_get_metrics` with `aggregation=target` highlights one domain as the dominant failure source.

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| `product` | required | One of `scrape`, `screenshot`, `extraction`, `crawl`. (`browser` is rejected.) |
| `domain` | required | Target domain (e.g. `example.com`). |
| `group_subdomain` | optional | When `true`, collapse all subdomains into one bucket. Default `false`. |
| `period` / `include_webhook` | optional | Same semantics as `monitoring_get_metrics`. |
| `start` / `end` | optional | Explicit window in RFC3339 or `YYYY-MM-DD HH:MM:SS`. Both required together. Supported on all four request-based products here (unlike `monitoring_get_metrics`, where they are Cloud Browser only). |

#### Example Usage

```
{
  "tool": "monitoring_get_target_metrics",
  "parameters": {
    "product": "scrape",
    "domain": "web-scraping.dev",
    "period": "last7d"
  }
}
```

##  Alerting Beta

 The full alerting product surfaced as MCP tools. Combine these with `monitoring_get_metrics` to let an AI agent set up threshold rules from real account behavior, not from guesses.

 **Recommended workflow when a user says *"alert me if X drops"*:**

1. `monitoring_get_metrics`: see what "normal" looks like.
2. (Optional) `monitoring_get_target_metrics`: per-domain baseline.
3. `alert_metric_families`: pick a valid `metric_id`.
4. `alert_preview`: replay against history; confirm not too noisy.
5. `alert_create`: dry run, then `confirm=true` to commit.

###  `alert_metric_families`

 Discover legal `metric_id` values and their `allowed_dimensions`. ALWAYS call this BEFORE `alert_create` so the model picks a real metric.

#### Example Usage

```
{ "tool": "alert_metric_families" }
```

###  `alert_preview`

 Replay an unsaved rule against historical data and return "would-have-fired" markers. Use this to validate a proposed threshold isn't too noisy / too quiet before calling `alert_create`. The preview uses the same state-machine `Tick()` the live evaluator uses, so the count is identical to production.

#### Example Usage

```
{
  "tool": "alert_preview",
  "parameters": {
    "metric_id": "scrape.success_rate",
    "comparator": "lt",
    "threshold": 55,
    "sustained_minutes": 5,
    "range_minutes": 1440
  }
}
```

###  `alert_create`

 Persist a new alert. **Two-step**: call without `confirm=true` first to see the rendered request body, then re-call with `confirm=true` to commit.

 **Project binding:** leave `project_uuid` and `project_name` EMPTY: the alert is created in the project of the API key, the only one a key creates in. An alert of another project is created with that project's API key; another project's id, or `info_account.account.account_id` (the account ID, not a project ID), returns `ERR::ALERT::PROJECT_NOT_FOUND`.

#### Example Usage

```
{
  "tool": "alert_create",
  "parameters": {
    "name": "Scrape Success Rate Low",
    "metric_id": "scrape.success_rate",
    "comparator": "lt",
    "threshold": 55,
    "sustained_minutes": 5,
    "notify_channels": [
      {"kind": "email", "target": "ops@example.com"}
    ],
    "confirm": true
  }
}
```

###  `alert_list` / `alert_get` / `alert_series` / `alert_count_active`

Read-only inspectors over the alerts already configured for the API key's project.

| Tool | Purpose |
|---|---|
| `alert_list` | List the alerts of the API key's project. Filter by `state`, `metric_id`. |
| `alert_get` | Full alert row including the per-alert HMAC signing key for webhook channels. |
| `alert_series` | Time-series metric data + state-change transitions for the alert's graph. |
| `alert_count_active` | Number of alerts currently triggered/pending/recovering. Sub-millisecond. |

###  `alert_update` / `alert_snooze` / `alert_unsnooze` / `alert_test` / `alert_delete`

Lifecycle management for an existing alert. All mutating tools follow the two-step `confirm=true` dance.

| Tool | Purpose |
|---|---|
| `alert_update` | Patch fields. Server auto-snoozes for `sustained_minutes` after every edit so tuning doesn't refire. |
| `alert_snooze` | Mute notifications for a fixed window (`minutes`) or until the next OK transition (`until_resolved=true`). Exactly one must be set. |
| `alert_unsnooze` | Clear any active snooze. |
| `alert_test` | Fire a synthetic notification on every configured channel without touching alert state. Verify webhook URLs and email addresses end-to-end. |
| `alert_delete` | Permanent. Two-step confirm. |

  For the full alerting concept guide (states, dedup, no-data policy, webhook payload signing), see the [Alerting documentation](https://scrapfly.io/docs/alerting/getting-started).

## Response Format

All scraping tools (`web_get_page` and `web_scrape`) return responses in this format:

```
{
  "content": "The scraped content in requested format",
  "status_code": 200,
  "content_type": "text/html; charset=utf-8",
  "extraction_result": { /* Only if extraction_model or extraction_prompt was used */ },
  "screenshots": { /* Only if screenshots were captured */ },
  "errors": null,  // or error object if request failed
  "api_cost": 1,  // API credits this scrape consumed
  "cost_details": [ /* Per-item breakdown of api_cost */ ]
}
```

## Error Handling

 When a request fails, the `errors` field contains detailed information. [ View complete error reference](https://scrapfly.io/docs/scrape-api/errors)

  Example Error Response

```
{
  "errors": {
    "code": "ERR::ASP::SHIELD_PROTECTION_FAILED",
    "message": "Unblocker failed to get through the protection after retries",
    "http_code": 422,
    "retryable": true,
    "doc_url": "https://scrapfly.io/docs/scrape-api/errors#asp-shield"
  }
}
```

### Common Error Scenarios

- **Retryable errors** - Automatically retried
    Transient failures
- **Non-retryable errors** - Require config changes
    Invalid parameters, quota exceeded
- **Rate limits** - Check `info_account`
    Concurrency limits

- **Unblocker errors** - [Unblocker bypass failures](https://scrapfly.io/docs/scrape-api/errors#asp)
- **Proxy errors** - [Proxy connection issues](https://scrapfly.io/docs/scrape-api/errors#proxy)
- **Throttle errors** - [Rate limiting and quota issues](https://scrapfly.io/docs/scrape-api/errors#throttle)

## Billing &amp; Cost Optimization

 Each scraping request consumes credits based on features used. [ Complete billing guide](https://scrapfly.io/docs/scrape-api/billing)

   Cost Cards Feature breakdown   Cost Visualization Visual flow diagram

## 1

 credit

---

 **Base cost**

 Datacenter proxy

## +5

 credits

---

 **JavaScript rendering**

Headless browser

## Varies

 no flat fee

---

 **Unblocker**

 Anti-bot bypass, a protected target can add a fee or a pricier proxy pool

## 25

 credits, instead of the base cost

---

 **Residential proxies**

 High success rate

## 60

 credits per screenshot by default, set by your plan

---

 **Screenshots**

 Screenshot API, plus 1 credit per 100 KB of page over 4 MB

 **Cost Optimization Tips:**

- Use `web_get_page` for simple requests instead of `web_scrape`
- Start with datacenter proxies, escalate to residential only if needed
- Disable `render_js` for static pages
- Use caching for frequently accessed pages
- Check `scraping_instruction_enhanced` for optimal configurations

## Next Steps

- [See real-world examples](https://scrapfly.io/docs/mcp/examples) using these tools
- [Set up authentication](https://scrapfly.io/docs/mcp/authentication) for your MCP client
- [Learn about the underlying Scrape API](https://scrapfly.io/docs/scrape-api/getting-started)
- [Learn about Native Browser MCP](https://scrapfly.io/docs/cloud-browser-api/mcp) and WebMCP tool discovery
- [Read the FAQ](https://scrapfly.io/docs/mcp/faq) for common questions
