Hide your IP with free proxies using Froxy
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file froxy-1.0.5.tar.gz
.
File metadata
- Download URL: froxy-1.0.5.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc4f745a21e19a25ef25c40f2d07bb9e408492b41c593b67a2f4ae953ffb5955 |
|
MD5 | 272d7a9deaaa481a0c55400c7a8a4499 |
|
BLAKE2b-256 | 36b1dba59cbe3ce7609e4a70920df473495c2338c8ec622419d23d454f767cae |
File details
Details for the file froxy-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: froxy-1.0.5-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edbe308548ff770a54e33b094f21d85cb40b2afa5b1d650a71d968f59f9fafc5 |
|
MD5 | 0a14c1261603805b7c4cdf9d301bbfa5 |
|
BLAKE2b-256 | 4b1eb919b2fc5a854e4438ec1012a84d49c75945e1077ae02f20b502ac6852e8 |