Eng
  • Eng
  • Rus
  • Ukr

How to set up a proxy in Scraper API

Scraper API is a sophisticated tool designed for website scraping, offering vital solutions for efficient business operations. It enables rapid data extraction from targeted websites and formats it for easy analysis. Applications include sourcing SEO-optimized product descriptions from competitors' sites, monitoring product prices in online stores, collecting statistics on user activities like likes, reposts, and views, and tracking the latest news on information portals. However, websites often block IP addresses associated with web scraping activities. To ensure uninterrupted functionality, configuring a proxy for Scraper API is essential.

Step-by-step proxy setup in Scraper API

To set up a proxy for Scraper API scraping, follow these steps:

  1. Create an account on ScraperAPI and navigate to the “Dashboard” category on the main page. Locate the “Sample Proxy Code” field.
  2. 1.png

  3. The “Sample Proxy Code” field contains code similar to this:
  4. curl -x"http://scraperapi:APIKEY@proxy-server.scraperapi.com:8001" -k "http://httpbin.org/ip"

  5. Copy this code and paste it into your script. Make the following modifications to the code:
    • Replace “scraperapi” with your proxy username.
    • Substitute "APIKEY" with your password.
    • Change “proxy-server.scraperapi.com” to your new IP address.
    • After the IP address, add the port number, separated by a colon.
    • After “-k” and within the quotes, specify the URL of the page you wish to scrape.

    The modified code should look like this:

    curl -x"http://LOGIN:PASSWORD@IP-ADRESS:8001" -k "http://httpbin.org/ip"

This command can be adapted for different programming languages, and the code may vary accordingly. Example for Python:

2.png

Ruby:

3.png

NodeJS:

4.png

With the proxy setup complete, you can send requests from various IPs, reducing the likelihood of IP blocking. This also enables requests to resources that are geo-blocked.