Proxies for web scraping: residential IPs and a Web Unlocker
Rotating residential IPs for most sites, the Web Unlocker for protected ones: which to use, setup and costs.
By DINPROXY Team · · 8 min read
On this page
A scraper that keeps running needs three things: requests spread across many ordinary addresses, pages collected from the market they are written for, and a way to read content that only appears after JavaScript runs. Good proxies for web scraping handle the first two, and a rendering service handles the third. On DINPROXY both sit in one account and sign in with the same proxy users, so you can start every site on residential IPs at $1 / GB and move a site to the Web Unlocker only when it needs it.
What you collect, and which product fetches it
Web scraping means fetching public pages with a program and turning them into structured records: product names and prices, job ads, property listings, company directories, articles or search results. A typical job reads a list or search page, follows the links to detail pages, extracts the fields and stores them with the time of collection. Run it again tomorrow and you have a history.
Without a proxy, every one of those requests arrives from your own server's address. Residential proxies for web scraping send each request through the IP of a home connection instead, so the site sees an ordinary visitor and your load is spread across many addresses. The exit IP also decides which version of a page you collect, because prices, currency, stock and rankings often change by country or city.
Modern sites add a third need: text that is built by JavaScript, or pages guarded by CAPTCHAs and anti-bot checks. For those, the Web Unlocker loads the page for you and returns the finished HTML. You rarely need one product for a whole project, so decide site by site, or even page type by page type:
| Kind of page | Use | Session and location | Why |
|---|---|---|---|
| Static HTML: articles, directories, documentation, listings | Rotating Residential Proxies | Rotating; add a country when content varies by market | Light pages billed per GB, a new IP for every request |
| JSON endpoints a page calls for search, filters or pagination | Rotating Residential Proxies | Rotating | Small responses, so the lowest cost per page |
| Prices, stock or listings that change by state or city | Rotating Residential Proxies | @state= or @city= with @country= | Location down to city level |
| Filters, sort orders or a basket the site remembers between pages | Rotating Residential Proxies | Sticky, @time= of 10 to 30 minutes | One visitor from the first step to the last |
| Pages built by JavaScript that you would rather not render yourself | Web Unlocker | country | Rendering is built in and costs nothing extra |
| Pages behind CAPTCHAs or anti-bot checks | Web Unlocker | country, wait_selector | Retries and checks are handled inside the request; failed requests are free |
| Mobile versions of sites and mobile-only listings | Mobile Proxies | Rotating or sticky, by country | IPs from mobile carrier networks |
A practical default is to send everything through Rotating Residential Proxies first, then move a site to the Web Unlocker once it starts answering with challenge pages or empty templates. Our comparison of the Web Unlocker and residential proxies goes through the trade-offs in more depth. For guides to specific jobs, see price monitoring, SERP tracking and web data for AI training.
Rotation, sticky sessions and locations
Everything about the exit IP is set in the proxy username. Start from your connection username, such as 1024~myuser, and add options as @name=value:
- Rotating (default): with no session option, each request gets a new IP. Use it for listing pages, product pages and anything else that stands on its own.
- Sticky: add
@session=with an ID of your choice and@time=in minutes, from 1 to 120 (10 if you leave it out). Every connection with the same ID keeps the same IP for that long, and a new ID gives you a new IP. - Country:
@country=us, a two-letter code in lower case. - State and city:
@state=and@city=together with the country, in lower case without spaces, such as@country=de@state=hesseor@country=gb@state=england@city=london.
A complete username for a 30-minute session in the United States reads 1024~myuser@country=us@session=job42@time=30.
Two details matter for rotating proxies for web scraping. An HTTPS tunnel or a SOCKS5 connection keeps its IP until it closes, so open a new connection for each page when you want a new IP every time, rather than reusing one with keep-alive. A sticky IP can also change early if it becomes unavailable or after 60 seconds without requests, so give each worker its own session ID and let it carry on under a fresh ID when that happens.
Store the location with every record, so data from different markets never mixes. The guide to rotating vs sticky residential proxies has more worked examples, and the location and sessions reference lists every option. HTTP, HTTPS and SOCKS5 all run on proxy.dinproxy.com:8800, written as http:// or socks5h://; HTTP vs SOCKS5 proxies explains which suits your tool.
Set up your scraper in six steps
- Create an account and add Credits, then open Products → Rotating Proxies, choose the GB and click Get access.
- Under Tools → Users, create a proxy user for this scraper. Its full connection username, such as
1024~myuser, and its password are what your code signs in with. An optional traffic limit caps what this one scraper can use. - If the scraper runs on a server with a fixed IP, it can also connect without a password once you add that IP under Tools → Whitelist; that traffic is charged to your account balance. For location or session options, send your account number with them as the username, such as
1024@country=us, and an empty password. - In Connection setup, pick the location and session type and generate up to 500 endpoints in the format your tool imports. The endpoints guide explains each format.
- Test one endpoint against
https://httpbin.org/ip. With a rotating username the IP changes on every run; with a session ID it stays the same. - For sites that need rendering, open Products → Web Unlocker, buy results in units of 1k and copy the settings from Connect your tools. The same proxy user signs in there.
A scraper that hands hard pages to the Web Unlocker
This example fetches each URL through a rotating US residential IP and retries with a longer pause and a new IP when the site refuses. Only if every attempt fails does it send the page to the Web Unlocker API. Each page is appended to pages.jsonl with the time it was fetched.
// npm install undici, save as scrape.mjs, then run: node scrape.mjsimport { fetch, ProxyAgent } from "undici";import { appendFileSync } from "node:fs";
const USER = "1024~myuser";const PASSWORD = "YOUR_PASSWORD";const basic = (user) => `Basic ${Buffer.from(`${user}:${PASSWORD}`).toString("base64")}`;const urls = ["https://example.com/page-1", "https://example.com/page-2"];const headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36", "accept-language": "en-US,en;q=0.9",};const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// A rotating US residential IP; each attempt opens a new connection, so a new IP.async function viaResidential(url, tries = 3) { for (let attempt = 0; attempt < tries; attempt++) { const dispatcher = new ProxyAgent({ uri: "http://proxy.dinproxy.com:8800", token: basic(`${USER}@country=us`) }); try { const res = await fetch(url, { dispatcher, headers, signal: AbortSignal.timeout(30_000) }); if (res.ok) return await res.text(); if (![403, 429, 503].includes(res.status)) return null; } catch { // timeout or network error: try again } finally { await dispatcher.close(); } await sleep(2 ** attempt * 1000 + Math.random() * 1000); } return null;}
// Pages that keep refusing go to the Web Unlocker: 1 result per success, failures are free.async function viaUnlocker(url) { const res = await fetch("https://app.dinproxy.com/api/unblocker/request", { method: "POST", headers: { authorization: basic(USER), "content-type": "application/json" }, body: JSON.stringify({ target_url: url, country: "us" }), signal: AbortSignal.timeout(130_000), }); const body = await res.json().catch(() => ({})); return body.success ? body.data.html : null;}
for (const url of urls) { const html = (await viaResidential(url)) ?? (await viaUnlocker(url)); appendFileSync("pages.jsonl", JSON.stringify({ url, fetched_at: new Date().toISOString(), html }) + "\n"); await sleep(1000 + Math.random() * 2000);}Replace 1024~myuser and YOUR_PASSWORD with your proxy user and put your own pages in the list. If your scraper already expects a proxy, proxy mode is an alternative to the API: point it at unblocker.dinproxy.com:8802 with the same proxy user, and have it trust the DINPROXY Web Unlocker certificate or skip the certificate check for that proxy. For more Python detail, read how to use a proxy with Python requests.
Pacing, concurrency and retries
A scraper that is gentle with a site is also the one that keeps working. Plan the load before you scale up:
- Stay within 100 connections. Each account can keep up to 100 proxy connections open at once, residential and mobile together; beyond that you get
429 TOO_MANY_CONNECTIONS. Size your worker pool below the limit and close connections you no longer need. - Limit each site separately. Start with a handful of parallel requests per domain, add a random pause of one to three seconds, and raise the rate only while responses stay clean.
- Back off on refusals. On
403,429or503, wait longer before each retry, honour anyRetry-Afterheader and set the URL aside after a few attempts. - Give the Web Unlocker time. A request can take up to two minutes, so set your client timeout to about 130 seconds for the API and 150 seconds for proxy mode. Up to 100 requests can run at once per account.
- Retry without paying twice. Send an
Idempotency-Keyheader with each Web Unlocker request. Repeating it within 24 hours returns the stored result without a new charge; after a502or504, use a new key. - Fetch changing pages more often. Track how often each page actually changes and schedule slow-moving ones less often, so your traffic goes where the data is new.
Errors & troubleshooting lists every status the proxy returns, and how to scrape a website without getting blocked covers headers and pacing in more detail.
What web scraping costs
Rotating Residential Proxies cost $1 / GB, so the bill follows the bytes you download. A plain HTTP client fetches only the HTML, which is far lighter than loading the page in a browser with all its images and scripts. Here is a worked example; the page counts and sizes are assumptions, so replace them with your own:
| Part of the job | Assumption | Cost |
|---|---|---|
| Product pages through residential proxies | 200,000 pages a month at 400 KB of HTML each, about 80 GB | $80.00 |
| Two protected sites through the Web Unlocker | 10,000 successful pages at $1 / 1k results | $10.00 |
| Total for the month | $90.00 |
Retries and redirects use traffic too, so add a margin to the GB. On the Web Unlocker, failed requests are free, and JavaScript rendering and screenshots cost nothing extra. If some pages need mobile carrier IPs, Mobile Proxies cost $2 / GB.
Before you commit, run a small test: collect a few hundred of your real pages, read the traffic used in the dashboard and divide it by the number of pages. That gives your own average page size for the sum above. Purchased residential traffic never expires, so a larger purchase can be used up over as many months as your project runs.
Scraping responsibly
Collect public pages only, and leave anything behind a login, a paywall or other access controls alone. Read each site's terms and robots.txt, keep your request rate at a level the site can comfortably serve, and follow the laws that apply to you and to the data. When pages hold personal data, such as names on reviews or profiles, you need a lawful basis under GDPR and similar laws: collect only the fields your project needs and store them securely. Our acceptable use rules ask the same of every account.
Frequently asked questions
A proxy forwards your scraper's requests so the target site sees the proxy's IP address instead of your server's. Residential proxies use the IPs of home connections, and rotating them gives each request a new IP so your load is spread across many addresses.
For most public sites, rotating residential proxies fit best: each request comes from a home connection's IP, and you can choose the country, state or city. For pages that need JavaScript rendering or sit behind CAPTCHAs and anti-bot checks, use the Web Unlocker, which returns the finished page.
Use rotating sessions, a new IP per request, for pages that stand on their own, such as listings and product pages. Use a sticky session, which keeps one IP for up to 120 minutes, when the site remembers your filters or basket across several pages.
DINPROXY Rotating Residential Proxies cost $1 / GB, and purchased traffic never expires. If your pages average 400 KB of HTML, 1 GB covers about 2,500 pages; the Web Unlocker costs $1 / 1k results, and failed requests are free.
It depends on where you are, the site's terms and the data you collect. Collecting publicly available pages is widely done, but content behind logins or paywalls should be left alone, and personal data needs a lawful basis under laws such as GDPR. This is general information, not legal advice.