Skip to main content

spys

PyPI version Downloads Python versions License

spys is a typed Python library for fetching, parsing, and filtering lists of free public proxies. It provides an object-oriented and easy-to-use interface to effortlessly obtain available HTTP, HTTPS, and SOCKS5 proxies for web scraping, automation, or network testing.

Under the hood, the library retrieves data from popular public proxy aggregators and structures it into convenient Python objects.


Installation

You can install or update the package via pip or poetry:

pip install -U spys
# or
poetry add spys

Usage Guide

The library is divided into two primary submodules based on how the proxy data is retrieved:

  1. spys.me — Fast, text-based API wrapper. Recommended for quick and safe proxy retrieval without the risk of being blocked.
  2. spys.one — Advanced web scraper. Allows for highly detailed proxy filtering directly at the source, but requires careful usage.

1. Fast Proxy Retrieval (spys.me module)

This module provides quick access to proxy lists using lightweight HTTP requests. It is the best choice for stability and speed.

from spys import me

# Get proxies using high-level Getters
http_proxies = me.Getters.get_http_proxies()
socks5_proxies = me.Getters.get_socks5_proxies()
all_proxies = me.Getters.get_all_proxies()

# Alternatively, use the get_proxies function directly
https_proxies = me.get_proxies('https')

for proxy in https_proxies:
    print(f"Proxy: {proxy.host}:{proxy.port}")
    print(f"Country: {proxy.country} | Anonymity: {proxy.anonymity}")
    print(f"SSL Support: {proxy.ssl_support} | Google Passed: {proxy.google_passed}")
    print("-" * 30)

Available protocols for me.get_proxies(protocol): proxy, socks, socks5, all, http, https, ssl

2. Advanced Filtering via Scraping (spys.one module)

WARNING: This module uses direct web scraping to retrieve data. Frequent requests or abusing this method will lead to your IP being temporarily or permanently banned by the provider. Use responsibly and implement adequate delays.

risk_of_blocking.png

This approach allows you to filter proxies by Anonymity, SSL support, Port, and Type before downloading the list.

from spys import one
from spys.filters import Show, Anm, SSL, Sort, Type

# Fetch 100 proxies, highly anonymous, with SSL support, sorted by speed
proxies = one.get_proxies(
    show=Show(100),  # Amount (30, 50, 100, 200, 300, 500)
    anm=Anm('HIA'),  # Anonymity (ALL, A+H, NOA, ANM, HIA)
    ssl=SSL('SSL+'),  # SSL support (ALL, SSL+, SSL-)
    sort=Sort('SPEED'),  # Sort by (DATE, SPEED)
    type=Type('HTTP')  # Type (ALL, HTTP, SOCKS)
)

for proxy in proxies:
    print(proxy)
    # Additional detailed attributes available in this module:
    # proxy.city, proxy.hostname, proxy.org, proxy.latency, proxy.uptime, proxy.check_date

ProxyView Object Structure

All fetched proxies are returned as iterables of ProxyView objects (which inherit from BaseProxyView).

Base attributes (available in both modules):

  • host (str): IP Address
  • port (int): Port
  • country (str): Country Code
  • anonymity (str): Anonymity level
  • more_info (str | bool): Additional available proxy info

Exclusive to the spys.me module:

  • ssl_support (bool)
  • google_passed (bool)

Exclusive to the spys.one module:

  • type (str)
  • city (str)
  • hostname (str)
  • org (str)
  • latency (float | str)
  • uptime (int | str)
  • last_check_status (bool)
  • check_date (datetime | str)

Documentation

For complete, automatically generated English documentation of modules, classes, and methods, you can run Python's built-in pydoc server locally:

python -m pydoc -p 8081

Then open http://localhost:8081/spys in your browser.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Download files

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

Source Distribution

spys-1.2.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

spys-1.2.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file spys-1.2.1.tar.gz.

File metadata

  • Download URL: spys-1.2.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/7.1.3-zen2

File hashes

Hashes for spys-1.2.1.tar.gz
Algorithm Hash digest
SHA256 af88e746862758c63df8792f067900ce8ce20354bcee83842249671bd1c71807
MD5 02c95158032082e97144341241d77175
BLAKE2b-256 654eb196ea3950cf1c9f73c26b3885a3b51dc1b83ad525201a32c2330c3963cd

See more details on using hashes here.

File details

Details for the file spys-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: spys-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/7.1.3-zen2

File hashes

Hashes for spys-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 972b29e97f5c670a55ea64390c5092885ab2f045c47a920f7cea87613f6bc6b2
MD5 d194c70dde61a7e82b52085ddf79347b
BLAKE2b-256 699f6add40c21a228d01b4d6dbe063716b0b6cdcb5e0114f73143d2e84edfbe7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page