Skip to main content

PyPI - Status PyPI GitHub release (latest by date) License MIT

Froxy logo
Hide your IP with free proxies

Index

The goal

This project aims to provide an interface for filter and using free proxies in your web scraping and web crawler projects with Python and requests module.

How it works?

Froxy uses the API available at Proxy List and runs a filter to obtain only proxies and their information. Then it provides an interface to filter and use the filtered proxies.

Why are you using this API?

  • It free.
  • No query limit.
  • It has a variety of types of proxies.
  • It has an interesting amount of proxies.
  • It is updated daily.

Thank you for maintaining and making this API available @clarketm ❤

Install

install using pip:

$ pip install froxy

then, see the demo or documentation for more information.

Demo

This is a demo use to get proxies with a filter:

from froxy import Froxy

froxy = Froxy()

for proxy in froxy.https(): # Get proxies with protocol https
    print(proxy)

# Output
['125.17.80.226', '8080', ['IN', 'H', 'S', '+']]  
['31.204.180.44', '53281', ['RU', 'H', 'S', '-']] 
['213.108.173.247', '8080', ['RU', 'N', 'S', '-']]
['109.169.151.131', '8080', ['RU', 'N', 'S', '+']]
['149.129.240.8', '8080', ['SG', 'N', 'S', '-']],
[...]

This a demo use with requests module:

import requests

from froxy import Froxy

froxy = Froxy()
ip, port = froxy.http()[0][:2] # Get first proxy (IP and PORT)

proxies = {
    "http": f'{ip}:{port}',
    "https": f'{ip}:{port}'
}

r = requests.get('https://httpbin.org/ip', proxies=proxies)
print(f'Response: {r.json()}')

# Output
Response: {'origin': '103.250.69.233'}

⚠ Warning ⚠

Not all proxies work, so try to use only those that work use try...except as a "filter"

Basic example:

import requests

from froxy import Froxy

froxy = Froxy()

for proxy in froxy.http():
   ip, port = proxy[:2]

   proxies = {
       "http": f'{ip}:{port}',
       "https": f'{ip}:{port}'
   }

   try:
       r = requests.get('https://httpbin.org/ip', proxies=proxies)
       print(f'Response: {r.json()}')

   except Exception:
       print('Fail, next...')
       continue

# output
Response: {'origin': '103.250.69.233'}
Fail, next...
Fail, next...
Fail, next...
Fail, next...
Response: {'origin': '212.32.213.170'}
...

Doc

Use help function for more information:

>>> from froxy import Froxy
>>> help(Froxy)

froxy.Froxy

A class for manipulating and filtering proxies.

All public method returns are made up of a list of lists in the following structure:

# Structure
[
    [ip_adress, port, [country_code, anonymity, http_or_https, google_passed]],
    ...
]

# Example:
[
    ['189.6.191.184', '8080', ['BR', 'N', 'S', '+']],
    ...
]

Froxy.country(...)

Filter proxies for country.

See all codes at: ISO 3166-1 alpha-2

Usage:

>>> from froxy import Froxy
>>> froxy = Froxy()
>>> froxy.country('RS', 'US')
# Example output
[
    ['255.255.255.255', '3000', ['RS', 'N', 'S!', '-'], 
    ['254.254.254.254', '8058', ['US', 'N', 'S!', '+'],
    ...
]

Froxy.anonymity(...)

Filter proxies by anonymity level.

Usage:

>>> from froxy import Froxy
>>> froxy = Froxy()
>>> froxy.anonymity('A', 'H')
# Example output
[
    ['255.255.255.255', '3000', ['RS', 'H', 'S!', '-'],
    ['254.254.254.254', '8058', ['US', 'A', 'S!', '+'],
    ...
]

Froxy.http(...)

Filter proxies by http protocol.

Usage:

>>> from froxy import Froxy
>>> froxy = Froxy()
>>> froxy.http()
# Example output
[
    ['255.255.255.255', '3000', ['AA', 'H', '!', '-'], 
    ['254.254.254.254', '8058', ['ZZ', 'A', '', '+'],
    ...
]

Froxy.https(...)

Filter proxies by https protocol.

Usage:

>>> from froxy import Froxy
>>> froxy = Froxy()
>>> froxy.https()
# Example output
[
    ['255.255.255.255', '3000', ['AA', 'H', 'S!', '-'], 
    ['254.254.254.254', '8058', ['ZZ', 'A', 'S', '+'],
    ...
]

Froxy.google(...)

Filter proxies by google passed.

Usage:

>>> from froxy import Froxy
>>> froxy = Froxy()
>>> froxy.google('+')
# Example output
[
    ['255.255.255.255', '3000', ['AA', 'H', 'S!', '+'], 
    ['254.254.254.254', '8058', ['YY', 'N', '', '+'],
    ...
]

Froxy.get(...)

Use multiple proxy filters or get all proxies if the filter arguments are empty.

Usage:

>>> from froxy import Froxy
>>> froxy = Froxy()
>>> froxy.get(
        country=[1, 'US', 'BR'],
        anonymity=[2, 'H'],
        protocol=[2, 'https'],
        google_passed=[1, '+']
    )
# Example output
[
    ['255.255.255.255', '3000', ['US', 'H', 'S!', '+'], 
    ['254.254.254.254', '8058', ['BR', 'A', 'S', '+'],
    ['254.254.254.253', '6000', ['TT', 'H', '', '-'],
    ['254.254.254.252', '4058', ['BR', 'H', '!', '-'],
    ['255.255.255.251', '3000', ['RS', 'H', 'S', '-'], 
    ['254.254.254.250', '7058', ['ZZ', 'H', 'S!', '-'],
    ['254.254.254.250', '7058', ['YY', 'N', '', '+']
]

Use help function for more information or visit repository of API for more details.

Contributions

All contributions are welcome!

Found a problem, want to give a tip? open an issue.

Do you have a solution to the problem? Send me a PR.

Did you like this project? Click on the little star 😄

License

This project is using the MIT license, see in MIT LICENSE.

For more information on the API used, visit clarketm/proxy-list.

Metadata

Release files for froxy 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for froxy 1.0.5
File Size Uploaded Provenance Actions
froxy-1.0.5.tar.gz 11.0 kB Without provenance Details for froxy-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for froxy 1.0.5
File Interpreter ABI Platform Actions
froxy-1.0.5-py3-none-any.whl Python 3 none any Details for froxy-1.0.5-py3-none-any.whl

Total release size: 21.9 kB

Release files / froxy-1.0.5.tar.gz

Download URL froxy-1.0.5.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dc4f745a21e19a25ef25c40f2d07bb9e408492b41c593b67a2f4ae953ffb5955
BLAKE2b-256 checksum
How to use checksums
36b1dba59cbe3ce7609e4a70920df473495c2338c8ec622419d23d454f767cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release files / froxy-1.0.5-py3-none-any.whl

Download URL froxy-1.0.5-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edbe308548ff770a54e33b094f21d85cb40b2afa5b1d650a71d968f59f9fafc5
BLAKE2b-256 checksum
How to use checksums
4b1eb919b2fc5a854e4438ec1012a84d49c75945e1077ae02f20b502ac6852e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Security for froxy 1.0.5

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.

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