Only the http key is set
The key names the scheme of the target, not of the proxy. A dictionary with only http routes plain HTTP and lets every HTTPS call go out directly, with no error to tell you.
Point requests at one static ISP address: a single IP on a named internet provider's network, kept for the period you pay for. The code below was run against an authenticated proxy before it was published.
In short: Pass a proxies dictionary with both the http and https keys, each set to http://USERNAME:PASSWORD@HOST:PORT, and requests sends the call through the proxy; HTTPS targets go through it as a tunnel. For SOCKS5, install requests[socks], switch the proxy to SOCKS5 on your order and use the socks5h scheme, so the proxy resolves hostnames instead of your machine.
Python requests takes its proxy from a dictionary that maps the scheme of the target URL to a proxy URL. This guide sets that dictionary for one static ISP address and shows the three places it can live: on a call, on a session, or in the environment.
Most proxies, ours included, ask for a username and password. requests reads them from the proxy URL and sends them to the proxy on every connection. For an HTTPS target the proxy opens a tunnel and never sees the content of the request. The code tabs show the per-request and the session form.
Host, port, username and password, from My Proxies in the dashboard or from the order in the API. Each address has its own four; there is no shared gateway.
http://USERNAME:PASSWORD@HOST:PORT. If the password contains /, ?, # or %, URL-encode it first with urllib.parse.quote(password, safe="").
Give the same URL to the http and the https key. With only http set, every HTTPS request skips the proxy and leaves from your own address.
Request a page that shows the caller’s IP, or open What Is My IP through the same proxy, and confirm it is the address you bought.
Always pass timeout=: requests waits forever by default, and a stalled connection then looks like a hung script.
import requests
# The four values come with your order (dashboard or API)
proxy = "http://USERNAME:PASSWORD@HOST:PORT"
response = requests.get(
"https://example.com/",
proxies={"http": proxy, "https": proxy},
timeout=30,
)
response.raise_for_status()
print(response.status_code)
import requests
proxy = "http://USERNAME:PASSWORD@HOST:PORT"
with requests.Session() as session:
# HTTP_PROXY / HTTPS_PROXY in the environment would override
# session.proxies; this makes the session use only its own setting.
session.trust_env = False
session.proxies.update({"http": proxy, "https": proxy})
response = session.get("https://example.com/", timeout=30)
response.raise_for_status()
print(response.status_code)
# pip install "requests[socks]"
import requests
# Switch the proxy to SOCKS5 first; use the values the order then shows.
# socks5h: the proxy resolves the hostname, not your machine.
proxy = "socks5h://USERNAME:PASSWORD@HOST:PORT"
response = requests.get(
"https://example.com/",
proxies={"http": proxy, "https": proxy},
timeout=30,
)
response.raise_for_status()
print(response.status_code)
Each sample connects through an HTTP proxy with a username and password, except the SOCKS5 one, which needs the proxy switched to SOCKS5 first; the order then shows a new port and new credentials to use. Replace the four capitals with your order's values.
| Scope | Credentials | When to use it | |
|---|---|---|---|
| proxies= on a call | That one request | In the URL | A script with a handful of calls |
| Session.proxies | Every request of the session | In the URL | Anything longer, with trust_env set to False |
| HTTP_PROXY and HTTPS_PROXY | Every requests call in the process | In the URL | Code you cannot edit; NO_PROXY lists the hosts to skip |
| socks5h:// URL | Whatever scope it is set at | In the URL | When hostnames should be resolved at the proxy |
The key names the scheme of the target, not of the proxy. A dictionary with only http routes plain HTTP and lets every HTTPS call go out directly, with no error to tell you.
With socks5 your machine resolves the hostname and hands the proxy an IP. With socks5h the proxy resolves it, so the lookup and its answer come from the proxy's network, which matters for sites that answer by location.
A slash, question mark or hash in the password cuts the URL short, and requests fails before it reaches the proxy; a percent sign is decoded as an escape. URL-encode the password, or use IP whitelist authentication and leave the credentials out.
requests reads HTTP_PROXY, HTTPS_PROXY and NO_PROXY unless you set trust_env to False on the session, and those variables override Session.proxies. A stale variable on a server can send a session's traffic somewhere you did not intend, or around the proxy.
Put the username and password in the proxy URL, http://USERNAME:PASSWORD@HOST:PORT, and pass it for both the http and https keys. requests sends the credentials to the proxy, which answers 407 if they are wrong. Encode a password that contains reserved characters, or use an IP whitelist instead.
Install the extra with pip install requests[socks], switch the proxy itself to SOCKS5 on your order, and use the port and credentials the order then shows in a socks5h:// URL. Changing the scheme alone is not enough: an address set to HTTP does not answer SOCKS5 until it is switched. SOCKS5
Yes. Add the public IPv4 address your script runs from to the proxy's whitelist with one API call, PUT /orders/ORDER_ID/whitelist, or through the MCP server; the dashboard has no control for it yet. The proxy then accepts connections from that address without credentials, over HTTP and over SOCKS5, and the URL becomes http://HOST:PORT. While a whitelist is set, the proxy admits only the listed addresses and the username and password stop working for that order; sending an empty list turns the whitelist off and password login works again.
No. A static ISP proxy is one address for the period you pay for, and every request you send through it leaves from that address. If a job needs a different address per request, that is a rotating pool, which we do not sell yet.
Request a page that echoes the caller's address through the same proxy, or open What Is My IP from a browser set to it. If it shows your own address, the https key is probably missing. What Is My IP
Testing your own sites by region, quality checks, ad verification, price and market research and brand protection need no review under our acceptable use policy. The proxy does not get around CAPTCHAs, bot detection, rate limits or account bans, and the policy forbids using it to try. Acceptable Use Policy