Skip to main content
Below are examples of Browser API usage in various scenarios and libraries.
Please make sure to install required libraries before continuing

Make your first request in minutes

Test the Browser API in minutes with these ready-to-use code examples.

Nodejs Puppeteer Example

Node.js Playwright Example

Node.js Selenium Example

Simple scraping of targeted page

Select your preferred tech-stack


Optimizing Bandwidth Usage with Browser API

When optimizing your web scraping projects, conserving bandwidth is key. Explore our tips and guidelines below to utilize bandwidth-saving techniques within your script and ensure efficient, resource-friendly scraping.

Avoid Unnecessary Media Content

Downloading unnecessary media (images, videos) is a common bandwidth drain. You can block these resources directly within your script.
Resource-blocking can occasionally impact page loading due to anti-bot expectations. If you see issues after blocking resources, revert your blocking logic before contacting support.

Block Unnecessary Network Requests

Blocking media type requests alone may not always reduce your bandwidth usage. Some websites have ad spaces that continuously refresh ads, and others use live bidding mechanisms that constantly search for new ads if one fails to load properly. In such cases, it’s important to identify and block these specific network requests. Doing so will decrease the number of network requests and, consequently, lower your bandwidth usage.
Example

Use Browser Cache Efficiently

One common inefficiency in scraping jobs is the repeated downloading of the same resources during a single session. Leveraging the browser’s built-in cache can significantly increase your scraping efficiency. When you navigate to multiple pages on the same domain, static resources like CSS files, JavaScript libraries, images, and fonts are automatically cached and reused. This saves bandwidth by avoiding redundant fetches and ensures faster page loads for subsequent requests.

Code Example

This example demonstrates how browser caching improves performance across multiple navigations to the same domain. Make sure to replace USER:PASS with your own credentials
Puppeteer

Expected Output

Other strategies to try

  • Limit Your Requests: Scrape only the data you need.
  • Concurrency Control: Avoid opening too many concurrent pages; this can overload resources.
  • Session Management: Properly close sessions to save resources and bandwidth.
  • Opt for APIs: Use official APIs when available, they’re often less bandwidth-intense.
  • Fetch Incremental Data: Only scrape new/updated content, not the entire dataset every time.