Registry / http-networking / free-proxy

free-proxy

JSON →
library1.2.0pypypi✓ verified 86d ago

The `free-proxy` library (version 1.1.3) is a Python package designed to scrape, verify, and provide free working proxies from various online sources such as sslproxies.org, us-proxy.org, and free-proxy-list.net. It allows users to filter proxies by country, anonymity, HTTPS support, and define custom timeouts, making it useful for web scraping with libraries like `requests` or `Selenium`. The library is actively maintained with regular updates.

pip install free-proxy
INSTALL
IMPORT
SIG · FREE-PROXY
F
free-proxy
http-networkingpythonv1.2.0
Install
3.3s avg
Import
628ms
Disk
32MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.653s · 34.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.3s · import 0.602s · 35MB
32MB installed
● package 32MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FreeProxy
from fp.fp import FreeProxy

Initializes `FreeProxy` to get a working proxy. The first example fetches a random proxy and tests it with `requests`. The second example demonstrates fetching an HTTPS proxy specifically from the US or Brazil. Due to the nature of free proxies, reliability can vary, and retries may be necessary.

from fp.fp import FreeProxy import requests import os # Get a random working proxy proxy = FreeProxy(rand=True, timeout=1).get() if proxy: print(f"Found working proxy: {proxy}") proxies = { "http": proxy, "https": proxy, } try: # Test the proxy with a simple request # Use a reliable target URL, e.g., ipify.org to check the proxy IP response = requests.get('https://api.ipify.org?format=json', proxies=proxies, timeout=5) if response.status_code == 200: print(f"Request through proxy successful. Your IP via proxy: {response.json()['ip']}") else: print(f"Request through proxy failed with status: {response.status_code}") except requests.exceptions.RequestException as e: print(f"Error making request through proxy: {e}") else: print("No working proxies found at this time.") # Example with specific country and HTTPS # Note: Free proxies can be unreliable and may not always work as expected. # You might need to run this multiple times or adjust parameters. print("\nTrying to get an HTTPS proxy from US or BR...") us_br_proxy = FreeProxy(country_id=['US', 'BR'], https=True, timeout=2, rand=True).get() if us_br_proxy: print(f"Found US/BR HTTPS proxy: {us_br_proxy}") else: print("No working US/BR HTTPS proxies found.")
Debug
Known issues
breakingIn version 1.0.5, the library changed its error handling mechanism from calling `sys.exit()` to raising a `FreeProxyException`.
fix
Update your code to catch `fp.fp.FreeProxyException` instead of relying on `SystemExit` or uncontrolled program termination. Example: `try: ... except FreeProxyException as e: print(e)`.
affects: <1.0.5
gotchaFree proxies are inherently unreliable, often slow, short-lived, or quickly blacklisted. This can lead to frequent connection errors, timeouts, or HTTP status codes like 403 Forbidden or 429 Too Many Requests from target websites.
fix
Implement robust error handling, retry mechanisms, and consider using a pool of proxies. For critical applications, paid proxy services offer greater reliability and performance.
affects: All versions
gotchaWebsite structure changes on proxy source sites (e.g., sslproxies.org) can break the scraping logic (XPath selectors), leading to no proxies being found. This happened in version 1.0.3.
fix
Regularly update the `free-proxy` library to ensure compatibility with upstream proxy source websites. If you encounter issues, check the library's GitHub for recent updates or reported issues.
affects: <1.0.3
gotchaOlder versions (prior to 1.1.1) may have had issues with the `https` parameter, potentially failing to correctly filter or provide HTTPS proxies.
fix
Ensure you are using `free-proxy` version 1.1.1 or newer for reliable HTTPS proxy filtering.
affects: <1.1.1
Errors
Common errors & fixes
fp.fp.FreeProxyException: There are no working proxies at this time.
The library could not find any active proxies from its sources that meet the specified criteria (country, anonymity, HTTPS, timeout) after checking. Free proxies are often down or blocked.
fix
Relax your filtering criteria (e.g., remove `country_id`, `https=True`, or increase `timeout`). Try running the script again, as proxy lists update frequently. Consider implementing retry logic with a delay.
urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None
This error, fixed in version 1.0.1, indicates an issue where the library might return a proxy without a proper scheme (e.g., 'http://' or 'https://') or where `urllib3` fails to parse the proxy string.
fix
Update `free-proxy` to version 1.0.1 or higher to resolve this specific parsing issue. Ensure that the proxy string received is correctly formatted before passing it to `requests` or other HTTP clients.
requests.exceptions.ProxyError: ('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))
The proxy server rejected the connection (e.g., 403 Forbidden, 407 Proxy Authentication Required) or failed to tunnel the request to the target website. This is common with unreliable free proxies or if the proxy requires authentication not supported by `free-proxy`.
fix
Retry with a different proxy. If using custom proxies, ensure credentials are correct. For `free-proxy`, this often means the chosen proxy is dead or blocked; try getting another one via `FreeProxy().get()`.
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
The connection was abruptly terminated by either the proxy server or the target server. This can happen due to proxy instability, timeouts, or the target website detecting and blocking the proxy.
fix
Implement robust retry logic (e.g., using `requests` with `urllib3.Retry`). Increase the `timeout` parameter in `FreeProxy()` and your `requests.get()` call. Fetch a new proxy if errors persist.
Upgrade
Version history
1.2.0latest on PyPI · released Jun 9, 2026
Audit
Dependencies
requestsrequiredUsed for making HTTP requests to verify proxies and target websites.
lxmlrequiredUsed for parsing HTML content from proxy list websites to extract proxy information.
pythonrequiredRequires Python 3.6 or higher for execution.
Agent activity
11 hits · last 30 days
node
10
Bingbot
1
Resources
free-proxy — pip install free-proxy · libregistry