Skip to main content

LeakIX API Client

Project description

🚀 LeakPy

PyPI version PyPI Downloads Official Client Downloads 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 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.2.tar.gz (22.9 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.2-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leakpy-2.0.2.tar.gz
  • Upload date:
  • Size: 22.9 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.2.tar.gz
Algorithm Hash digest
SHA256 436edc5d355b446e7b8dc638a3691d0ac1dfe4ae1fa7ca5401f070988c52681c
MD5 4faddfe562c27341c981ca970196d82c
BLAKE2b-256 47e1ae371c3e070216b34aae28a3105883296d0d185dc7201ccca5a9737ea20a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: leakpy-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 24.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 acaae0a182da0433fd2ffd31a9b8bdaba8c251a3b9c4305774c3fb1dadc283d2
MD5 2cc2d5e87885337ba7b3b39eebe5f6f1
BLAKE2b-256 1376910286c63a8aaeac0879ac431528d2a4b179f23f0b98434390edb4a2b93f

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