How to Use Zenrows with Node.js
Before starting, ensure you have Node.js 18+ installed on your machine. Using an IDE like Visual Studio Code or IntelliJ IDEA will also enhance your coding experience. We’ll create a Node.js script namedscraper.js inside a /scraper directory. If you need help setting up your environment, check out our Node.js scraping guide for detailed instructions on preparing everything.
Install Node.js’s Axios Library
To interact with the Zenrows API in a Node.js environment, you can use the popular HTTP client library, Axios. Axios simplifies making HTTP requests and handling responses, making it an ideal choice for integrating with web services such as Zenrows. To installaxios in your Node.js project, run the following command in your terminal:
Perform Your First API Request
In this step, you will send your first request to Zenrows using the Axios library to scrape content from a simple URL. We will use the HTTPBin.io/get endpoint to demonstrate how Zenrows processes the request and returns the data. Here’s an example:YOUR_ZENROWS_API_KEY with your actual API key and run the script:
Scrape More Complex Web Pages
While scraping simple sites like HTTPBin is straightforward, many websites, especially those with dynamic content or strict anti-scraping measures, require additional features. Zenrows allows you to bypass these defenses by enabling JavaScript Rendering and using Premium Proxies. For example, if you try to scrape a page like G2’s Jira reviews without any extra configurations, you’ll encounter an error:Troubleshooting
Request failures can happen for various reasons. While some issues can be resolved by adjusting Zenrows parameters, others are beyond your control, such as the target server being temporarily down. Below are some quick troubleshooting steps you can take:Retry the Request
Verify the Site is Accessible in Your Country
proxy_country.Here’s how to choose a proxy in the US:proxy_country parameter will help.Check if the Site is Publicly Accessible
Get Help From Zenrows Experts

Frequently Asked Questions (FAQ)
How can I bypass CloudFlare and other protections?
How can I bypass CloudFlare and other protections?
js_render and premium_proxy in your requests. These features simulate a full browser environment and route through high-quality residential proxies for protected access.You can also enhance your request by adding options like wait or wait_for to ensure the page fully loads before extracting data, improving accuracy.How can I ensure my requests don't fail?
How can I ensure my requests don't fail?
How do I extract specific content from a page?
How do I extract specific content from a page?
css_extractor parameter to directly extract content from a page using CSS selectors. Find out more in our tutorial on data parsing.Can I integrate Zenrows with Node.js and Cheerio?
Can I integrate Zenrows with Node.js and Cheerio?
How can I simulate user interactions on the target page?
How can I simulate user interactions on the target page?
js_render and js_instructions features to simulate actions such as clicking buttons or filling out forms. Discover more about interacting with web pages in our JavaScript instructions guide.How can I scrape faster using Zenrows?
How can I scrape faster using Zenrows?