Skip to main content

LeakIX API Client

Project description

🚀 LeakPy

PyPI version Python 3.9-3.12 License CI Documentation

LeakPy is a third-party client designed to seamlessly interact with the LeakIX API using Python.

Note: This is not the official LeakIX client. Always refer to the Official LeakIX Python Client for the official client.

📥 Installation

To install LeakPy via PyPi:

pip install leakpy

🔑 API Key

Get your API key from LeakIX (48 characters). On first use, you'll be prompted to enter it. Reset: leakpy -r

Secure Storage: The API key is stored securely using your system's keychain (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux). If keyring is not available, it falls back to file storage with restrictive permissions (600).

API Response Caching: LeakPy automatically caches API responses to reduce unnecessary API calls. The cache respects HTTP headers (Cache-Control: max-age or Expires) when available, otherwise uses a default TTL of 5 minutes. Clear the cache with leakpy --clear-cache.

🖥️ CLI Usage

To see all available commands and options:

$ leakpy -h

Options:

[~] LeakPy 2.0.0
usage: leakpy [-h] [-s {service,leak}] [-p PAGES] [-q QUERY] [-P PLUGINS] [-o OUTPUT] [-f FIELDS] [-b]
              [-r] [--clear-cache] [-lp] [-lf] [-v] [--silent]

options:
  -h, --help            show this help message and exit
  -s {service,leak}, --scope {service,leak}
                        Search scope: 'leak' or 'service' (default: leak)
  -p PAGES, --pages PAGES
                        Number of pages to fetch (default: 2)
  -q QUERY, --query QUERY
                        Search query string
  -P PLUGINS, --plugins PLUGINS
                        Plugin(s) to use (comma-separated)
  -o OUTPUT, --output OUTPUT
                        Output file path
  -f FIELDS, --fields FIELDS
                        Fields to extract (comma-separated, e.g. 'protocol,ip,port' or 'full')
  -b, --bulk            Use bulk mode (requires Pro API)
  -r, --reset-api       Reset saved API key
  --clear-cache         Clear the API response cache
  -lp, --list-plugins   List available plugins
  -lf, --list-fields    List all possible fields from sample data
  -v, --version         show program's version number and exit
  --silent              Suppress all output (useful for scripting)

📘 Library Documentation

LeakIXScraper

The LeakIXScraper class offers a direct and user-friendly interface to the LeakIX API.

Usage:

from leakpy import LeakIXScraper

scraper = LeakIXScraper(api_key="Your_API_Key", verbose=False)

# Search
results = scraper.run(
    scope="leak",
    pages=5,
    query='+country:"France"',
    fields="protocol,ip,port",
    output="results.txt"
)

📚 Documentation

Full documentation: https://leakpy.readthedocs.io/

See EXAMPLES.md for more examples.

🚫 Disclaimer

LeakPy is an independent tool and has no affiliation with LeakIX. The creators of LeakPy cannot be held responsible for any misuse or potential damage resulting from using this tool. Please use responsibly, and ensure you have the necessary permissions when accessing any data.

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

leakpy-2.0.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

leakpy-2.0.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file leakpy-2.0.0.tar.gz.

File metadata

  • Download URL: leakpy-2.0.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for leakpy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 32aafcf84e0209ec7da290d74f893e928effca43558cfae5d93f42a1234d1ea9
MD5 97a422d9c720f2ee641fbf13a623133b
BLAKE2b-256 13ba533aa310ca3fc027be1603a9bbccc29473aa280b6e5ebe86df01e18ebf01

See more details on using hashes here.

File details

Details for the file leakpy-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: leakpy-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for leakpy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 829b942318372ec663c4ad53e8a3f769301ea0d8f44d4b6e3990daa59d6a0942
MD5 e879587e66f151fb04f2f784dc464316
BLAKE2b-256 cba12290fbbbd5ded9ddc78a89a4c8331b162f67c73ed133315ffbc72ebdcda1

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