# 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)
- [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)
- [Customize Request](https://scrapfly.io/docs/scrape-api/custom)
- [Debug](https://scrapfly.io/docs/scrape-api/debug)
- [Anti Scraping Protection](https://scrapfly.io/docs/scrape-api/anti-scraping-protection)
- [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)
- [Session](https://scrapfly.io/docs/scrape-api/session)
- [Webhook](https://scrapfly.io/docs/scrape-api/webhook)
- [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)
- [Webhook](https://scrapfly.io/docs/crawler-api/webhook)
- [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)
- [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)

#### 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)
- [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)
- [Bring Your Own Proxy](https://scrapfly.io/docs/cloud-browser-api/bring-your-own-proxy)
- [Browser Extensions](https://scrapfly.io/docs/cloud-browser-api/extensions)
##### 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)

- [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)
- [Python](https://scrapfly.io/docs/sdk/python)
- [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)

---

#   Web Scraping API Billing 

 [  View as markdown ](https://scrapfly.io/?view=markdown)   Copy for LLM    Copy for LLM  [     Open in ChatGPT ](https://chatgpt.com/?hints=search&prompt=Read%20from%20https%3A%2F%2Fscrapfly.io%2Fdocs%2Fscrape-api%2Fbilling%20so%20I%20can%20ask%20questions%20about%20it.) [     Open in Claude ](https://claude.ai/new?q=Read%20from%20https%3A%2F%2Fscrapfly.io%2Fdocs%2Fscrape-api%2Fbilling%20so%20I%20can%20ask%20questions%20about%20it.) [     Open in Perplexity ](https://www.perplexity.ai/search/new?q=Read%20from%20https%3A%2F%2Fscrapfly.io%2Fdocs%2Fscrape-api%2Fbilling%20so%20I%20can%20ask%20questions%20about%20it.) 

 

 

 Simple, adaptative credit-based pricing. Each scrape request costs credits based on enabled features like JavaScript rendering, proxy type, and anti-bot protection.

 

##   How Billing Works 

##### Credit-Based System

 Each API request consumes credits based on enabled features. The total cost is returned in the `X-Scrapfly-Api-Cost` header and detailed in the `context.cost` field of the JSON response.

- **TEXT** format (HTML, JSON, XML) requests are billed per request based on proxy type and features like JavaScript rendering.
- **BINARY** format (images, PDFs, downloads) requests are billed based on bandwidth usage in 100KB slices.
 
> [**CLOB**](https://scrapfly.io/docs/scrape-api/getting-started#handle_large_object) format is billed as **TEXT** format requests and [**BLOB**](https://scrapfly.io/docs/scrape-api/getting-started#handle_large_object) format is billed as **BINARY** format requests.

 

 

 

 

    TEXT Format HTML, JSON, XML, CSV, etc.    BINARY Format Images, PDFs, Downloads    Cost Flow Visual diagram  

  TEXT format requests are billed per request based on proxy type and enabled features (browser rendering, ASP, etc.). The `result.format=TEXT` field in the response confirms this billing model applies.

 | Feature | API Credits Cost |
|---|---|
| Base Request Cost (choose one proxy pool) |
| [Datacenter Proxies](https://scrapfly.io/docs/scrape-api/proxy) Default | 1 credit |
| [Residential Proxies](https://scrapfly.io/docs/scrape-api/proxy) `proxy_pool=public_residential_pool` | 25 credits |
| Additional Features (added to base cost) |
| [Browser Rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering) `render_js=true` | +5 credits |
| > **Note:** Proxy pool costs are mutually exclusive - choose either datacenter (1 credit) or residential (25 credits) as your base cost. [ASP](https://scrapfly.io/docs/scrape-api/anti-scraping-protection) may dynamically upgrade the proxy pool to bypass anti-bot protection, which can affect the final cost. |

####   High Bandwidth Requests 

- **Large HTML responses exceeding 1MB** - Bandwidth usage after the initial 1MB is billed as BINARY bandwidth
- **Data responses (JSON, CSV, XML, TXT)** exceeding 1MB - Billed as BINARY bandwidth after 1MB
- **Request body (POST/PUT/PATCH) exceeding 100KB** - Sent through the API, billed as BINARY bandwidth
- **Browser rendering includes 3MB free** - Additional data beyond 3MB is billed following BINARY bandwidth calculation
 
 

 

> **CDN Optimization:** With browser rendering, large static files (JSON, CSS, JS) are cached on our private CDN following HTTP Cache policy. Once served from our CDN, **it's not counted in bandwidth usage**. Browser rendering is already optimized by preventing image loads and caching static assets.

 

 Downloads are billed in slices of `100KB`. The first megabyte is free of charge. The billed size is available in the cost details of the response `context.cost` field. The `result.format=BINARY` field in the response confirms this billing model applies.

 | Network Type | API Credits Cost |
|---|---|
| [Datacenter Proxies](https://scrapfly.io/docs/scrape-api/proxy) | 3 credits per 100KB |
| [Residential Proxies](https://scrapfly.io/docs/scrape-api/proxy) | 10 credits per 100KB |

####   Cost Calculation Example 

#####   Example: Downloading a 5MB PDF 

 

**Configuration:** Datacenter proxy, 5MB file size

> **Calculation:** 
> • First 1MB: **Free** 
> • Remaining 4MB = 40 slices of 100KB 
> • Cost: 40 × 3 = **120 credits**

> **Total Cost:** 120 credits for a 5MB PDF download

 

 

 

 This flowchart visualizes how Web Scraping API billing works for the two distinct billing models: **TEXT format** (HTML, JSON, XML, etc.) and **BINARY format** (images, PDFs, downloads).

> Each path shows the cost calculation based on your request configuration: - **TEXT Format Path:** Choose proxy pool → Add browser rendering (optional) → Apply bandwidth fees (if over 1MB)
> - **BINARY Format Path:** Choose proxy pool → Bandwidth-based billing per 100KB (first 1MB free)



  Choose only the features you need to optimize spending

 

 

  **Learn More:** Each scrape request features a billing section on the [monitoring dashboard](https://scrapfly.io/dashboard/monitoring) with a detailed breakdown of the API credits used. 

##   Cost Examples 

 Here are practical examples showing how costs are calculated for different scenarios:

#####   Basic HTML Scrape 

 

**Configuration:**

 ```
{
  "url": "https://example.com",
  "proxy_pool": "public_datacenter_pool"
}
```

 

   

 

 

> **Cost:** **1 credit** 
> (Datacenter proxy, no browser rendering)

 

 

 

#####   With JavaScript Rendering 

 

**Configuration:**

 ```
{
  "url": "https://example.com",
  "proxy_pool": "public_datacenter_pool",
  "render_js": true
}
```

 

   

 

 

 **Cost:** 1 + 5 = **6 credits** 
(Datacenter + Browser) 

 

 

 

#####   Residential Proxy 

 

**Configuration:**

 ```
{
  "url": "https://example.com",
  "proxy_pool": "public_residential_pool"
}
```

 

   

 

 

> **Cost:** **25 credits** 
> (Residential proxy, no browser rendering)

 

 

 

#####   Full Features 

 

**Configuration:**

 ```
{
  "url": "https://example.com",
  "proxy_pool": "public_residential_pool",
  "render_js": true
}
```

 

   

 

 

> **Cost:** 25 + 5 = **30 credits** 
> (Residential + Browser)

 

 

 

 

##   Manage Spending 

 We offer a variety of tools to help you manage your spending and stay within your budget:

#####   Project Limits 

 

 Each [Scrapfly project](https://scrapfly.io/docs/project) can be restricted with:

- Specific credit budget
- Concurrency limits
- Disable Pay As You Go (PAG)
 
 

 

 

#####   Throttlers 

 

 [Throttlers](https://scrapfly.io/docs/throttling) define limits per scraped website and timeframe:

- Per-domain credit budget
- Daily or monthly limits
- Example: 10,000 credits/day for site A
 
 

 

 

#####   Per-Call Budget 

 

 Use the [`cost_budget`](https://scrapfly.io/docs/scrape-api/getting-started#api_param_cost_budget) parameter:

- Set maximum budget per request
- Request fails if cost exceeds budget
- Helps prevent unexpected charges
 
 

 

 

 

> **Default Pay As You Go Limit:** All accounts include a hard limit for Pay As You Go to avoid major issues. PAG usage is capped at **125% of your monthly quota**. You'll receive a notification when you reach 100% of your quota. 
> 
>  **Example:** With 1,000,000 API Credits/month, you can use up to 1,250,000 API Credits on PAG (total: 2,250,000 credits). 
> 
>  For ongoing operations reaching this limit, [contact us](https://scrapfly.io/docs/support) to increase the limit exceptionally. If you're on an ENTERPRISE plan and reaching this limit, [contact us](https://scrapfly.io/docs/support) to create a custom plan.

##   Scrape Failed Protection &amp; Fairness Policy 

 Scrapfly's **Scrape Failed Protection** ensures that failed scrapes are not billed to our customers. To prevent abuse, we also have a **fairness policy** in place.

> **Fairness Policy Trigger:** If more than **30% of failed traffic** with eligible status codes (≥400 and not excluded) is detected within a minimum one-hour period, the fairness policy will be disabled and usage will be billed.

#####   Eligible Status Codes 

 Status codes **greater than or equal to 400** and **not excluded** (see below) are eligible for Scrape Failed Protection.

> **Excluded status codes:** `400, 401, 402, 404, 405, 406, 407, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 422, 424, 426, 428, 456`

> **Account Suspension:** If an account deliberately scrapes a protected website without success and without using our [Anti Scraping Protection (ASP)](https://scrapfly.io/docs/scrape-api/anti-scraping-protection), the account may be suspended at the discretion of our account managers.

 

 

##   Tracking API Credit Use 

#####   Response Headers 

 Each API response includes the following headers to help you track your usage:

- `X-Scrapfly-Api-Cost` - API Credit cost for this request
- `X-Scrapfly-Remaining-Api-Credit` - API Credits remaining in your account
- `X-Scrapfly-Project-Remaining-Api-Credit` - Remaining API Credits for the project (if project has a limit)
- `X-Scrapfly-Project-Remaining-Pag-Budget` - Remaining PAG Budget for the project (if project has a budget limit)
 
> **Learn More:** You can also retrieve account information (quota, concurrency, etc.) via our [Account API](https://scrapfly.io/docs/account).

 

 

##   Cost Optimization Tips 

#####    **1. Choose the Right Features**   

 

- **[Browser rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering):** Only enable `render_js=true` if the site requires JavaScript 
    Adds +5 credits per request
- **[ASP (Anti-Scraping Protection)](https://scrapfly.io/docs/scrape-api/anti-scraping-protection):** Only enable if the site has anti-bot protection 
    May upgrade proxy pool automatically - see ASP documentation for details
- **[Proxy pool](https://scrapfly.io/docs/scrape-api/proxy):** Use datacenter by default (1 credit), switch to residential only when needed 
    Residential proxies are 25x more expensive (25 credits)
 
 

 

 

#####    **2. Use Caching**   

 

Enable caching to avoid re-scraping unchanged pages:

 ```
https://api.scrapfly.io/scrape?url=https://example.com&cache=true&cache_ttl=86400&key=
```

 

   

 

 

> **Savings:** Cached responses cost **0 credits** when hit within TTL period.

 

 

 

#####    **3. Set Cost Budgets**   

 

 Use the [`cost_budget`](https://scrapfly.io/docs/scrape-api/getting-started#api_param_cost_budget) parameter to set a maximum budget per request:

 ```
https://api.scrapfly.io/scrape?url=https://example.com&cost_budget=50&key=
```

 

   

 

 

- Set the correct minimum budget for your target
- Budget only applies to deterministic configuration (bandwidth usage cannot be known beforehand)
- If cost budget is reached, the call is billed based on the scrape attempt settings
 
 

 

 

#####    **4. Use Project Limits**   

 

 Set project-level limits to prevent unexpected costs:

- **Monthly credit limit** - Cap total spending per month
- **Concurrency limits** - Control parallel request volume
- **Disable PAG** - Prevent overage charges
 
> **Learn More:** See the [Project documentation](https://scrapfly.io/docs/project) for details on setting up project limits.

 

 

 

 

##   Related Documentation 

 [  **Crawler API Billing** 
How crawler costs are calculated per page crawled 

  ](https://scrapfly.io/docs/crawler-api/billing) [  **Extraction API Billing** 
AI extraction costs and options 

  ](https://scrapfly.io/docs/extraction-api/billing) [  **Account Billing &amp; Subscriptions** 
Payment policy, invoices, and plan management 

  ](https://scrapfly.io/docs/billing) [  **Project Budget Management** 
Set spending limits and alerts 

  ](https://scrapfly.io/docs/project) [  **Pricing Plans** 
Compare plans and features 

  ](https://scrapfly.io/pricing)