Skip to main content

Free-proxy

Version 1.2.3

Get free working proxies from https://www.sslproxies.org/, https://www.us-proxy.org/, https://free-proxy-list.net/uk-proxy.html and https://free-proxy-list.net and use them in your script

The FreeProxy class scrapes proxies from https://www.sslproxies.org/, https://www.us-proxy.org/, https://free-proxy-list.net/uk-proxy.html, and https://free-proxy-list.net and checks to make sure that it works. You can filter proxies by country, and specify an acceptable timeout. You can also randomize the list of proxies, rather than going in the order that they are scraped in.

You can use this to send requests through a custom proxy, with Selenium, or with anything else.

Returns proxy as string:

'http://113.160.218.14:8888'

Requirements

Installation

pip install free-proxy

asciicast

Usage examples

First import Free Proxy that way:

from fp.fp import FreeProxy

Options

Parameter Type Example Default value
country_id list ['US', 'BR'] None
timeout float > 0 0.1 0.5
rand bool True False
anonym bool True False
elite bool True False
google bool,None False None
https bool True False
url str '' google.com
request_timeout float > 0 5 10
proxy = FreeProxy().get()
proxy = FreeProxy(country_id=['US', 'BR']).get()
proxy = FreeProxy(country_id=['US']).get()
proxy = FreeProxy(country_id=['GB']).get()
  • timeout parameter Timeout is the parameter for checking if a proxy is valid. If the server does not respond in specified time, the script will mark the proxy as invalid. Default timeout=0.5. You can change it by specifying a timeout eg. timeout=1.
proxy = FreeProxy(timeout=1).get()
  • rand parameter Shuffles the order of the proxy list from https://www.sslproxies.org/ instead of going from newest to oldest (as listed on the website). Defaults to rand=False
proxy = FreeProxy(rand=True).get()
  • anonym parameter Return only proxies marked as anonymous. Defaults to anonym=False
proxy = FreeProxy(anonym=True).get()
  • elite parameter Return only proxies marked as 'elite proxy'. Defaults to elite=False.
proxy = FreeProxy(elite=True).get()

Please note: elite proxies are always anonymous. If you set elite=True, you will also be eliminating any non-anonymous proxies.

  • google parameter If True it will only return proxies marked as "google". If False, it will not return proxies marked as "google". Defaults to google=None, which returns all proxies.
proxy = FreeProxy(google=True).get()
  • https parameter If True it will only return proxies marked as HTTPS. Defaults to https=False - i.e. HTTP proxy (for HTTP websites).

    Please note: HTTPS proxies work for both HTTP and HTTPS websites.

proxy = FreeProxy(https=True).get()

You can combine parameters:

proxy = FreeProxy(country_id=['US', 'BR'], timeout=0.3, rand=True).get()

If there are no working proxies with the provided parameters, the script will raise FreeProxyException with the message There are no working proxies at this time..

  • url parameter The url parameter allows you to set a custom URL for testing purposes. If left empty, it defaults to 'https://www.google.com'.

Using default URL:

proxy = FreeProxy().get() 

Using custom URL, if test on different endpoint is needed:

proxy = FreeProxy(url='http://httpbin.org/get').get() 
  • request_timeout parameter Number of seconds to wait when downloading the proxy list from the source websites (https://www.sslproxies.org/ etc.). If the website does not respond in that time, the script raises FreeProxyException instead of hanging indefinitely. Defaults to request_timeout=10. Not to be confused with timeout, which is used for checking individual proxies.
proxy = FreeProxy(request_timeout=5).get()

CHANGELOG


[1.2.3] - 2026-08-24

  • Fixed the proxy check silently bypassing the proxy when the test URL scheme did not match the https setting. With default settings (HTTP proxy mapping + HTTPS test URL) requests selected no proxy at all, the peername verification then rejected every candidate and get() always failed. The proxies mapping now covers both http and https schemes. Broken since 1.2.1.

[1.2.2] - 2026-07-04

  • Fixed get_proxy_list hanging indefinitely when a source website stalls — the proxy list request now has a timeout (#58)
  • Added request_timeout parameter (default: 10 seconds) to control the proxy list download timeout

[1.2.1] - 2026-06-09

  • Fixed proxy check failing due to a duplicated URL schema (http://https://...), introduced in 1.1.3. This broke https=True and custom url usage (#52, #43).

[1.2.0] - 2026-06-09

  • Updated lxml to version 6.1.1
  • Updated requests to version 2.34.2
  • Updated pip-chill to version 1.0.5
  • Pinned minimum dependency versions in install_requires (lxml>=5.0,<7, requests>=2.31,<3)
  • Raised minimum Python version to 3.8

[1.1.3] - 2024-11-07

  • Added url paramameter

[1.1.2] - 2024-09-07

  • Updated lxml to version 5.3.0
  • Updated pip-chill to version 1.0.3
  • Updated requests to version 2.32.3

[1.1.1] - 2023-02-18

  • Fixed https parameter error
  • Fixed additional loop issue when no proxy was found

[1.1.0] - 2022-11-12

[1.0.6] - 2022-01-23

  • Added google parameter
  • Added https parameter

[1.0.5] - 2022-01-07

  • Added elite parameter
  • Add exception class and raise exception instead of system exit
  • Change lxml version to 4.6.5

[1.0.4] - 2021-11-13

  • Fix proxy list default length

[1.0.3] - 2021-08-18

  • Change XPatch due to SSL proxies page update
  • Change lxml version

[1.0.2] - 2020-09-03

  • Added anonym parameter

[1.0.1] - 2020-03-19

  • Fix typos in readme
  • Fix urrlib3 exception urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None,
  • Fix imports

[1.0.0] - 2019-02-04

  • Initial release

Disclaimer

The authors of this repository are not responsible for any consequences, damages or losses arising from the use or misuse of this repository or content. Users are solely responsible for their actions and any consequences that may follow.

License


MIT

Free Software!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

free_proxy-1.2.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

free_proxy-1.2.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file free_proxy-1.2.3.tar.gz.

File metadata

  • Download URL: free_proxy-1.2.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for free_proxy-1.2.3.tar.gz
Algorithm Hash digest
SHA256 292627d8f414d2b424f44e68d1756436a696e4312cde776bceb08cbc569271c6
MD5 58a86de272b127c9289ea451f6c56087
BLAKE2b-256 aa7bb2367a34debdb19fc28c41ded460d3314cc6cb2124b609f5a9a467af8d97

See more details on using hashes here.

File details

Details for the file free_proxy-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: free_proxy-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for free_proxy-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e17e403dd484ee6df61b1f8797a83d6b8c6ac426259e59948440e126d674d727
MD5 c4188ac26bf183a4260ceea1c020f3c7
BLAKE2b-256 33a6c3fd5be918ec3f49ea0e6572bcfb877ce03592083b290bb61091f96bcd5f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.6

1 file

1.0.5

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page