Lightweight Python client for the Proxy11 free proxy API
Project description
proxy11
Official Python client for the Proxy11 proxy API.
Use it to fetch fresh proxy lists, filter by country or anonymity type, rotate through proxies, and export simple ip:port files.
Install
pip install proxy11
Quick Start
from proxy11 import ProxyClient
client = ProxyClient(api_key="YOUR_API_KEY")
proxies = client.get(limit=50, country="us")
proxy = client.random(proxy_type="anonymous")
proxy_list = client.as_list(limit=100)
Examples
Get Proxies
proxies = client.get(limit=50, country="us", proxy_type="anonymous", speed=1.0)
Get ip:port List
proxies = client.as_list(limit=50)
# ["103.152.112.166:8080", "45.77.56.114:4145"]
Random Proxy
proxy = client.random(country="us")
proxy_details = client.random_proxy()
Save to File
count = client.save("proxies.txt", country="us")
print(f"saved {count} proxies")
Rotator
rotator = client.rotator(country="us", proxy_type="anonymous", auto_refresh=True, refresh_after=50)
for _ in range(100):
proxy = rotator.next()
print(proxy)
# if proxy fails:
# rotator.mark_dead(proxy)
Auto-Rotating Requests Session
session = client.session(country="us", proxy_type="anonymous")
resp = session.get("https://httpbin.org/ip", timeout=15)
print(resp.json())
Error Handling
from proxy11 import APIError, NoProxiesError, ProxyClient
client = ProxyClient("YOUR_API_KEY")
try:
proxy = client.random(country="us")
except NoProxiesError:
print("No proxies matched the filters")
except APIError as exc:
print(f"Proxy11 API error: {exc}")
API
| Method | Description |
|---|---|
get(**filters) |
Return proxy rows as dictionaries |
as_list(**filters) |
Return proxies as ip:port strings |
random(**filters) |
Return one random ip:port proxy |
random_proxy(**filters) |
Return one random proxy dictionary |
save(path, **filters) |
Save ip:port proxies to a file |
rotator(**filters) |
Create a proxy rotator |
session(**filters) |
Create a requests.Session with rotating proxies |
Filters
| Parameter | Type | Description |
|---|---|---|
limit |
int | Max proxies to return, capped by your plan |
country |
string | Country name or two-letter country code |
port |
int | Proxy port |
speed |
float | Max response time in seconds |
proxy_type |
string | anonymous or transparent |
Links
- Website: proxy11.com
- API docs: proxy11.com/apidoc
- SDK page: proxy11.com/sdk
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
proxy11-1.1.0.tar.gz
(7.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proxy11-1.1.0.tar.gz.
File metadata
- Download URL: proxy11-1.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fad385158461d326570c5ed91f6a6153e512d7e525ceae15dc0f62809e97a717
|
|
| MD5 |
6baab2049736600d5312a61535a70cb8
|
|
| BLAKE2b-256 |
467347acfbdacd47c7dc7e137741f07a73b3b97324481bbb6958a111315a521c
|
File details
Details for the file proxy11-1.1.0-py3-none-any.whl.
File metadata
- Download URL: proxy11-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a82369debdc85b128019ca54d470f019ffccd1bb4d8335132cf45695306c618
|
|
| MD5 |
dda1881b92c64b3babe5b5603b1ee33a
|
|
| BLAKE2b-256 |
d59178f962ecbc0eeb913c75adf6cc2b0839ab647175318c1c1af03df2904b0d
|