EasyProxies
A simple and fast library to interact with proxyscan.io and proxyscan-like APIs to fetch free proxy servers.
Features
- Custom Host Support: Easily override
BASE_URLto point to any custom or mirror proxyscan-like API. - Flexible Formatting: Support for both JSON (
ProxyDescriptorobjects) and TXT (ip:portstrings) output formats. - Custom Headers: Ships with configurable default HTTP headers (including a standard
User-Agent). - Dynamic Generator: Infinite proxy iterator with on-the-fly parameter updating.
Installation
Install via pip:
pip install EasyProxies
Install via Poetry:
poetry add EasyProxies
Quick Start
Basic Usage & Custom Host Setup
If you need to route requests to a custom proxyscan-like backend, simply override Proxies.BASE_URL:
from easy_proxies import Proxies, const
# Override base URL if needed
Proxies.BASE_URL = "https://your-custom-proxy-api.com"
# Fetch 20 proxies in text format (ip:port)
proxies = Proxies.get(limit=20, format='txt')
print(proxies)
Integration with requests
By default (format='json'), Proxies.get() and Proxies.best() return ProxyDescriptor objects with helpful
conversion properties:
import requests
from easy_proxies import Proxies
# Get the best proxy available
best_proxy = Proxies.best()
# Convert directly to a requests-compatible dictionary
proxies_dict = best_proxy.as_requests_proxy
print(f"Using proxy: {proxies_dict}")
try:
response = requests.get("https://httpbin.org/ip", proxies=proxies_dict, timeout=10)
print(response.json())
except requests.RequestException as e:
print(f"Connection failed: {e}")
CLI
EasyProxies --help
usage: EasyProxies [-h] [-f {json,txt}] [-l LIMIT] [--best] [-t {http,https,socks4,socks5} [{http,https,socks4,socks5} ...]]
[-a {transparent,anonymous,elite} [{transparent,anonymous,elite} ...]] [-c COUNTRY [COUNTRY ...]] [--not-country NOT_COUNTRY [NOT_COUNTRY ...]]
[--ping PING] [--uptime UPTIME]
Fetch proxy servers from proxyscan API via easy_proxies CLI.
optional arguments:
-h, --help show this help message and exit
-f {json,txt}, --format {json,txt}
Output format: json (list of proxy objects) or txt (ip:port list). Default: json
-l LIMIT, --limit LIMIT
Number of proxies to list (1-20). Default: 10
--best Fetch only the single best (fastest and most reliable) proxy.
-t {http,https,socks4,socks5} [{http,https,socks4,socks5} ...], --type {http,https,socks4,socks5} [{http,https,socks4,socks5} ...]
Filter by proxy protocol(s).
-a {transparent,anonymous,elite} [{transparent,anonymous,elite} ...], --level {transparent,anonymous,elite} [{transparent,anonymous,elite} ...]
Filter by anonymity level(s).
-c COUNTRY [COUNTRY ...], --country COUNTRY [COUNTRY ...]
Filter by 2-letter country code(s), e.g., US FR.
--not-country NOT_COUNTRY [NOT_COUNTRY ...]
Exclude 2-letter country code(s), e.g., CN NL.
--ping PING Maximum ping response time in ms.
--uptime UPTIME Minimum proxy uptime percentage (1-100).
API Documentation
Module Exports
from easy_proxies import Proxies, ProxyDescriptor, DEFAULT_HEADERS, const
Proxies: Main interface class for making API requests.ProxyDescriptor: Data class model wrapping proxy details.DEFAULT_HEADERS: Default headers dictionary used for HTTP requests (e.g.,{'User-Agent': 'Mozilla/5.0'}).const: Constants for filtering parameters (Format,Level,Type,Limit, etc.).
Class Proxies
An interface to communicate with the proxy provider.
Attributes:
BASE_URL:str— Base target URL (defaults to'https://www.proxyscan.io'). Can be modified globally at runtime.
Methods:
get(**kwargs) -> list[ProxyDescriptor | str] | strFetches a list of proxies matching the specified filters.raw_request(param: dict[str, str | int]) -> list[ProxyDescriptor | str] | strAccepts a dictionary of raw query parameters instead of keyword arguments.already_list(type_: str) -> list[str]Returns a pre-assembled list ofip:portlines for a given protocol ('http','socks5', etc.).best(**kwargs) -> ProxyDescriptor | strReturns the fastest and most reliable proxy server based on the query criteria.eternal_generator(**kwargs) -> GeneratorAn infinite generator yielding proxies sequentially. YieldsNonewhen no proxies match. Parameters can be updated dynamically via.send(new_params).
Filtering Parameters (kwargs for get / best)
| Parameter | Type / Allowed Values | Description |
|---|---|---|
format |
'json', 'txt' |
Output format (JSON returns ProxyDescriptor objects). |
level |
'transparent', 'anonymous', 'elite' |
Anonymity level. |
type |
'http', 'https', 'socks4', 'socks5' |
Proxy protocols (supports single str or list/iterable). |
limit |
1 – 20 |
Max number of proxies to return. |
uptime |
1 – 100 |
Minimum reliability/uptime percentage. |
country |
str or list[str] (e.g., 'US', 'FR') |
Filter by country code(s). |
not_country |
str or list[str] (e.g., 'CN', 'NL') |
Exclude specific country code(s). |
port |
int |
Filter by a specific port number. |
ping |
int |
Max response time (ping) in milliseconds. |
last_check |
int |
Max seconds since the last proxy check. |
Structure of ProxyDescriptor
Represents detailed information about a single proxy server.
Key Attributes:
Ip:str— IP address.Port:str— Port number.Host:str— Formatted asip:port.Ping:int— Response latency in milliseconds.Uptime:float— Connection success rate ratio.Anonymity:str— Anonymity level.Type:list[str]— Supported protocols.Location:Location— Object containing geolocation data (city,country,countryCode,isp, etc.).
Properties & Features:
as_requests_proxy: Returns{'http': '...', 'https': '...'}dictionary forrequests/httpx.- Rich comparisons: Supports native sorting (
<,>,==) based on availability, ping, uptime, and anonymity.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for EasyProxies 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easyproxies-3.0.1.tar.gz | 8.7 kB | Without provenance | Details for easyproxies-3.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| easyproxies-3.0.1-py3-none-any.whl | Python 3 | none | any | Details for easyproxies-3.0.1-py3-none-any.whl |
Total release size: 19.8 kB
Release files / easyproxies-3.0.1.tar.gz
| Download URL | easyproxies-3.0.1.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
337c840646a7ca5bb49b6dfdbecb7ecc572649b932dd8cf6281138d029f292dc
|
|
BLAKE2b-256 checksum How to use checksums |
a73f62d4a77cae84cb5e7ea14d6c7020f934d6811cefe6ad3af64c155e0760ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.14 Linux/7.1.3-zen2
|
Release files / easyproxies-3.0.1-py3-none-any.whl
| Download URL | easyproxies-3.0.1-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09a564503d16814e7bd98235e373d40259f22f2686da6b5778714d4cd6af36ba
|
|
BLAKE2b-256 checksum How to use checksums |
e9c31d38bf1a6a31bc003421d7eefaaef1975aff306d484c027869248c3c4edb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.14 Linux/7.1.3-zen2
|
Security for EasyProxies 3.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.