```yaml
product: AlterLab
title: "Network Interception — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/network-interception
```

extraction

# Network Interception

Capturing XHR/fetch API responses made by a page's JavaScript during browser rendering to extract structured data directly from network calls.

Network interception is a technique used in browser-based scraping to capture the HTTP requests and responses made by a page's JavaScript during page load — intercepting the underlying API calls rather than parsing the rendered HTML. Modern SPAs built with React, Vue, or Angular typically load their content through internal REST or GraphQL API calls that return clean JSON, which is easier to parse than extracting equivalent data from the rendered DOM.

Browser automation frameworks like Playwright and Puppeteer expose request interception APIs that register callbacks on network events. A scraping script can listen for XHR/fetch requests matching a pattern (e.g., requests to `/api/products` or containing `.json`), capture the response body, and extract the structured data directly — bypassing HTML parsing entirely.

Network interception is particularly powerful for sites that render identical data in both an HTML view and a JSON API response. The JSON response is typed, consistently structured, and often contains fields not shown in the UI (internal IDs, raw timestamps, additional metadata). It is also resilient to frontend redesigns — the API response schema tends to be more stable than the HTML structure. AlterLab's Tier 4 and above support request interception via the `intercept_urls` parameter.

### What is Network Interception?

Capturing XHR/fetch API responses made by a page's JavaScript during browser rendering to extract structured data directly from network calls.

### How does AlterLab handle Network Interception?

Network interception is particularly powerful for sites that render identical data in both an HTML view and a JSON API response. The JSON response is typed, consistently structured, and often contains fields not shown in the UI (internal IDs, raw timestamps, additional metadata). It is also resilient to frontend redesigns — the API response schema tends to be more stable than the HTML structure. AlterLab's Tier 4 and above support request interception via the `intercept_urls` parameter.

## Examples

```
# Playwright network interception example
page.on('response', async response => {
  if '/api/products' in response.url():
    data = await response.json()
    # Use structured data directly
})
await page.goto('https://example.com/products')
```

## Related Terms

[JavaScript RenderingThe process of executing a page's JavaScript in a browser engine before extracting content, required for React, Vue, and Angular SPAs.](https://alterlab.io/glossary/javascript-rendering)[Headless BrowserA web browser that runs without a graphical user interface, executing JavaScript and rendering pages exactly as a real browser would.](https://alterlab.io/glossary/headless-browser)[PlaywrightAn open-source browser automation library from Microsoft that controls Chromium, Firefox, and WebKit through a unified async API.](https://alterlab.io/glossary/playwright)[Structured Data ExtractionConverting free-form HTML into typed JSON records using explicit schemas, producing clean structured output instead of raw markup.](https://alterlab.io/glossary/structured-data-extraction)[JSONJavaScript Object Notation — the universal text format for structured data exchange between APIs and web services.](https://alterlab.io/glossary/json)

## Extract Network Interception data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)