Python
requests, httpx, aiohttp, async concurrency
Docs · quick start · checked 13 November 2026
The first request takes one line. After that, this page is the reference: username parameters, session rules, the errors you may meet, limits, and where each library guide lives.
Quick answer
How do I connect to CrawlRelay proxies?
CrawlRelay proxies connect through one gateway: gw.crawlrelay.com on port 7777 for HTTP and HTTPS, or port 7778 for SOCKS5. Country, city, US state, ZIP, ASN and a sticky session of up to 30 minutes go in the username. Residential traffic starts at $1.50 for 1 GB, paid in crypto.
| Gateway host | gw.crawlrelay.com |
|---|---|
| HTTP / HTTPS port | 7777 (HTTPS sites through CONNECT) |
| SOCKS5 port | 7778 (use socks5h:// so DNS resolves at the exit) |
| Authentication | Username and password of your plan or of a sub-user, or an IP allowlist (up to 10 IPs) |
| Username format | USERNAME-country-{cc}-state-{state}-city-{city}-zip-{zip}-asn-{asn}-session-{id}-ttl-{minutes} |
| Session length | up to 30 minutes; the IP can change earlier |
| Test URL | https://api.ipify.org returns the exit IP as plain text |
| Management API | https://crawlrelay.com/api/v1, API keys you can revoke at any time (API docs) |
Run one command with the username and password from the dashboard: it prints the exit IP that websites see. Each example below asks api.ipify.org for that address. Run it twice and the IP usually changes, because each run opens a new connection to the gateway and a new connection gets an IP from the pool. If the command fails, the status line tells you whether the gateway or the target answered.
curl -x http://USERNAME-country-us:[email protected]:7777 https://api.ipify.orgimport requests
proxy = "http://USERNAME-country-us:[email protected]:7777"
r = requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=(10, 30))
print(r.text)import { ProxyAgent, fetch } from "undici";
const dispatcher = new ProxyAgent("http://USERNAME-country-us:[email protected]:7777");
const res = await fetch("https://api.ipify.org", { dispatcher });
console.log(await res.text());Append targeting to the dashboard username with hyphens, in the documented order; every part is optional. Values are lowercase, and city names use underscores (new_york, sao_paulo). City availability varies by country.
The proxy generator in the client area writes the same usernames for you: choose a country, state, city, ZIP code or provider, pick rotating or sticky with a duration from 1 to 30 minutes, and download up to 1,000 lines as host:port:user:pass, a proxy URL, curl commands or Python requests code.
| Goal | Username |
|---|---|
| Any country, rotating per connection | USERNAME |
| Germany | USERNAME-country-de |
| Paris | USERNAME-country-fr-city-paris |
| Texas | USERNAME-country-us-state-tx |
| One ZIP code | USERNAME-country-us-zip-10001 |
| One internet provider | USERNAME-country-us-asn-7922 |
| Same IP for up to 30 minutes | USERNAME-country-gb-session-abc123-ttl-30 |
If your password contains @, : or /, URL-encode it before you put it in a proxy URL. The 407 error page shows how.
Without a session ID the exit can change on every new connection; with one, it stays for the ttl you set, up to 30 minutes. A username without session- gets an IP from the pool on each new TCP connection, usually a different one. A username with session-<id>-ttl-<minutes> keeps the same exit IP for that ID until the TTL ends or the residential device goes offline.
The sessions guide covers connection reuse in each library.
First find out who answered: the gateway, the browser, your own client or the website. CrawlRelay counted 15 proxy errors in its error reference; the six below are the usual suspects during a first setup.
| You see | Sent by | Usual cause | What to do |
|---|---|---|---|
| 407 | Gateway | Wrong or unencoded credentials | Fix the username or password; never retry blindly |
| ERR_TUNNEL_CONNECTION_FAILED | Browser | CONNECT refused (often a hidden 407) | Pass credentials as fields, not in the server URL |
| 502 / 504 | Gateway or CDN | Exit dropped, target slow or down | Retry on a new connection, with a cap |
| 403 | Website | Wrong country, headers, rate, or a refusal | Check in a browser; slow down or respect the refusal |
| 429 | Website | Rate limit | Honour Retry-After; lower per-host concurrency |
| SSL: WRONG_VERSION_NUMBER | Your client | https:// in front of the proxy URL | Use http:// for the proxy URL |
All 15 entries are in the error reference.
CrawlRelay refuses banking, government and payment-portal sites and SMTP ports, and bills traffic per GB rather than per thread.
Manage logins, the IP allowlist and usage in the dashboard, or through the REST API with an API key you can revoke. The API lives at https://crawlrelay.com/api/v1. The main tasks:
Start with the 1 GB plan at $1.50, then buy 50 GB or more at $0.50/GB once the scraper runs cleanly. One gigabyte is enough for thousands of curl tests or a trial crawl of HTML pages, and unused traffic never expires, so nothing is lost if the project pauses.
Payment works in two steps. First top up the balance with BTC, USDT, USDC, ETH, SOL, LTC, from $25. Then buy any plan from that balance; the login appears in the dashboard once the purchase goes through. CrawlRelay has no free trial. When a purchase costs less than the minimum top-up, the part added only to reach the minimum can be refunded on request within 30 days, in USDT or USDC, if it is unspent. Full price list: CrawlRelay pricing.
requests, httpx, aiohttp, async concurrency
Middleware, sessions per request, AutoThrottle
Python and Node.js, proxy per context
Flag plus page.authenticate()
Authenticated proxy through a local forwarder
undici, axios, got, SOCKS5
HTTP, SOCKS5, debugging with -v
Connection reuse, TTL, one IP per flow
Per-host limits, throughput and backoff
CrawlRelay publishes guides for Python (requests, httpx, aiohttp), Scrapy, Playwright, Puppeteer, Selenium, Node.js and curl, plus a reference of 15 proxy errors and a REST API reference. Every example uses the real gateway host and ports.
No. CrawlRelay accepts username and password logins from any machine, so the same scraper runs on a laptop, a server or a CI runner. An allowlist of up to 10 IPs is optional; keep credentials in environment variables, never in a repository.
Either the username carries a session ID, which keeps one IP on purpose, or the client reuses one kept-alive connection. CrawlRelay rotates per new connection, so remove the session part or open a new connection per request.
Use the HTTP port 7777 for scraping: every library and browser supports it with a password, and HTTPS sites pass through CONNECT tunnels. Use CrawlRelay SOCKS5 on port 7778 for tools that only speak SOCKS, with socks5h so DNS resolves at the exit.
CrawlRelay bills per GB, not per request, and the limits a crawl meets first are those of each target. Pace each site separately and back off on 429 and 503; before a very large crawl, write to [email protected].
Send the first request through a residential IP
$1.50 for 1 GB to test, $0.50/GB from 50 GB, traffic that never expires.
From $0.50/GB · no KYC
Get started