ProxyProviders
raw JSON → 0.2.2 verified Fri May 01 auth: no python
A Python library providing a unified interface for different proxy providers. Version 0.2.2, actively maintained with monthly releases. It abstracts API calls to various proxy services (e.g., BrightData, Oxylabs, Smartproxy) into a single API, supporting rotation, session management, and async usage.
pip install proxyproviders Common errors
error TypeError: __init__() got an unexpected keyword argument 'provider_name' ↓
cause Using old parameter `provider_name` instead of `provider` after version 0.2.0.
fix
Change
ProxyClient(provider_name='...') to ProxyClient(provider='...'). error KeyError: 'http' ↓
cause Attempting to access proxy['http'] when `get_proxy()` returned None or raised an error, possibly due to invalid API key.
fix
Check the return value of
get_proxy() first: proxy = client.get_proxy(); if proxy: print(proxy['http']). error ModuleNotFoundError: No module named 'proxyproviders.client' ↓
cause Importing from internal module directly instead of the package-level re-export.
fix
Use
from proxyproviders import ProxyClient instead of from proxyproviders.client import ProxyClient. error ValueError: Unsupported provider 'invalid_provider' ↓
cause Using a provider name that is not in the supported list (brightdata, oxylabs, smartproxy, etc.).
fix
Check the supported providers list in the library docs. Correct names are case-insensitive strings.
Warnings
gotcha The `get_proxy()` method returns a dict with keys 'http', 'https', and 'socks5' — not a string. Always access via dict keys. ↓
fix Use `proxy['http']` instead of treating the return as a string.
breaking In version 0.2.0, the `provider` parameter was renamed from `provider_name`. The old parameter name no longer works. ↓
fix Use `provider='your_provider'` instead of `provider_name='your_provider'`.
deprecated The `BrightData` subclass is deprecated in favor of using the generic `ProxyClient` with `provider='brightdata'`. ↓
fix Replace `from proxyproviders import BrightData` with `from proxyproviders import ProxyClient; client = ProxyClient(provider='brightdata', ...)`.
gotcha Not all providers support the same parameters. For example, 'brightdata' requires `api_key`, while 'oxylabs' requires `username` and `password`. Refer to provider-specific documentation. ↓
fix Check the library's provider docs or error messages for required auth fields.
Imports
- ProxyClient wrong
from proxyproviders.client import ProxyClientcorrectfrom proxyproviders import ProxyClient - ProxyProvider wrong
import ProxyProvidercorrectfrom proxyproviders import ProxyProvider - AsyncProxyClient wrong
from proxyproviders.async_client import AsyncProxyClientcorrectfrom proxyproviders import AsyncProxyClient
Quickstart
import os
from proxyproviders import ProxyClient
# Initialize with a provider (e.g., 'brightdata')
client = ProxyClient(provider='brightdata', api_key=os.environ.get('BRIGHTDATA_API_KEY', ''))
proxy = client.get_proxy()
print(proxy['http'])