# 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)
- [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)

- [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)
- [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)

---

 1. [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
2. HeapProfiler
 
  # HeapProfiler

 Experimental 

**Dependencies:** [Runtime](https://scrapfly.io/docs/cloud-browser-api/cdp-reference/Runtime)

 - [Commands (12)](#commands)
- [Events (5)](#events)
- [Types (4)](#types)
 
   

No symbols match your filter.

## Commands

#### `HeapProfiler.addInspectedHeapObject`

 

Enables console to refer to the node with given id via $x (see Command Line API for more details
$x functions).

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `heapObjectId` | `<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-HeapSnapshotObjectId">HeapSnapshotObjectId</a>` | Heap snapshot object id to be accessible by means of $x command line API. |

 

 

 

#### `HeapProfiler.collectGarbage`

 

 

 

#### `HeapProfiler.disable`

 

 

 

#### `HeapProfiler.enable`

 

 

 

#### `HeapProfiler.getHeapObjectId`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | Identifier of the object to get heap object id for. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `heapSnapshotObjectId` | `<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-HeapSnapshotObjectId">HeapSnapshotObjectId</a>` | Id of the heap snapshot object corresponding to the passed remote object id. |

 

 

 

#### `HeapProfiler.getObjectByHeapObjectId`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectId` | `<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-HeapSnapshotObjectId">HeapSnapshotObjectId</a>` |  |
| `objectGroup`  (optional) | `string` | Symbolic group name that can be used to release multiple objects. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `result` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">Runtime.RemoteObject</a>` | Evaluation result. |

 

 

 

#### `HeapProfiler.getSamplingProfile`

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `profile` | `<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-SamplingHeapProfile">SamplingHeapProfile</a>` | Return the sampling profile being collected. |

 

 

 

#### `HeapProfiler.startSampling`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `samplingInterval`  (optional) | `number` | Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. |
| `stackDepth`  (optional) | `number` | Maximum stack depth. The default value is 128. |
| `includeObjectsCollectedByMajorGC`  (optional) | `boolean` | By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses. |
| `includeObjectsCollectedByMinorGC`  (optional) | `boolean` | By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity. |

 

 

 

#### `HeapProfiler.startTrackingHeapObjects`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `trackAllocations`  (optional) | `boolean` |  |

 

 

 

#### `HeapProfiler.stopSampling`

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `profile` | `<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-SamplingHeapProfile">SamplingHeapProfile</a>` | Recorded sampling heap profile. |

 

 

 

#### `HeapProfiler.stopTrackingHeapObjects`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `reportProgress`  (optional) | `boolean` | If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. |
| `treatGlobalObjectsAsRoots`  (optional) Deprecated | `boolean` | Deprecated in favor of `exposeInternals`. |
| `captureNumericValue`  (optional) | `boolean` | If true, numerical values are included in the snapshot |
| `exposeInternals`  (optional) Experimental | `boolean` | If true, exposes internals of the snapshot. |

 

 

 

#### `HeapProfiler.takeHeapSnapshot`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `reportProgress`  (optional) | `boolean` | If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. |
| `treatGlobalObjectsAsRoots`  (optional) Deprecated | `boolean` | If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of `exposeInternals`. |
| `captureNumericValue`  (optional) | `boolean` | If true, numerical values are included in the snapshot |
| `exposeInternals`  (optional) Experimental | `boolean` | If true, exposes internals of the snapshot. |

 

 

 

 

## Events

#### `HeapProfiler.addHeapSnapshotChunk`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `chunk` | `string` |  |

 

 

 

#### `HeapProfiler.heapStatsUpdate`

 

If heap objects tracking has been started then backend may send update for one or more fragments

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `statsUpdate` | `array<<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-integer">integer</a>>` | An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. |

 

 

 

#### `HeapProfiler.lastSeenObjectId`

 

If heap objects tracking has been started then backend regularly sends a current value for last
seen object id and corresponding timestamp. If the were changes in the heap since last event
then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `lastSeenObjectId` | `integer` |  |
| `timestamp` | `number` |  |

 

 

 

#### `HeapProfiler.reportHeapSnapshotProgress`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `done` | `integer` |  |
| `total` | `integer` |  |
| `finished`  (optional) | `boolean` |  |

 

 

 

#### `HeapProfiler.resetProfiles`

 

 

 

 

## Types

#### `HeapSnapshotObjectId`

 (string) 

Heap snapshot object id.

 

 

#### `SamplingHeapProfileNode`

 (object) 

Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `callFrame` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-CallFrame">Runtime.CallFrame</a>` | Function location. |
| `selfSize` | `number` | Allocations size in bytes for the node excluding children. |
| `id` | `integer` | Node id. Ids are unique across all profiles collected between startSampling and stopSampling. |
| `children` | `array<<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-SamplingHeapProfileNode">SamplingHeapProfileNode</a>>` | Child nodes. |

 

 

 

#### `SamplingHeapProfileSample`

 (object) 

A single sample from a sampling profile.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `size` | `number` | Allocation size in bytes attributed to the sample. |
| `nodeId` | `integer` | Id of the corresponding profile tree node. |
| `ordinal` | `number` | Time-ordered sample ordinal number. It is unique across all profiles retrieved between startSampling and stopSampling. |

 

 

 

#### `SamplingHeapProfile`

 (object) 

Sampling profile.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `head` | `<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-SamplingHeapProfileNode">SamplingHeapProfileNode</a>` |  |
| `samples` | `array<<a href="/docs/cloud-browser-api/cdp-reference/HeapProfiler#type-SamplingHeapProfileSample">SamplingHeapProfileSample</a>>` |  |