Skip to main content
Network Capture intercepts internal API calls made during webpage loading, giving you direct access to structured data in JSON format instead of parsing HTML. Common uses:
  • Dynamic content: Capture lazy-loaded data and real-time updates.
  • API access: Interact directly with backend APIs bypassing UI rendering.
  • Performance: Reduce overhead by accessing machine-readable responses.
  • Accuracy: Get reliable data directly from API endpoints.
Network Capture requires page rendering to be enabled (render: true). For XHR/AJAX calls that don’t need rendering, use the is_xhr parameter instead.

Parameters

network_capture
array
Intercept and capture network requests made by the page. Perfect for accessing hidden APIs or getting data directly from backend calls instead of parsing HTML.Requirements: Only works when render: trueEach capture filter is an object with these options:
  • method - Filter by HTTP method (GET, POST, PUT, DELETE, etc.)
    • Leave empty to capture any method
  • url.type - How to match URLs
    • exact - Match the complete URL exactly
    • contains - Match URLs containing a specific string
  • url.value - The URL or URL pattern to match
  • resource_type - Filter by request type (array)
    • Options: xhr, fetch, stylesheet, script, document, image
    • Example: ["xhr", "fetch"] to capture only AJAX/fetch requests
  • validation - Validate response content (default: false)
    • Ensures captured responses are valid
  • wait_for_requests_count - Wait for this many matching requests (default: 0)
    • Useful when you know how many API calls to expect
  • wait_for_requests_count_timeout - How long to wait in seconds (default: 10)
    • Timeout for waiting for the expected request count
Pro tip: Use contains with /api/ to capture all API calls, or be specific with exact URLs.
Example (capture specific API):
Example (multiple captures):

Usage

Filter by exact URL match

Capture a specific API endpoint by matching the complete URL.

Filter by URL pattern

Use contains to capture requests with URLs matching a pattern. This is useful for capturing file types (like .css or .js), requests with dynamic URL components, or when you don’t know the exact URL.

Filter by resource type

Capture specific types of resources like XHR, Fetch, or Script requests.

Multiple filters

Combine multiple filters to capture different request types in one call.

Wait for requests

Use wait_for_requests_count to ensure you capture a minimum number of network requests. The request duration will be extended until the count is reached or the timeout expires.
This configuration will wait up to 5 seconds to capture at least 3 network requests matching the filter criteria.

XHR without rendering

For direct API endpoints that don’t require page rendering, use is_xhr for better performance.
is_xhr only works when render is false. It sends XHR-specific headers and targets the API URL directly.

Example response

When browser actions complete successfully, you’ll receive the final page state along with any data captured. The response includes:
  • data: All related extacted data
    • data.html: Final DOM state after all actions
    • data.network_capture: The network capture response by order
  • metadata: Execution details including task id, driver used, execution time and more

Best practices

Use specific URL patterns

Be specific with URL matching:

Filter by resource type

Narrow down to relevant resources:

Set appropriate wait counts

Use wait_for_requests_count for dynamic content:

Use XHR mode for direct API calls

Skip rendering when accessing APIs directly: