Proxy

Proxies are at the core of every modern web scraper as they allow traffic distribution through multiple connection agents. In other words, proxies in web scraping allow to:

  • Change origin country to access geographically locked content.
  • Bypass scraper blocking and anti-bot detection solutions.
  • Bypass scraper throttling.

All Scrapfly requests go through proxies and are automatically configured for the best scraping experience. However, each scrapfly API call can be additionally configured manually via proxy_pool and country parameters.

See Your Proxy Dashboard

What are Proxies?

Each address is associated with an Autonomous System Number (ASN) and linked to a proxy. This is how anti-bot solutions track the origin of the IP and limit requests per IP. Our proxy pool rotates IPs, cools them down, and excludes underperforming proxies to increase success rates. We offer two public proxy pools by default, with the option to set up a custom pool. We manage and monitor our proxy pool for optimal performance, with both datacenter and residential proxies available.

Different kind of proxies exists, by types of IP address issuer:

  • Datacenter: Cheap but are detected by advanced anti bot solution
  • Residential: More expensive than datacenter but required for most target protected with anti bot solution

Why are Proxies Needed?

Anti-bot solutions rate-limit the number of requests per connecting IP address. Meaning, to scrape more than a page or two scrapers need to distribute traffic through multiple IP addresses. This limit is why we need to manage the proxy pool, rotate IPs, and cool them to increase the success rate.

Available Proxy Pools

A proxy pool represent a group proxies. By default, proxies are grouped by network type like datacenter, residential, 4g etc. One of the main challenges with proxies is the reliability, it's complex to maintain a network of healthy proxies and routing the traffic to them. You don't have to worry about the proxy, simply target the proxy pool and we route the traffic to an healthy proxy meeting your requirements.

All available proxy pools are listed in the proxy section on your dashboard. Each proxy pool have it's own cost (mostly due to network type) and by default these public pools are available:

  • Public Datacenter Pool: public_datacenter_pool - 1 API Credits will be counted
  • Public Residential Pool: public_residential_pool - 25 API Credits will be counted

For example, to use residential proxies configure requests with the proxy_pool=public_residential_pool parameter:

require "uri"
require "net/http"

url = URI("https://api.scrapfly.io/scrape?proxy_pool=public_residential_pool&key=__API_KEY__&url=https%3A%2F%2Fhttpbin.dev%2Fanything")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body
"https://api.scrapfly.io/scrape?proxy_pool=public_residential_pool&key=&url=https%3A%2F%2Fhttpbin.dev%2Fanything"

"api.scrapfly.io"
"/scrape"

proxy_pool  = "public_residential_pool" 
key         = "" 
url         = "https://httpbin.dev/anything" 

Geo Targeting

All Scrapfly scrape requests go through a proxy meaning geo-targeting is available at all times. By default, Scrapfly will smartly select a random proxy from the selected pool for the highest success probability.

To set the desired country, the country parameter can be used and the available country options depend on the selected proxy_pool:

API Pool Name: public_datacenter_pool
  • Albania : al
  • Armenia : am
  • Argentina : ar
  • Austria : at
  • Australia : au
  • Belgium : be
  • Bulgaria : bg
  • Bolivia : bo
  • Brazil : br
  • Belarus : by
  • Canada : ca
  • Switzerland : ch
  • Chile : cl
  • China : cn
  • Colombia : co
  • Czechia : cz
  • Germany : de
  • Denmark : dk
  • Ecuador : ec
  • Estonia : ee
  • Spain : es
  • Finland : fi
  • France : fr
  • United Kingdom : gb
  • Georgia : ge
  • Greece : gr
  • Croatia : hr
  • Hungary : hu
  • Ireland : ie
  • Israel : il
  • India : in
  • Iceland : is
  • Italy : it
  • Japan : jp
  • South Korea : kr
  • Lithuania : lt
  • Latvia : lv
  • Mexico : mx
  • Netherlands : nl
  • Norway : no
  • New Zealand : nz
  • Peru : pe
  • Pakistan : pk
  • Poland : pl
  • Portugal : pt
  • Romania : ro
  • Russia : ru
  • Saudi Arabia : sa
  • Sweden : se
  • Slovakia : sk
  • Türkiye : tr
  • Ukraine : ua
  • United States : us
API Pool Name: public_residential_pool
  • Albania : al
  • Armenia : am
  • Argentina : ar
  • Austria : at
  • Australia : au
  • Belgium : be
  • Bulgaria : bg
  • Bolivia : bo
  • Brazil : br
  • Belarus : by
  • Canada : ca
  • Switzerland : ch
  • Chile : cl
  • China : cn
  • Colombia : co
  • Czechia : cz
  • Germany : de
  • Denmark : dk
  • Ecuador : ec
  • Estonia : ee
  • Spain : es
  • Finland : fi
  • France : fr
  • United Kingdom : gb
  • Georgia : ge
  • Greece : gr
  • Croatia : hr
  • Hungary : hu
  • Ireland : ie
  • Israel : il
  • India : in
  • Iceland : is
  • Italy : it
  • Japan : jp
  • South Korea : kr
  • Lithuania : lt
  • Latvia : lv
  • Mexico : mx
  • Netherlands : nl
  • Norway : no
  • New Zealand : nz
  • Peru : pe
  • Pakistan : pk
  • Poland : pl
  • Portugal : pt
  • Romania : ro
  • Russia : ru
  • Saudi Arabia : sa
  • Sweden : se
  • Slovakia : sk
  • Türkiye : tr
  • Ukraine : ua
  • United States : us

For example, to target Canada configure requests with the country=CA parameter:

require "uri"
require "net/http"

url = URI("https://api.scrapfly.io/scrape?country=ca&key=__API_KEY__&url=https%3A%2F%2Fhttpbin.dev%2Fanything")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body
"https://api.scrapfly.io/scrape?country=ca&key=&url=https%3A%2F%2Fhttpbin.dev%2Fanything"

"api.scrapfly.io"
"/scrape"

country  = "ca" 
key      = "" 
url      = "https://httpbin.dev/anything" 

All related errors are listed below. You can see full description and example of error response on Errors section

Pricing

Each call using the residential proxy pool will count for 25 Scrape API Credits. API responses contain a header X-Scrapfly-Api-Cost which indicate the total billed amount.

Summary