Oxylabs DataCenter Proxies Guide

Oxylabs Datacenter Proxies: Web Scraping Guide

Oxylabs offers a wide variety of different proxy products. Their offerings include Residential Proxies, ISP Proxies, Mobile Proxies, Datacenter Proxies, Dedicated Datacenter Proxies, and Web Unblocker. All of these are pretty great products, but today, we'll be looking at the Datacenter Proxies specifically. We'll go through the process of Datacenter proxies from start to finish. We'll start with their signup process. Then, we'll move onto creating our proxies, and then finally, we'll go through the process of using them.

Need help scraping the web?

Then check out ScrapeOps, the complete toolkit for web scraping.


TLDR: How to Integrate Oxylabs Datacenter Proxy?

Getting started with Oxylabs Datacenter Proxies is really easy.
  1. Once you've created your proxies, just make sure you've got your credentials: USERNAME, PASSWORD, PORT.
  2. If you direct your requests to port 8000, Oxylabs will even manage your proxies for you!
  3. In the code below, we perform a simple check on our location when using a proxy.
  4. First, we import our dependencies.
  5. Then, we read our credentials from a config file. You can technically hardcode your API keys into your file, but it is not considered best practice to do so.
import requestsimport json
config = {}
with open("config.json") as file:    config = json.load(file)["oxylabs"]
USERNAME = config["username"]PASSWORD = config["password"]HOSTNAME = "dc.oxylabs.io"PORT = 8000
proxy_url = f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
url = "http://lumtest.com/myip.json"
proxied_ip = requests.get(url, proxies=proxies)print("Proxy Location:", proxied_ip.text)
In the example above, we:
  • Set our credentials: USERNAME, PASSWORD, PORT.
  • Set our proxy_url: http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}. We then create a dict that sets this proxy as our http and https proxies.
  • We use the proxy with requests.get(url, proxies=proxies). proxies=proxies assigns our new dict to the proxy protocol used in Python Requests.
  • Once we receive our response back, we go ahead and print it to the terminal.
You can view some example output below.
Proxy Location: {"country":"US","asn":{"asnum":16628,"org_name":"DEDICATED-FIBER-COMMUNICATIONS"},"geo":{"city":"Buffalo","region":"NY","region_name":"New York","postal_code":"14205","latitude":42.8856,"longitude":-78.8736,"tz":"America/New_York","lum_city":"buffalo","lum_region":"ny"}}

Understanding Datacenter Proxies

The most difficult sites on the internet tend to block datacenter IP addresses. However, this isn't a universal practice. Datacenter proxies are are just fine for the vast majority of the internet. There are two main types of proxies in this industry: Datacenter and Premium. Premium proxies are made up of actual mobile and residential IP addresses. They tend to cost quite a bit more and they are significantly slower than datacenter proxies. Datacenter proxies run on hosted machines in datacenters. In the next few sections, we'll break it down so you know when and why to use each type. Just like any other craft, web scraping requires knowing the right tool for the right job.

Datacenter vs Residential

Datacenter

Pros
  • Price: Datacenter proxies are cheap... really cheap. When you use datacenter bandwidth, you usually start out at less than $1/GB.
  • Speed: These proxies are hosted on real machines inside actual datacenters. Datacenters typically get you top of the line connection speed and hardware.
  • Availability: Datacenter proxies usually operate with a much larger pool of IP addresses.
Cons
  • Blocking: Some sites block datacenter IPs by default. Ideally, these are the sites that you'd scrape using a Residential Proxy.
  • Less Geotargeting Support: When we use datacenter proxies, we often do get the option to use geotargeting. However, we aren't able to target very specifically and our IP will show up as a datacenter IP.
  • Less Anonymity: Your IP address is tied to that of a datacenter provider, not that of an actual residential neighborhood. While you do still receive anonymity, your traffic tends to look a bit odd on the server end.

Residential

Pros
  • Anonymity: Residential proxies offer much more anonymity. When your requests appear as though they're coming from an actual house or mobile device, they're much less likely to stick out.
  • Better Access: As previously mentioned, some sites block datacenter IP addresses. If you're trying to access a site that blocks them, you need to use a residential IP address.
Cons
  • Price: Residential Proxies are far more expensive than their Datacenter counterparts. Oxylabs charges $8/GB on their Pay As You Go plan!
  • Speed: Residential proxies are often slower than their datacenter counterparts. When you're on a residential proxy, your traffic is going from your machine, to another server, to a residential machine. Then when a response is received, it needs to make it back through that entire chain again. If you factor in varying hardware, that can bottleneck pretty quickly.
Residential proxies are ideal for SERP results, ad verification, social media monitoring/scraping and much more.

Why Use Oxylabs Datacenter Proxies?

Oxylabs Datacenter Proxies come with some pretty decent features. They offer two types of pricing plans. You get the option to pay per IP, or to pay for bandwidth. This gives some flexibility for customers of all walks of life. If you only need a few IP addresses or you just want to try the product out, you pay per IP. If you want a stable rotating proxy connection with a large pool of addresses, you can go with one of the higher end plans and pay for bandwidth.
  • Datacenter Proxies with Oxylabs are both flexible and affordable.
  • We can use geotargeting to select which country we want to appear in.

Oxylabs Datacenter Proxy Pricing

As we mentioned earlier, Oxylabs gives us two pricing models to use when we're choosing a plan. We can pay per IP address, or if we need a larger proxy pool, we can pay for bandwidth. When you pay based on IP address, the barrier to entry is $12/month. If you decide to purchase bandwidth instead, you're looking at about $50/month for the lowest tier plan. You can view these pricing plans in more detail below.

Pay Per IP Address

IP CountPrice Per IP AddressMonthly Cost
10$1.20$12
50$1.10$55
100$1.00$100
200$0.90$180
500$0.85$425
1000$0.75$750

Pay Per Bandwidth

BandwidthPrice Per GBMonthly Cost
77GB$0.65$50
167GB$0.60$100
364GB$0.55$200
600GB$0.50$300
1042GB$0.48$500
2000GB$0.46$920
5000GB$0.44$2200
Oxylabs offers a large variety of plans so anyone can get started using their Datacenter Proxies easily. If you're just looking to try it out, go for the 10 IP plan at $12/month. If you need serious proxy backbone, go for one of the more hefty badwidth based plans... they range between $50 and $2200!

Setting Up Oxylabs Datacenter Proxies

Time to setup an account with Oxylabs. As you may notice in the screenshot below, Oxylabs gives you the opportunity to signup using either your Google Account, or you can create an account with a traditional email and password. Oxylabs Signup Once you're signed up for Oxylabs, you need to add the Datacenter Proxy Service to your account. They prompt you to choose either the IP based or bandwidth based model. Since we're just trying it out, we'll pay per IP address. When choosing IP addresses, make sure to choose which country you want IP addresses in, otherwise you'll receive random IP addresses. Oxylabs Choose Proxy Location Next, we're finally prompted to pay for the proxies we're buying. They have several options available. The credit card method runs very smooth and it does say that it's powered by Stripe as the checkout process loads. Oxylabs Payment Options Now that we've paid for our IP addresses, we need to create a user for them. Click Create proxy user and follow the prompts that come up to create a new user. Oxylabs Create User We're finally ready to use our new proxies. If you choose, you can download them all to a file by clicking the button in the top right-hand corner. Oxylabs Export IPs We can now start playing around with our new proxies.

Authentication

Oxylabs allows us to use two different methods for authentication. We can use whitelisting and we can also use a username and password. If you'd like to whitelist your IP address, you can look at the screenshot below. This screenshot comes straight from their documentation. If you decide to whitelist an IP address, you won't need to authenticate yourself when using the proxies. Oxylabs Whitelist IPs We'll be using password based authentication for the rest of this tutorial. With this method, we authenticate with the username and password we created earlier when we created a user. The code below holds a simple example of an authenticated request. You might recognize it from our TLDR section.
import requestsimport json
config = {}
with open("config.json") as file:    config = json.load(file)["oxylabs"]
USERNAME = config["username"]PASSWORD = config["password"]HOSTNAME = "dc.oxylabs.io"PORT = 8000
proxy_url = f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
url = "http://lumtest.com/myip.json"
proxied_ip = requests.get(url, proxies=proxies)print("Proxy Location:", proxied_ip.text)
To understand our authentication here, take a look at our URL:
http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}
  • Our username is always passed in as user-{USERNAME}.
  • This is followed by :{PASSWORD}.
Whenever you're authernticating, it goes {USERNAME}:{PASSWORD} inside the URL of your proxy. This isn't just for Oxylabs either. This is standard HTTP authentication.

Basic Request Using Oxylabs Datacenter Proxies

We know you've already seen this example a few times, but when you're learning something, repitition is everything. Take a look at the example below just one more time. You need to understand how these basics work. Once you've got the basics down, the rest of this proxy stuff will come pretty easy to you.
import requestsimport json
config = {}
with open("config.json") as file:    config = json.load(file)["oxylabs"]
USERNAME = config["username"]PASSWORD = config["password"]HOSTNAME = "dc.oxylabs.io"PORT = 8000
proxy_url = f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
url = "http://lumtest.com/myip.json"
proxied_ip = requests.get(url, proxies=proxies)print("Proxy Location:", proxied_ip.text)
  • We get started by importing our dependencies and reading our credentials from a config file.
  • Our HOSTNAME is dc.oxylabs.io and our PORT is 8000.
  • We combine our credentials with our HOSTNAME and PORT to create our proxy_url: f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}".
  • We then make a dict called proxies and assign this proxy_url to the http and https keys in the dict.
  • When we make requests, we pass in proxies=proxies and this tells Python Requests to route our requests through these specific proxies.

Country Geotargeting

Country level geotargeting is really quite simple when we're working with Oxylabs. As you saw earlier, our URLs are laid out like this:
http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}
To add geotargeting to this, we need to use the country flag. If you want to appear in the US, you would pass country-us in the url. If you want to appear in the UK, you can pass country-uk inside your URL. NOTE: If you are on an IP based plan, you can only pass countries from your list of IP addresses. If you remember earlier, we setup 5 proxies in the US and 5 in the UK. This means that the only geotargeting we have support for would be the US and the UK. The code below has just a slight change from the basic request we've been working with so far. We add a COUNTRY variable and pass it into our url.
import requestsimport json
config = {}
with open("config.json") as file:    config = json.load(file)["oxylabs"]
USERNAME = config["username"]PASSWORD = config["password"]HOSTNAME = "dc.oxylabs.io"PORT = 8000COUNTRY = "us"
proxy_url = f"http://user-{USERNAME}-country-{COUNTRY}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
url = "http://lumtest.com/myip.json"
proxied_ip = requests.get(url, proxies=proxies)print("Proxy Location:", proxied_ip.text)
Here are the subtle differences you should take note of in this example.
  • COUNTRY = "us" allows us to save our country as a variable. This makes our code easier to tweak in the future.
  • Our url now includes the country flag: http://user-{USERNAME}-country-{COUNTRY}:{PASSWORD}@{HOSTNAME}:{PORT}". This tells Oxylabs that we want to use a proxy located in a specific country.
Here is the full list of supported countries from their documentation.
CountryCountry Code
Belgiumbe
Francefr
Germanyde
Japanjp
Netherlandsnl
Romaniaro
United Kingdomgb
United Statesus
You can view their full documentation on Datacenter Proxy geolocation here.

City Geotargeting

City level geotargeting is not a common feature with Datacenter proxies. With datacenter proxies, you're most often limited to choosing a specific country or region. Oxylabs' Residential Proxy service does provide city and state level geotargeting. You can view the documentation for that here. If you need to use city level geotargeting, you probably shouldn't be using a datacenter proxy. You should go with a residential proxy. This allows you much finer control over your actual IP address. City level geotargeting is best for collecting data from a certain locality such as:
  • Advertisements
  • Localized Social Media (like Nextdoor or Marketplace)
  • Local Store Pricing
  • General town sentiment

Error Codes

Oxylabs has a relatively short list of status codes for us to keep track of. When you experience response errors in web development, they usually come with a status code. It is your job as a developer to understand the status code and troubleshoot accordingly. You may already know that a status of 200 indicates a successful response.
Status CodeTypeDescription
200SuccessEverything is working as expected.
407Proxy Authentication RequiredDouble check your request and API key.
429Too Many RequestsSlow down your requests.
500Internal Server ErrorSomething went wrong. Try again later.
503Service UnavailableFailed to find the domain. Double check your url.
504Gateway TimeoutThe target server took to long to respond.
You may view the full documentation for this here.

KYC Verification

Oxylabs runs an initial KYC check when you sign up as a customer and they continuously monitor your traffic. You don't need to jump through any major hoops to use their service but they will not hesitate to ban you for illegal or suspicious activity. Most proxy providers would ban anyone for illegal activity. When you use a residential proxy, the KYC process is often quite a bit stricter. This is because your data isn't just being sent through a datacenter, it's to the real IP address of a real person. If you do something illegal using that proxy, it will first be traced to that resident and eventually back to you through the proxy service. Datacenters are quite a bit more traceable as is, so they don't require such stringent KYC measures. If you perform illegal activity on a datacenter IP, it will be traced to that datacenter and ultimately, straight to you as an account holder.

Implementing Oxylabs Datacenter Proxies in Web Scraping

Time to look at all the different ways we can use Oxylabs Datacenter proxies with different frameworks. In the coming sections, we show you a few examples of how to get connected using Python and JavaScript. This way, no matter what your preference is, you'll be able to scrape the web your way.

Python Requests

You've already seen integration using Python Requests. We've been working with it this entire time! We just put this example below for consistency,
import requestsimport json

USERNAME = "your-username"PASSWORD = "your-password"HOSTNAME = "dc.oxylabs.io"PORT = 8000
proxy_url = f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
url = "http://lumtest.com/myip.json"
proxied_ip = requests.get(url, proxies=proxies)print("Proxy Location:", proxied_ip.text)
  • Once we've got our credentials, our proxy_url gets setup like this: http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}
  • We then create a dict object that holds both our http and https proxies.
  • When making our requests, we make sure to pass proxies=proxies. This tells Python Requests to use the dict object we created for our proxy settings.

Python Selenium

SeleniumWire has always been a tried and true method for using authenticated proxies with Selenium. As you may or may not know, vanilla Selenium does not support authenticated proxies. Even worse, SeleniumWire has been deprecated! This being said, it is still technically possible to integrate Oxylabs Datacenter Proxies via SeleniumWire, but we highly advise against it. When you decide to use SeleniumWire, you are vulnerable to the following risks:
  • Security: Browsers are updated with security patches regularly. Without these patches, your browser will have holes in the security that have been fixed in other browsers such as Chromedriver or Geckodriver.
  • Dependency Issues: SeleniumWire is no longer maintained. In time, it may not be able to keep up with its dependencies as they get updated. Broken dependencies can be a source of unending headache for anyone in software development.
  • Compatibility: As the web itself gets updated, SeleniumWire doesn't. Regular browsers are updated all the time. Since SeleniumWire no longer receives updates, you may experience broken functionality and unexpected behavior.
As time goes on, the probability of all these problems increases. If you understand the risks but still wish to use SeleniumWire, you can view a guide on that here. Depending on your time of reading, the code example below may or may not work. As mentioned above, we strongly recommend against using SeleniumWire because of its deprecation, but if you decide to do so anyway here you go. We are not responsible for any damage that this may cause to your machine or your privacy.
from seleniumwire import webdriver
USERNAME = "your-username"PASSWORD = "your-password"HOSTNAME = "dc.oxylabs.io"PORT = 8000
proxy_url = f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}"## Define Your Proxy Endpointsproxy_options = {    "proxy": {        "http": proxy_url,        "https": proxy_url,        "no_proxy": "localhost:127.0.0.1"    }}
## Set Up Selenium Chrome driverdriver = webdriver.Chrome(seleniumwire_options=proxy_options)
## Send Request Using Proxydriver.get('https://httpbin.org/ip')
  • We setup our url with the same structure we used with Python Requests: http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}.
  • We assign this url to both the http and https protocols of our proxy settings.
  • driver = webdriver.Chrome(seleniumwire_options=proxy_options) tells webdriver to open Chrome with our custom seleniumwire_options,

Python Scrapy

Using these Datacenter Proxies from Oxylabs with Scrapy is really straightforward. There are many ways to do it. In the example below, we'll setup our proxy from within our spider. To start, we need to make a new Scrapy project.
scrapy startproject datacenter
Then from within your new Scrapy project, create a new Python file inside the spiders folder with the following code.
import scrapy
USERNAME = "your-username"PASSWORD = "your-password"HOSTNAME = "dc.oxylabs.io"PORT = 8000
proxy_url = f"http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}"
class ScrapyExampleSpider(scrapy.Spider):    name = "datacenter_proxy"
    def start_requests(self):        request = scrapy.Request(url="https://httpbin.org/ip", callback=self.parse)        request.meta['proxy'] = proxy_url        yield request
    def parse(self, response):        print(response.body)
  • We construct our url the same way we did in the other previous two examples: http://user-{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}.
  • Inside of our start_requests method, we assign our proxy_url to request.meta['proxy'].

NodeJS Puppeteer

Now, we're going to run the same basic setup for NodeJS Puppeteer. Similar to Scrapy, we need to create a new project first. Follow the steps below to get up and running quickly. Create a new folder.
mkdir puppeteer-datacenter
cd into the new folder and create a new JavaScript project.
cd puppeteer-datacenternpm init --y
Next, we need to install Puppeteer.
npm install puppeteer
Next, from within your new JavaScript project, copy/paste the code below into a new .js file.
const puppeteer = require('puppeteer');
const PORT = 8000;const USERNAME = "your-username";const PASSWORD = "your-password";
(async () => {  const browser = await puppeteer.launch({    args: [`--proxy-server=dc.oxylabs.io:${PORT}`]  });
  const page = await browser.newPage();
  await page.authenticate({    username: `user-${USERNAME}`,    password: PASSWORD  });
  await page.goto('http://lumtest.com/myip.json');  await page.screenshot({path: 'puppeteer.png'});
  await browser.close();})();
  • First, we declare all of our configuration variables as constants: PORT, USERNAME, and PASSWORD.
  • We set our url when we launch our browser with this arg added args: [`--proxy-server=`dc.oxylabs.io:${PORT}`].
  • We add our USERNAME to the authentication: user-${USERNAME}.
  • We also add our PASSWORD to the authentication: password: PASSWORD.
Puppeteer gives great support for proxy integration from the start. With Puppeteer's builtin authenticate() method, we even have a special spot for both our USERNAME and our PASSWORD. The screenshot taken by this code is available for you to view below. Oxylabs Puppeteer Integration

NodeJS Playwright

Integration with Playwright is going to be very similar to Puppeteer. Puppeteer and Playwright both actually share a common ancestor in Chrome's DevTools. The steps below should look at least somewhat familiar, however it does get slightly different near the end of the setup. Create a new project folder.
mkdir playwright-datacenter
cd into the new folder and initialize a JavaScript project.
cd playwright-datacenternpm init --y
Install Playwright.
npm install playwrightnpx playwright install
Next, you can copy/paste the code below into a JavaScript file.
const playwright = require('playwright');
const PORT = 8000;const USERNAME = "randomuser_4U4Cw";const PASSWORD = "Some_bullshit1234";
const options = {    proxy: {        server: `http://dc.oxylabs.io:${PORT}`,        username: `user-${USERNAME}`,        password: PASSWORD    }};
(async () => {    const browser = await playwright.chromium.launch(options);    const page = await browser.newPage();
    await page.goto('http://lumtest.com/myip.json');
    await page.screenshot({ path: "playwright.png" })
    await browser.close();})();
  • Like our Puppeteer example, we first setup our configuration variables: PORT, USERNAME, and PASSWORD.
  • We create a proxy object with the following fields:
  • server: `http://dc.oxylabs.io:${PORT}
  • username: `user-${USERNAME}
  • password: PASSWORD
When we setup our proxy port using Playwright, we get solid support and easy setup for our proxy. You can view the resulting screenshot from this code below. Oxylabs Playwright Integration

Case Study: Scraping The Guardian

It's pretty normal for sites to block datacenters when they have strict anti-bots. A datacenter proxy is for more common sites on the web. Datacenter proxies are far cheaper and more efficient. Residential proxies are usually designated as a fallback when datacenter proxies don't work. We're going to scrape The Guardian. This scrape is more about showing you concepts than mass data collection.
  1. In the code below, we'll first setup a proxy in the US.
  2. We perform a GET to verify our location information and then we make a GET to The Guardian.
  3. We print our location information and we find the navbar from the Guardian's front page.
  4. After this initial run, we reset our connection to use an IP inside of the UK.
  5. If our proxies are working, we'll receive different output from each proxy.
Take a look at the code below.
import requestsfrom bs4 import BeautifulSoup
import requestsimport json
config = {}
with open("config.json") as file:    config = json.load(file)["oxylabs"]
USERNAME = config["username"]PASSWORD = config["password"]HOSTNAME = "dc.oxylabs.io"PORT = 8000COUNTRY = "us"
proxy_url = f"http://user-{USERNAME}-country-{COUNTRY}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}


print("----------------------US---------------------")

location_info = requests.get("http://lumtest.com/myip.json", proxies=proxies)print(location_info.text)
response = requests.get('https://www.theguardian.com/', proxies=proxies)
soup = BeautifulSoup(response.text, "html.parser")
subnav = soup.select_one("div[data-testid='sub-nav']")print(subnav.text)

print("----------------------UK---------------------")
COUNTRY = "gb"
proxy_url = f"http://user-{USERNAME}-country-{COUNTRY}:{PASSWORD}@{HOSTNAME}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
location_info = requests.get("http://lumtest.com/myip.json", proxies=proxies)print(location_info.text)
response = requests.get('https://www.theguardian.com/', proxies=proxies)
soup = BeautifulSoup(response.text, "html.parser")
subnav = soup.select_one("div[data-testid='sub-nav']")
print(subnav.text)
Here are some of the things you should notice about this:
  • Earlier, we were constantly checking our location info. location_info = requests.get("http://lumtest.com/myip.json", proxies=proxies) does this once again. Once we've got our location info, we print it to the console so that we can verify our results.
  • COUNTRY: This variable changes later on in the code so we can reset the proxy.
  • proxies: After resetting our country, we need to reset our proxies.
When we run the code, we get the following output.
----------------------US--------------------- {"country":"US","asn":{"asnum":16628,"org_name":"DEDICATED-FIBER-COMMUNICATIONS"},"geo":{"city":"Buffalo","region":"NY","region_name":"New York","postal_code":"14205","latitude":42.8856,"longitude":-78.8736,"tz":"America/New_York","lum_city":"buffalo","lum_region":"ny"}} USUS elections 2024WorldEnvironmentUkraineSoccerBusinessTechScienceNewslettersWellness ----------------------UK--------------------- {"country":"GB","asn":{"asnum":174,"org_name":"COGENT-174"},"geo":{"city":"London","region":"ENG","region_name":"England","postal_code":"EC1N","latitude":51.5074,"longitude":-0.1196,"tz":"Europe/London","lum_city":"london","lum_region":"eng"}} UKWorldClimate crisisUkraineFootballNewslettersBusinessEnvironmentUK politicsEducationSocietyScienceTechGlobal developmentObituaries
First, we'll look at the location comparison here. We cleaned up the important information from the JSON and made it a little easier to read. Our US proxy is located in New York and our UK proxy is located in London.
Proxy CountryRegion NameCity
USNew YorkBuffalo
UKEnglandLondon
Now let's take a closer look at our navbar text from each run.
  • us: USUS elections 2024WorldEnvironmentUkraineSoccerBusinessTechScienceNewslettersWellness
  • gb: WorldUKClimate crisisUkraineEnvironmentScienceGlobal developmentFootballTechBusinessObituaries
Let's make these a little easier to read.
  • us: US | US elections | 2024 | World | Environment | Ukraine | Soccer | Business | Tech | Science | Newsletters | Wellness
  • gb: World | UK | Climate crisis | Ukraine | Environment | Science | Global development | Football | Tech | Business | Obituaries
As you can see, our navbar gets laid out differently based on our location. On the US version of the site, the Top left hand corner of the navbar holds US followed by US Elections. When viewing the site from the UK, the viewer's attention is prioritized a bit differently. The Guardian knows that the average user in the UK is probably not as concerned about the US and US elections, so they instead see World followed by UK. Many websites will prioritize your attention differently based on your location.

Alternative: ScrapeOps Residential Proxy Aggregator

Oxylabs does offer a decent Datacenter Proxy Service with many available price plans. However, we offer a different product with far more features for a pretty good price! Take a look at our ScrapeOps Proxy Aggregator. With our Proxy Aggregator, instead of paying for bandwidth or IP addresses, you pay per request. even better than that... you only pay for successful requests. Our Proxy Aggregator automatically selects the best proxy for you based on our datacenter pools. We source these pools from tons of different providers (including Oxylabs!). If a request fails using a datacenter proxy, we actually retry it using a premium (residential or mobile) proxy. Your request gets upgraded for no additional charge! The table below outlines our pricing.
Monthly PriceAPI CreditsBasic Request Cost
$99,000$0.00036
$1550,000$0.0003
$19100,000$0.00019
$29250,000$0.000116
$54500,000$0.000108
$991,000,000$0.000099
$1992,000,000$0.0000995
$2543,000,000$0.000084667
All of these plans offer the following awesome features:
  • JavaScript Rendering
  • Screenshot Capability
  • Country Geotargeting
  • Residential and Mobile Proxies
  • Anti-bot Bypass
  • Custom Headers
  • Sticky Sessions
Sign up for a free trial account here now! Once you've got a ScrapeOps account and a set of API keys, you can copy and paste the code below to check your proxy connection.
import requestsfrom urllib.parse import urlencode
API_KEY = "your-super-secret-api-key"LOCATION = "us"
def get_scrapeops_url(url, location=LOCATION):    payload = {        "api_key": API_KEY,        "url": url,        "country": location    }    proxy_url = "https://proxy.scrapeops.io/v1/?" + urlencode(payload)    return proxy_url
response = requests.get(get_scrapeops_url("http://lumtest.com/myip.json"))print(response.text)
In the code above, we do the following.
  • Create our configuration variables: API_KEY and LOCATION.
  • Write a get_scrapeops_url() function. This function takes all of our parameters along with a target url and wraps it into a ScrapeOps Proxied url. This is an incredibly easy way to scrape and it makes our proxy code much more modular.
  • Check our IP info with response = requests.get(get_scrapeops_url("http://lumtest.com/myip.json")).
  • Finally, we print it to the terminal. You should get an output similar to this.
{"country":"US","asn":{"asnum":31898,"org_name":"ORACLE-BMC-31898"},"geo":{"city":"Ashburn","region":"VA","region_name":"Virginia","postal_code":"20147","latitude":39.018,"longitude":-77.539,"tz":"America/New_York","lum_city":"ashburn","lum_region":"va"}}

Oxylabs is one of the more reputable proxy providers around. Oxylabs uses only ethically sourced proxies and they comply strictly with GDPR (General Data Protection Regulation) and CCPA (California Consumer Privacy Act). In simple terms, they will not stand for it if you use their product for unethical or illegal collection of private data. Don't use proxy providers to break laws. Don't scrape private data. This is illegal and it harms everyone involved. It harms the proxy provider. It eventually harms you too. If you do something illegal using a proxy, first your action will be traced to the proxy provider. Then, the action will be traced to your account. This sort of thing creates problems for both you and the proxy service.
  • Don't use proxies to access illegal content: These actions can come with intense legal penalties and even prison or jail time depending on the severity of the offense.
  • Don't scrape and disseminate other people's private data: Depending on what jurisdiction you're dealing with, this is also a highly illegal and dangerous practice. Doxxing private user data can also lead to heavy fines and possibly jail/prison time,

Ethical

When we scrape, we don't just need to think about legality, we also need to think about right and wrong in general. Just because something's legal doesn't mean that it's right. Nobody wants to be in the next headline about unethical practices.
  • Social Media Monitoring: Social media stalking can be a very destructive and disrespectful behavior. How would you feel if someone used data collection methods on your account?
  • Respect Site Policies: Failure to respect a site's policies can get your account suspended/banned. It can even lead to legal troubles for those of you who sign and violate a terms of service agreement. In most cases, a terms of service agreement is legally binding.

Conclusion

You've finished our tutorial on Oxylabs Datacenter Proxies. You now have everything it takes to setup an account, and start using these proxies. You learned how to geotarget and you also learned how to use the ScrapeOps Proxy Aggregator. Take your new Oxylabs or ScrapeOps account and go do something with it! You now have the power to start scraping the web, no matter what your tool of choice may be. Go ahead and build a scraper using Requests, Scrapy, Puppeteer, or Playwright. Any of these tools is good and they'll all help you connect to the proxies you want and retrieve the valuable data you need.

More Cool Articles

At ScrapeOps, we really like web scraping. It's alot of fun, and when you learn to do it right, it's an immensely valuable skill. We love scraping so much that we wrote multiple playbooks on it. Pick your poison! No matter what your tech stack is, we can teach you something about scraping the web!