Best Proxies for Python Requests 2026 cover

To use a proxy with Python Requests, pass proxies={"http": proxy_url, "https": proxy_url} and set an explicit timeout. Below, compare eight python requests proxy providers by entry price, targeting and session options, then use the HTTP and SOCKS5 examples.

Start with one authenticated request, explicit timeouts and a verified response. Then add connection reuse, rotation or bounded retries according to what the application actually needs.


Key Facts

  • The proxies dictionary maps destination schemes, such as http and https, to proxy URLs.
  • Install requests[socks] to use SOCKS proxies.
  • socks5h resolves destination hostnames through the proxy; socks5 resolves them locally.
  • Environment proxy settings can override session.proxies.
  • Requests has no default timeout.
  • A Requests Session does not itself reserve an exit IP.

python requests proxy: Quick setup

A python requests proxy is configured with a proxy URL and a destination-to-proxy mapping. The proxy URL’s scheme describes the connection to the proxy, while the dictionary key describes the destination URL.

An HTTPS destination can use an http:// proxy through an HTTP CONNECT tunnel. Do not change the proxy URL to https:// unless that endpoint supports TLS connections to the proxy. See the Requests proxy documentation.

Before buying, verify that the provider supports your destination, required exit country and session duration. Compare the minimum purchase and any targeting surcharge.


Best proxies for Python Requests at a glance

Compare entry costs and configuration requirements before committing to a provider. These are purchasing options, not evidence that one network performs better than another.

Third-party prices and limits (as of November 2026) below come from the linked official pages, checked on November 10, 2026. Promotions, tax and selected plan terms can change the checkout total; an entry plan is not necessarily a minimum deposit.

Provider Entry pricing or purchasing reference Targeting or session detail Evaluation focus
DataImpulse Residential from $1/GB; one-time $5 Intro plan for new customers, then top-ups from $50 Country targeting included; sticky sessions average 30 minutes, maximum 120 minutes Pay-as-you-go scripts; our product
Bright Data $4/GB promotional pay-as-you-go rate with RESIGB50; $8/GB listed regular rate Country, state, city and ZIP targeting included Promotion and commitment terms
Oxylabs Starter: $15/month, with residential usage listed at $6/GB and an allowance of up to 2 GB; VAT may apply. Sticky sessions and free geo-targeting listed Subscription allocation and usage terms
Decodo Pay as you go at $4/GB; 3 GB subscription at $11.25/month plus VAT City, ZIP and ASN targeting included Targeting requirements and purchase size
IPRoyal 1 GB: $7.00 with a subscription or $7.35 pay as you go. Advertised sticky-session maximum of 7 days Longer session requirements
Webshare 1 GB rotating residential plan listed at $3.50/month Endpoint generator supports rotating and sticky sessions Small subscription budget and endpoint configuration
SOAX Builder listed at $200/month plus VAT; Tier 1 usage at $3/GB Targeting options depend on the plan Country tier and monthly credit budget
Rayobyte Premium Residential: $3.50/GB for purchases of 1-49 GB. Scale Residential: plans start at $100/month at $0.0150/GB. Premium includes country, city, ZIP and ASN targeting. Scale has no targeting; access requires business verification and a compliance review. Product tier and location requirements

Competitor data: taken from each provider’s official pricing and documentation pages linked in this article, collected on November 10, 2026. Prices and limits change; check the provider’s page before buying.

For each candidate, check the exact endpoint protocol, authentication method, session limit, targeting charges and destination restrictions. Do not assume terms for one product apply to every proxy product from that vendor.


Eight providers: picks, tradeoffs and selection criteria

1. DataImpulse: our pay-as-you-go option

This is our product. Residential proxies start at $1/GB, with 90M+ IPs across 195+ countries and HTTP, HTTPS and SOCKS5 support. Traffic does not expire, and no subscription is required.

Country targeting is free. State, city, ZIP and ASN targeting on regular residential count traffic at 2x; Premium Residential costs $5/GB with all targeting included. We do not sell ISP/static residential proxies. This is proxy infrastructure.

2. Bright Data: evaluate commitment and promotion terms

Shortlist this option when comparing pay-as-you-go purchasing with monthly commitments. Use the official rate in the table with its coupon condition, and calculate your budget using the applicable renewal or regular rate.

3. Oxylabs: evaluate a subscription budget

Shortlist this option when your purchasing process favors a monthly subscription. Check how much of that budget your residential workload consumes before comparing its per-GB figure with another provider’s cash purchase.

4. Decodo: evaluate detailed location requirements

Include this candidate when city, ZIP or ASN selection matters to your application. Check whether the required filters can be combined and whether enough exits remain after filtering.

5. IPRoyal: evaluate longer sticky sessions

Include this candidate when a workflow needs continuity beyond a short batch. Treat the advertised maximum as a session setting to evaluate, not a promise that an individual residential device stays online throughout your job.

6. Webshare: evaluate a small subscription

Include this option when an initial monthly bandwidth allowance suits your development cycle. Calculate expected usage from response sizes and retry volume before choosing the allowance.

7. SOAX: evaluate location-based budgeting

SOAX Builder costs $200/month plus VAT and includes 200 credits. Tier 1 traffic costs $3/GB. Builder includes country, region, city and ISP targeting; ASN and ZIP targeting are available on Scale and Enterprise.

8. Rayobyte: evaluate the appropriate residential tier

Include this candidate when deciding whether location selection is essential. Compare the relevant product tier instead of applying the lowest advertised rate to a workload with different requirements.


How to use proxies with Python Requests

Pass a dictionary with http and https keys, supply the correct proxy endpoint and set a timeout. The examples below are untested examples; configure their environment variables with your own authorized endpoint before running them.

For the full walkthrough, see how to set up proxies in Python Requests.

Add a proxy to Python Requests in 4 steps

Basic HTTP/HTTPS proxy with authentication

Set PROXY_URL to the complete authenticated URL through your environment or secret manager. Its format is scheme://username:password@host:port; encode reserved characters in the username and password separately using urllib.parse.quote(value, safe=""). Do not log the URL.

import os
import requests

proxy = os.environ["PROXY_URL"]
proxies = {"http": proxy, "https": proxy}
response = requests.get(
    "https://example.com/", proxies=proxies, timeout=(5, 20)
)
response.raise_for_status()
print(response.status_code)

Requests has no default timeout. The tuple sets connect and read timeouts; it is not a total download deadline. raise_for_status() checks HTTP errors, not whether the body contains the expected content. See Requests timeout guidance and HTTP error handling.

Session reuse and environment precedence

Environment proxies can override session.proxies. Pass proxies= on individual calls for explicit per-scheme settings, or disable environment inheritance with session.trust_env = False. See Requests environment proxy precedence.

import os
import requests

proxy = os.environ["PROXY_URL"]
with requests.Session() as session:
    session.trust_env = False
    session.proxies.update({"http": proxy, "https": proxy})
    response = session.get("https://example.com/", timeout=(5, 20))
    response.raise_for_status()

For environment-managed routing, leave trust_env enabled and configure HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY, including their lowercase variants. The first two select proxies by destination scheme; ALL_PROXY supplies a fallback proxy, and NO_PROXY excludes matching destinations from environment routing.

Disabling trust_env also disables environment CA-bundle selection and automatic netrc authentication. Configure those explicitly if needed. An explicit proxy mapping should not rely on NO_PROXY to bypass selected destinations; choose the mapping in your application. These behaviors follow the Requests Session implementation.

SOCKS5 setup and DNS resolution

Install requests[socks], then use socks5h:// for proxy-side destination DNS. Plain socks5:// resolves locally; this distinction does not guarantee anonymity. See the official SOCKS documentation.

python -m pip install "requests[socks]"

Set SOCKS_PROXY_URL to an authenticated socks5h:// endpoint with the vendor’s SOCKS port.

import os
import requests

proxy = os.environ["SOCKS_PROXY_URL"]
response = requests.get(
    "https://example.com/",
    proxies={"http": proxy, "https": proxy},
    timeout=(5, 20),
)
response.raise_for_status()

Bounded retries with urllib3 Retry

Retry connection-establishment failures with an explicit attempt limit. This example permits two retries after the initial attempt, disables automatic redirects, and leaves HTTP error responses for the caller to handle.

import os
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry

retry = Retry(
    total=2, connect=2, read=0, status=0, other=0,
    allowed_methods={"GET", "HEAD"},
    status_forcelist=set(), backoff_factor=0.5,
    respect_retry_after_header=False, raise_on_status=False,
)
with requests.Session() as session:
    session.trust_env = False
    session.mount("https://", HTTPAdapter(max_retries=retry))
    response = session.get(
        "https://example.com/",
        proxies={"https": os.environ["PROXY_URL"]},
        timeout=(5, 20), allow_redirects=False,
    )
    response.raise_for_status()

The policy uses documented urllib3 Retry controls through the Requests HTTPAdapter. It caps attempts, not total wall-clock time. This example retries connection-establishment failures only. It returns HTTP error responses without status-based retries. Handle Retry-After and schedule any status-based retry in the caller before calling raise_for_status().


Rotating vs sticky python requests proxies

Use rotating proxies for independent requests and sticky proxies for workflows that need an exit IP to persist. A Requests Session preserves cookies and reuses connections, but does not itself make a proxy IP sticky.

Configure rotation or a sticky-session identifier through the provider’s documented endpoint settings. Reusing a gateway URL does not prove that the exit changed, and randomly selecting from a list can select the same proxy again.

For login sequences, keep cookies and the intended proxy session together. For independent jobs, select an endpoint per job and record the observed exit separately from application success.

See our Python proxy rotator tutorial for list management. Avoid retrying every failed request with a new IP: authentication errors and malformed configuration need correction first.


Common python requests proxy errors and fixes

Diagnose the exception or HTTP status before changing proxy type. A python requests proxy failure can originate in authentication, connectivity, TLS, the destination response or missing local dependencies.

The 4-step Requests proxy debugging model: connect, authenticate, tunnel, target. Check endpoint reachability, credentials, CONNECT/TLS setup and the destination response in that order.

Symptom Likely area Next action
407 Proxy Authentication Required Proxy authentication Check credentials, URL encoding and the configured authentication method. A CONNECT authentication failure may appear inside ProxyError instead of as a Response.
ProxyError Proxy connection or tunnel Inspect the nested error with secrets redacted. Check hostname, port, proxy scheme and network access.
ConnectTimeout Connection establishment Check reachability and routing. Retry only within a bounded policy; raising the timeout does not fix an unreachable endpoint.
ReadTimeout Response data did not arrive within the read interval Inspect destination behavior and response size. Retry only if repeating the operation is safe.
ConnectionError containing ReadTimeoutError Timeout while reading the response body Inspect the nested exception and read-timeout setting; retry only when repeating the operation is safe.
SSLError TLS negotiation or certificate validation Check the proxy scheme, certificate chain, hostname and trusted CA configuration. Keep certificate verification enabled.
Missing dependencies for SOCKS support SOCKS dependency missing Run python -m pip install “requests[socks]” using the interpreter that executes the script.
HTTPError after raise_for_status() HTTP error response Inspect the status and response body. Do not treat 403 or 429 as automatic evidence of broken proxy connectivity.

The exception categories are defined in the Requests exception reference; the Response.iter_content implementation wraps a body-read ReadTimeoutError in ConnectionError; RFC 9110 defines status 407. Disabling TLS verification creates interception risk instead of repairing trust. See the Requests verification parameter.


Residential, datacenter or mobile?

Choose the network type that your workload requires, then measure whether it returns usable responses. Price alone cannot determine which type is suitable.

Type Use X when… Avoid X when…
Datacenter Use datacenter proxies when your destination accepts hosting exits and you need straightforward regional routing. Avoid datacenter proxies when a residential or mobile-network exit is an explicit requirement.
Residential Use residential proxies when your workflow requires residential exits or your own measurements justify them. Avoid residential proxies when they add cost without improving the useful-response rate.
Mobile Use mobile proxies when you specifically need mobile-network exits. Avoid mobile proxies when you only need to change a user agent or screen size.

Our datacenter proxies start at $0.50/GB, and mobile proxies start at $2/GB. Mobile carrier selection is not available.

A proxy changes routing; it cannot make an HTTP client execute a JavaScript application. If browser execution is necessary, review configuring Selenium with a proxy.


What does our Python Requests proxy measurement show?

Our October 16, 2026 infrastructure snapshot recorded 99.95% residential success and 99.85% datacenter success across 2,000 requests per type. These results describe one small static target and are not a cross-provider benchmark.

Source and method: Our October 16 infrastructure measurement ran from 15:12 to 15:21 UTC using Python requests 2.31.0, 10 parallel workers, rotating US exits and a 9 KB static file on cdnjs. Success meant HTTP 200 plus the complete file; latency measured the full request through the proxy.

Proxy type Requests Successful responses Success rate Median p95
Residential 2,000 1,999 99.95% 0.88 s 5.47 s
Datacenter 2,000 1,997 99.85% 0.92 s 5.41 s

Interpretation: This snapshot measures infrastructure delivery under that workload. It does not establish success on protected websites, large downloads, other countries or mobile proxies. It also does not establish cost per successful response; billed traffic was not recorded for this measurement.

For your evaluation, keep destination content, client location, versions, concurrency, timeout policy and retry policy consistent. Record expected-content matches, latency and billed bytes separately so that retries and error pages do not inflate apparent success.


Use your DataImpulse datacenter endpoint

Set PROXY_URL to your datacenter connection URL and run the basic HTTP/HTTPS example above. Verify the exit country before running your workload.


Frequently Asked Questions

How do I use a proxy with Python requests?

Pass a proxies dictionary to the request, mapping the destination schemes to your proxy URL. Include the endpoint’s authentication details and set a timeout. Check the response status and expected content before treating the call as successful.

Does Python requests support SOCKS5 proxies?

Yes, with the optional SOCKS dependencies installed through python -m pip install “requests[socks]”. Use socks5h when destination DNS should run through the proxy, or socks5 when local DNS is intentional.

What’s the best proxy for Python requests?

The best choice is the one that meets your location, continuity and useful-response requirements within budget. Compare the eight candidates against the same workload. An advertised pool size or bandwidth rate does not establish a universal winner.

How do I rotate proxies in Python requests?

Configure the provider’s rotating endpoint, or select an endpoint from your own list for each independent job. Rotation behavior belongs to the proxy configuration, not to the Requests Session object. Keep one intended proxy session for a stateful sequence.

Why does my requests proxy raise “Missing dependencies for SOCKS support”?

The active Python environment lacks the SOCKS dependency required by the selected URL scheme. Install requests[socks] with that interpreter, then restart the process if necessary. Installing it into another virtual environment will not fix the running application. If another error remains after installation, use the 4-step Requests proxy debugging model: connect, authenticate, tunnel, target.

How much do Python requests proxies cost?

Costs depend on the provider, product, bandwidth tier and purchase commitment. Our residential service starts at $1/GB, with a one-time $5 Intro plan for new customers and later top-ups from $50. Include targeting multipliers and traffic from failed attempts when estimating your budget.

How do I set up datacenter proxies in Python?

Obtain a datacenter connection URL and assign it to the http and https entries in your proxies dictionary. Apply any required country selection through the provider’s documented settings. Validate the exit location and destination response before running a larger job.

Why does Requests use a different proxy from the one in my Session?

Inherited environment settings can take precedence over session.proxies. Inspect HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY, including their lowercase variants. Use explicit per-request proxy settings or disable environment inheritance with session.trust_env = False. Remember that disabling environment trust also affects automatic authentication and CA-bundle configuration.


Start with a small, measurable proxy workload

If DataImpulse fits your routing and billing requirements, start with the one-time $5 Intro plan for new customers. Use a representative destination, verify the expected content and record failures before scaling; later top-ups start at $50, and traffic does not expire.

Last updated: November 10, 2026.


Share article: