Guide · Scraping practice
403 Forbidden through a proxy: is it the IP, the fingerprint or the site?
First find out who sent the 403. If the proxy refused your CONNECT (curl prints CONNECT tunnel failed, response 403, requests raises a ProxyError), the website never saw you and the cause is the target, port or plan you asked for; a 407 instead means your proxy credentials. If the tunnel opened and the website answered 403, the cause is the site's own rules, the exit IP, your client's fingerprint, or a challenge that needs a real browser, and comparing the same request without the proxy, through it, and from a browser through the same exit tells you which. A proxy changes only the IP, so it fixes only the IP case.
Reviewed 19 Nov 2026
The short answer
- Check the proxy's answer before the website's: curl's
%{http_connect}is the proxy's status,%{http_code}the site's. In our local test a refused tunnel gave403and000. - For a plain
http://URL a proxy's 403 arrives as an ordinary response in requests (status 403, no exception), so read the headers before you blame the site. server: cloudflare,cf-ray,datadome,incap_ses_or_pxcookies tell you which service fronts the site, not why you were refused.cf-mitigated: challengeis Cloudflare's documented marker for a challenge page.- A browser User-Agent string does not make requests look like a browser: we saw it offer only HTTP/1.1, and its TLS handshake stays Python's. JA3/JA4 and HTTP/2 fingerprints are read from the connection, not from headers.
- If a browser through the same exit IP gets 200, the IP is fine and the cause is your client. If the browser gets 403 too, it is the IP, the region or the site.
- A proxy fixes only the IP part. ARC does not get you past a bot-management challenge, and a challenge is a site telling you it does not want automated clients.
First question: did the proxy or the website send the 403?
For an HTTPS page your client first asks the proxy to open a tunnel with CONNECT host:443. RFC 9110 says any 2xx answer opens the tunnel and any other answer means no tunnel was formed, so a 403 at that step comes from the proxy and the website never received a request. The HTTP CONNECT glossary entry shows the exchange.
RFC 9110 also tells proxies to restrict CONNECT to known ports or a list of safe targets, with the example that an open CONNECT to port 25 could be used to relay spam. A proxy's 403 therefore usually means the port, the target or your plan is not allowed, not that the website dislikes you. Our acceptable use policy lists what ARC may not be used for.
Reproduced on 2026-11-19 against a local proxy that refuses every tunnel with 403: requests 2.34.2 raised ProxyError(... OSError('Tunnel connection failed: 403 Forbidden')), and curl 8.7.1 exited with code 56 and curl: (56) CONNECT tunnel failed, response 403. Chrome reports the same situation as ERR_TUNNEL_CONNECTION_FAILED and hides the proxy's body.
| What you see | Who answered | What it means |
|---|---|---|
curl (56) CONNECT tunnel failed, response 407; requests Tunnel connection failed: 407 | The proxy | Missing or wrong proxy credentials; see CONNECT tunnel failed, 407 |
curl (56) ... response 403; requests Tunnel connection failed: 403 Forbidden | The proxy | The proxy refuses this target, port or plan. Retrying will not help |
curl (56) ... response 502 or 503 | The proxy | The proxy could not reach the site; see proxy 502 and 503 errors |
%{http_connect} is 200, %{http_code} is 403 | The website | Read on: the site refused the request that came out of the tunnel |
http:// URL, status 403, no exception | Either | No tunnel is used, so the proxy's own 403 looks like the site's. Compare the headers with a known proxy error |
The last row caught us in testing: with an http:// URL there is no CONNECT, the proxy relays the request itself, and requests returned the proxy's refusal as status_code == 403 with the proxy's text body. Look at Server and the body before reading anything into it.
Four causes behind a website's 403
Once you know the site answered, the cause sits in one of four layers. The test in the next sections separates them; the table says what each one looks like.
| Layer | Typical causes | What points to it | Does a different proxy IP help? |
|---|---|---|---|
| Application | Login or API key missing, insufficient rights, a required header or Referer missing, content licensed only for some countries | Same 403 without the proxy and from a browser; a readable error page or JSON body | Only for geo-blocking, by choosing an exit in an allowed country (see geo-blocking) |
| IP | The exit's reputation, its network type (ASN, datacenter ranges), its country | Direct works, the proxy gets 403, and a browser through the same exit also gets 403 | Yes: another exit, another country or another IP type |
| Client fingerprint | TLS handshake (JA3/JA4), HTTP/2 settings, header set and order, a User-Agent that contradicts the rest, such as requests' default python-requests/2.34.2 | A browser through the same exit gets 200, your script gets 403, with or without the proxy | No. The same client is refused from any IP |
| Vendor challenge | A JavaScript or interactive check the page wants run before it serves content | cf-mitigated: challenge or a vendor block page; a browser sees a short interstitial, then the page | No. It wants a browser, not a different address |
Several layers can be in play at once: a site can refuse a datacenter range and also challenge clients without JavaScript. That is why the test changes one thing at a time.
Why a browser User-Agent does not make requests look like a browser
Copying a Chrome User-Agent into requests changes one header. On our local test server requests 2.34.2 still sent only User-Agent, Accept-Encoding: gzip, deflate, Accept: */* and Connection: keep-alive, in that order, and offered only http/1.1 during the TLS handshake, where curl 8.7.1 offered h2. A current Chrome sends a longer header set, negotiates HTTP/2 and, like other Chromium-based browsers, sends Sec-CH-UA client hints by default (MDN). A request claiming to be Chrome without any of that contradicts itself.
The TLS layer is read before any header. Cloudflare's docs describe JA3 and JA4 as fingerprints of how a client starts the TLS connection, stable across destinations, and usable in its rules to block or challenge a specific fingerprint. Akamai researchers showed in 2017 that HTTP/2 clients can be told apart passively by their SETTINGS, WINDOW_UPDATE and PRIORITY frames and pseudo-header order. Neither changes when you swap the User-Agent string or the proxy.
So the honest summary is: if the cause is the client, the remedy is a client that the site accepts, usually a real browser through Playwright, and only where the site's terms allow automated access. The test below uses a visible window rather than a headless browser, so you see what a person would see, including any challenge.
A four-run test that isolates the cause
Change one variable per run and keep the rest fixed. Use a sticky session for every proxied run, because a rotating username means each new connection can get a different exit IP, and you want the script and the browser to leave from the same address. The same _session- handle returns the same exit IP for the time you set; an exit can still go offline early, so compare the printed IPs.
- Run A, script without proxy. Your own IP, your real client. This is the baseline.
- Run B, script through the proxy. Same client, the exit IP changes. Print the exit IP, ASN and country with
https://api.arcproxy.cloud/api/v1/ip?format=json(the what is my IP endpoint; geolocation by DB-IP). - Run C, browser without proxy. A normal browser on your own connection. If this gets 403, the problem is not your code.
- Run D, browser through the same sticky exit. Same IP as run B, a real browser. This is the run that separates IP from fingerprint.
- Optional run E, script through the proxy with your browser's User-Agent. If this alone flips 403 to 200, the site filtered on the User-Agent string, the simplest case there is.
Before run B, put the proxy string through the proxy tester: it reports a refused tunnel as "The proxy refused the tunnel" with the status, which rules out the proxy-side 403 in one step. The proxy location checker confirms the exit is in the country you asked for, which matters when the 403 is a regional block.
Decision table: what each result means
| A: script direct | B: script via proxy | C: browser direct | D: browser via same exit | Most likely cause | Next step |
|---|---|---|---|---|---|
| 200 | 403 | 200 | 403 | The exit IP: reputation, network type or country | Try another sticky session, another country or another IP type |
| 200 | 403 | 200 | 200 | Client and IP together: a browser is accepted from this exit, your script only from your own IP | Fix the client first; the exit itself is not blocked |
| 403 | 403 | 200 | 200 | Your client fingerprint | A different proxy will not help. Use a real browser where allowed |
| 403 | 403 | 403 | 403 | Application rule or region: login, permissions, licensing | Read the body; check whether the content is public and which countries it serves |
| 403 | 403 | Challenge, then 200 | Challenge, then 200 | A vendor JavaScript challenge | It wants a browser. Check the site's terms or look for an official API |
| Any | Proxy error, no status | Any | Proxy error | The proxy refused the tunnel (403) or credentials (407) | Check the port, target and plan; see the first section |
A 200 in run D with a 403 in run B is the clearest result you can get: the exit IP is acceptable to the site and the difference is entirely in the client. If the 403s come only after many requests, it is closer to rate limiting than to a block; handling 429 rate limits covers backoff, and why rotating proxies get blocked covers what changes when you rotate.
What a proxy can fix, and what it cannot
- It can change the IP: another exit, another country through
_country-, or another network type. If the 403 follows the IP type, compare the residential pool with the ISP-registered addresses of the ISP pool; for a site that needs one address over days, a static ISP IP keeps it. - It can show you a region's view: for a licensing or geo-block, an exit in an allowed country is the intended fix, and the location checker proves where you exit.
- It cannot change your fingerprint: TLS, HTTP/2 and header order travel through the tunnel untouched. The same script is the same client from any IP.
- It cannot pass a challenge or a login: ARC does not bypass any bot-management system, and we do not offer to. A challenge is the site saying it does not want automated access to that page; respecting robots.txt and the site's terms come before any workaround.
- It cannot make retries succeed: RFC 9110 says not to repeat a 403 with the same credentials, and MDN that an unchanged request should fail again. Retrying a 403 in a loop only spends bandwidth.
Google's "unusual traffic" page is a separate case with its own causes; see Google unusual traffic error. For the Python side of proxy errors that never reach the site, see requests ProxyError.
Code
Worked example
PROXY="http://USERNAME_pool-arcfast_country-de_session-k3f9a1x2_sesstime-10:PASSWORD@proxy.arcproxies.io:8000"URL="https://example.com/" # the page that answers 403# 1. The exit this sticky session uses: IP, ASN, countrycurl -sS -x "$PROXY" "https://api.arcproxy.cloud/api/v1/ip?format=json"; echo# 2. Who answered? %{http_connect} = the proxy's answer to CONNECT,# %{http_code} = the website's. -D - prints both response heads.curl -sS -o body.html -D - -x "$PROXY" "$URL" \ -w 'proxy CONNECT: %{http_connect} site: %{http_code} curl exit: %{exitcode}\n' \ | grep -iE '^(HTTP/|server:|cf-ray:|cf-mitigated:|set-cookie:|x-datadome|content-type:)|proxy CONNECT'# Reproduced on 2026-11-19 with curl 8.7.1 against local test servers:# proxy refuses the tunnel -> curl: (56) CONNECT tunnel failed, response 403# proxy CONNECT: 403 site: 000 curl exit: 56# tunnel opens, site says no -> HTTP/1.1 200 Connection established# HTTP/1.1 403 Forbidden ...# proxy CONNECT: 200 site: 403 curl exit: 0# 3. Same request without the proxy, for comparisoncurl -sS -o /dev/null -w 'direct: %{http_code}\n' "$URL"import reimport requestsPROXY = "http://USERNAME_pool-arcfast_country-de_session-k3f9a1x2_sesstime-10:PASSWORD@proxy.arcproxies.io:8000" # sticky: same exit for every callURL = "https://example.com/" # the page that answers 403IP_URL = "https://api.arcproxy.cloud/api/v1/ip?format=json"# Who fronts the site. These also appear on 200 responses: they name the# service in front of the site, not the reason for the 403.SERVER = {"cloudflare": "Cloudflare", "akamaighost": "Akamai"}HEADERS = {"cf-ray": "Cloudflare", "x-datadome": "DataDome"}COOKIES = {"datadome": "DataDome", "incap_ses_": "Imperva", "visid_incap_": "Imperva", "_px": "HUMAN (PerimeterX)", "bm_sv": "Akamai"}BODY = {"incapsula incident id": "Imperva", "_incapsula_resource": "Imperva", "perimeterx.net": "HUMAN (PerimeterX)"}def vendors(r): found = set() server = r.headers.get("server", "").lower() found |= {v for k, v in SERVER.items() if k in server} found |= {v for k, v in HEADERS.items() if k in r.headers} found |= {v for k, v in COOKIES.items() for c in r.cookies.keys() if c.startswith(k)} body = r.text[:50_000].lower() found |= {v for k, v in BODY.items() if k in body} return sorted(found)def run(label, proxy=None, headers=None): s = requests.Session() s.headers.update(headers or {}) proxies = {"http": proxy, "https": proxy} if proxy else None try: ip = s.get(IP_URL, proxies=proxies, timeout=20).json() r = s.get(URL, proxies=proxies, timeout=30) except requests.exceptions.ProxyError as err: # The PROXY refused the tunnel; the website never saw the request. print(f"[{label}] proxy refused: {err}") return title = re.search(r"<title>(.*?)</title>", r.text, re.I | re.S) print(f"[{label}] exit {ip.get('ip')} AS{ip.get('asn')} {ip.get('country')}") print(f" status {r.status_code} server={r.headers.get('server')} " f"cf-mitigated={r.headers.get('cf-mitigated')} type={r.headers.get('content-type')}") print(f" cookies={list(r.cookies.keys())} vendor hints={vendors(r)}") print(f" title={title.group(1).strip()[:80] if title else None!r}")# Copy the exact string from your own browser (about:version or DevTools).BROWSER_UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36")run("A direct") # your IP, your clientrun("B proxy", PROXY) # same client, other IPrun("E proxy + browser UA", PROXY, {"User-Agent": BROWSER_UA}) # same IP, other UA stringfrom playwright.sync_api import sync_playwrightURL = "https://example.com/"with sync_playwright() as p: browser = p.chromium.launch( headless=False, # a visible window: you see any challenge proxy={ "server": "http://proxy.arcproxies.io:8000", # credentials as separate fields "username": "USERNAME_pool-arcfast_country-de_session-k3f9a1x2_sesstime-10", # the SAME session handle as the script "password": "PASSWORD", }, ) page = browser.new_page() ip = page.goto("https://api.arcproxy.cloud/api/v1/ip?format=json") print("exit", ip.json() if ip else None) # must match run B's exit IP r = page.goto(URL) print("first response", r.status if r else None, r.headers.get("server") if r else None) page.wait_for_timeout(8000) # give an interstitial time to finish print("after wait", page.url, page.title()) browser.close()FAQ
Questions
Something not covered? Write to contact@arcproxies.io.
How do I know if the 403 comes from the proxy or the website?
Look at the CONNECT step. curl's -w '%{http_connect}' prints the proxy's answer and '%{http_code}' the site's: 403 and 000 means the proxy refused the tunnel, 200 and 403 means the website refused you. In Python, a ProxyError with 'Tunnel connection failed: 403' is the proxy; a response object with status_code 403 is the website for HTTPS URLs.
What is the difference between a 403 and a 407 from a proxy?
A 407 means the proxy wants valid proxy credentials; fix the username or password and it goes away. A 403 to CONNECT means the proxy understood you but will not open a tunnel to that target or port, so new credentials or retries will not change it.
Why does my request work in the browser but return 403 in Python requests?
Usually because the site recognises the client, not the IP. requests sends a short default header set with a python-requests User-Agent, speaks HTTP/1.1 and has Python's TLS handshake; a browser differs in all of these. Run the browser through the same sticky proxy exit: if it gets 200 there too, the IP is fine and the difference is the client.
Will a residential proxy fix a 403?
Only if the cause is the IP: a datacenter range, an address with poor reputation or the wrong country. If a browser through the same exit gets 200, the IP was never the problem, and if the site serves a JavaScript challenge or wants a login, no proxy changes that.
Does a cf-ray header mean Cloudflare blocked me?
No. Cloudflare adds Cf-Ray to responses it serves, including successful ones, so it only tells you the site is behind Cloudflare. The documented marker for a challenge page is the cf-mitigated: challenge header; without it, read the body to see whether it is a Cloudflare block page or the site's own error.
Should I retry a 403?
Not unchanged. RFC 9110 says a client should not repeat a 403 with the same credentials, and MDN notes that the same request is expected to fail again. Change one thing, such as the exit, the client or the region, and treat a repeated 403 as an answer.
Sources & review
Last reviewed by the ARC Proxies team. Prices are read from the live catalog at build time.
- [1]IETF: RFC 9110: HTTP Semantics, 15.5.4 403 Forbidden
- [2]IETF: RFC 9110: HTTP Semantics, 9.3.6 CONNECT
- [3]MDN Web Docs: 403 Forbidden
- [4]Cloudflare: Cloudflare HTTP headers (Cf-Ray in responses)
- [5]Cloudflare: Detect a challenge page response (cf-mitigated)
- [6]Cloudflare: JA3/JA4 fingerprint
- [7]Akamai / Black Hat Europe 2017: Passive Fingerprinting of HTTP/2 Clients (Elad Shuster)
- [8]Akamai TechDocs: Cookies and local storage (bm_sv, Akamai Bot Manager)
- [9]DataDome: Protection API (datadome cookie, X-DataDome headers)
- [10]HUMAN Security: Use of cookies & web storage (_px*, _pxhd, _pxvid)
- [11]wafw00f (EnableSecurity): WAF detection plugins: cloudflare.py, incapsula.py, kona.py, perimeterx.py
- [12]MDN Web Docs: Sec-CH-UA header
Next
Where to go from here
Guides