What is Node-fetch?
Node-fetch is a minimal wrapper that brings the browser-standard window.fetch API to Node.js. It is favored by developers who want consistency between frontend and backend code. Oculus Proxies are essential because Node-fetch lacks the complex header-handling of a full browser; rotating IPs helps bypass basic security filters that flag repetitive headless requests.
If you’re using Oculus to scrape search engines like Google, Bing, or Yandex and facing connection issues, your proxy type may need adjustment. ISP Premium Proxies provide stable and unrestricted access, preventing blocks that standard proxies may encounter. Switching to ISP Premium Proxies can improve performance.
How to Use Oculus Proxies With Node-fetch
Install package
Install via cmd:npm install node-fetch https-proxy-agent
Example code
Use the following code as an example for Nightmare.js. Make sure to replace the correct proxy credentials from your dashboard inside proxyAgent.const fetch = require('node-fetch');
const { HttpsProxyAgent } = require('https-proxy-agent');
const proxyAgent = new HttpsProxyAgent('http://USERNAME:[email protected]:PORT');
async function checkIP() {
const response = await fetch('http://httpbin.org/ip', { agent: proxyAgent });
const body = await response.text();
console.log('IP via node-fetch:', body);
}
checkIP();