Skip to main content

Python wrapper for LeakCheck API & also a CLI tool

Project description

LeakCheck API

Dependencies:

  • Python >= 3.5
  • requests >= 2.23.0
  • pysocks >= 1.7.1
  • setuptools >= 46.1.3
  • wheel >= 0.34.2

Installation:

pip3 install leakcheck

Or download tarball / git clone and execute

python3 setup.py install

First start:

To start working with this package you need to obtain personal API key from here and link IP address of your server or personal computer. It can be IPv6 as well as IPv4.

Public API can be used without API linking.

Package automatically creates "PyLCAPI.json" file in the working directory on the first startup. Then, API key and/or proxy settings can be loaded from there.

Using as a CLI:

usage: leakcheck [-h] [--key KEY] [-m] [--proxy PROXY] [--endpoint ENDPOINT]
             [--type TYPE] [-lo] [-p]
             query

CLI version of LeakCheck API (v1.0.0). Licensed under MIT license

positional arguments:
    query                What are we going to search?

optional arguments:
    -h, --help           show this help message and exit
    --key KEY            Set an API key (taken from config by default)
    -m                   Use mirror (leakcheck.io instead of leakcheck.net, default: False)
    --proxy PROXY        Set proxy (supported: HTTP/HTTPS/SOCKS4/SOCKS5, default: empty)
    --endpoint ENDPOINT  Set an endpoint (default: /)
     --type TYPE          Set a type of the query (default: auto)
    -lo                  Print lines/sources only (useful if you process them later or save, default: False)
    -p                   Lookup privately (hashes data with SHA256, then truncates hash to 24 characters; works for email, pass_email only, default: False)

Using as a library:

from leakcheck import LeakCheckAPI

# Initialising API class
api = LeakCheckAPI()

# API key setting
api.set_key("YOUR_KEY")

# Type setting
api.set_type("email")
# Or login / mass / etc

# Search setting
api.set_query("example@example.com")

# Query prepared. Now we're ready to make our first request
result = api.lookup() # list of dicts

Using mirror or proxy:

# HTTP/HTTPS/SOCKS4/SOCKS5 supported
# Handled by requests[proxy], requests[socks]
api.set_proxy("socks5://127.0.0.1:8123")

# This will use leakcheck.io instead of leakcheck.net
api.use_mirror()

Getting your IP:

from leakcheck import LeakCheckAPI

# Initialising API class
api = LeakCheckAPI()

ip = api.getIP() # string

Getting your limits:

from leakcheck import LeakCheckAPI

# Initialising API class
api = LeakCheckAPI()

# API key setting
api.set_key("YOUR_KEY")

limits = api.getLimits() # dict

Response errors:

Error Description
Missing params (key, check, type) Some params haven't passed in the request
Invalid type Type you provide is invalid
API Key is wrong Key you provide is invalid
API Key is blocked Your key is blocked due to some reasons, contact support
No license on this key Key you provide does not have a license
Your query contains invalid characters There are some forbidden characters in your query
Enter at least 3 characters to search Query passed without minimal number of characters
Invalid email E-mail type is specified, but your query is not a mail
IP linking is required IPs are not linked or invalid
Not found There are no results
Too many entries, try to concretize your query You made a search that contains too many entries, try to search "alex@" instead of "alex"

Server Errors:

Error Description Resolution
429 Too Many Requests Your server is sending too many automated requests. API is limited by 3 requests/second per one IP. Try to reduce amount of sendings.

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

leakcheck-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

leakcheck-1.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file leakcheck-1.0.0.tar.gz.

File metadata

  • Download URL: leakcheck-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 PyPy/7.3.5

File hashes

Hashes for leakcheck-1.0.0.tar.gz
Algorithm Hash digest
SHA256 80f7aac5d4028ee02e09030e77dec0851a5980926f8c3d19964eef1ae4a97959
MD5 e36b722cdb26e6998caea0a1d6fdf4be
BLAKE2b-256 ca68e69b6fdcfbae01aa1804c1b62748bccf36a6f1d1515972fb3f26dca01023

See more details on using hashes here.

File details

Details for the file leakcheck-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: leakcheck-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 PyPy/7.3.5

File hashes

Hashes for leakcheck-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db84b5839f721b7df8561869121e142b636e0ee3d5997e3ce895c2ce4e86cc6a
MD5 d7a12a2381a5a9097169e458dc3c6365
BLAKE2b-256 332dfa21a2af987e0095f413dc6bd1966d00cbf2a9ada1f6f0717e9d3cb883e5

See more details on using hashes here.

Supported by

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