ProxyProviders Supported Providers
Current Providers Supported:
Webshare.io (referral link) - try out 10 free datacenter proxies
BrightData (affiliate link)
ProxyList- your own list of proxies from any other vendor
Don’t see a provider you need? Open an issue or submit a PR!
- class proxyproviders.providers.brightdata.BrightData(api_key: str, zone: str, username_suffix: str | None = None, use_super_proxy: bool | None = True, config: ProxyConfig | None = None)[source]
Bases:
ProxyProviderBrightData (formerly luminati) is a proxy provider that offers residential and datacenter proxies.
Create an account here (affiliate link).
You can find your API key in the account settings here then create “add token” with scope “limit” (BrightData article for more info)
The BrightData API documentation is here
- Parameters:
api_key – Your BrightData API key
zone – The zone ID/name to fetch proxies for (you can get this from the BrightData dashboard)
username_suffix – Optional suffix to append to the username more info allows you to target region, city, etc. (requires use_super_proxy=True)
use_super_proxy – Optional flag to use super proxy instead of targeting specific IPs, this is enabled by default. If you want to target specific IPs or have consistent IPs for a session, set this to False.
config – Configuration for the proxy provider. View the ProxyConfig class docs for more information.
Example:
from proxyproviders import BrightData # Initialize the BrightData API client with an API key and a zone proxy_provider = BrightData(api_key="your-api-key", zone="my_zone") # Fetch proxies proxies = proxy_provider.list_proxies() # returns one proxy for super proxy by default # If you want to manage specific IPs proxy_provider = BrightData(api_key="your-api-key", zone="my_zone", use_super_proxy=False) proxies = proxy_provider.list_proxies() # returns multiple proxies for each IP in the zone (potentially thousands)
- get_active_zones() Any[source]
Fetches active zones from BrightData API.
Response:
[ { "name": "zone1", "type": "dc", } ]
- get_zone_username(zone: str) str[source]
Fetches zone username for the given zone ID from BrightData API.
Note: this isn’t directly an API endpoint, I’m sort of reconstructing some things here and it seems to behave a little weird.
- Parameters:
zone – The zone ID to fetch username for
- class proxyproviders.providers.proxy_list.ProxyList(proxies: Iterable[str | Proxy], config: ProxyConfig | None = None)[source]
Bases:
ProxyProviderA provider for proxies you already have, from any vendor.
Use it when your vendor has no provider here yet, or when you manage the list yourself. You get the same interface as every other provider: selection algorithms, output formats, failure reporting and
RotatingSession.- Parameters:
proxies – The proxies, each either a
Proxyor text in any formProxy.from_string()accepts: a URL such ashttp://user:pass@host:portorsocks5://host:port, orhost:port:user:passconfig – Configuration for the proxy provider. View the ProxyConfig class docs for more information.
- Raises:
ValueError – If an entry cannot be parsed, or the list is empty
Example:
from proxyproviders import ProxyList provider = ProxyList( [ "http://user:pass@203.0.113.7:8080", "203.0.113.8:8080:user:pass", "socks5://user:pass@203.0.113.9:1080", ] ) proxy = provider.get_proxy() # Or one proxy per line from a file, ignoring blank lines and # comments provider = ProxyList.from_file("proxies.txt")
- classmethod from_file(path: str | Path, config: ProxyConfig | None = None) ProxyList[source]
Load proxies from a text file with one proxy per line.
Blank lines and lines starting with
#are skipped.- Parameters:
path – Path to the file
config – Configuration for the proxy provider