Skip to main content

Yuleak API

Latest Version on PyPI Documentation Status Licence

The official Python library for the Yuleak API.

Features

  • Convenient methods for making calls to the API.
  • Automatic parsing of API responses into Python objects.

Installation

yuleak-api is available on PYPI

pip install yuleak-api

Documentation

You can use the API with default demo key for development purpose but to use it you'll need to register to Yuleak.

Authentication

from yuleak_api.client import YuleakClient
YuleakClient.set_apikey('my_secret_api_key')

Errors

In case of error, GET methods will return an empty list and POST/DELETE will return False.

The error will be displayed in yuleak-api logger.

Warnings will (such as a deprecated endpoint) will also be displayed in yuleak-api logger.

Pagination

Pagination will be handle by the YuleakClient, you do not have to care about.

Usage

This is not intended to provide complete documentation of the API.

For more details, please refer to the official documentation.

For more information on the included models and abstractions, please read the code.

Credits

Please check your credits amount before making any search or renew action to avoid errors.

print(YuleakClient.credits())

Dashboards

dashboards = YuleakClient.dashboards()
for dashboard in dashboards:
    # Display stats (similar to dashboard view in WebUI)
    print(dashboard.stats())
    # Display map (similar to map widget in WebUI)
    print(dashboard.map())
    # Display graph (similar to graph view in WebUI)
    for node in dashboard.graph():
        if node.type == 'asn':
            print('AS: {0}'.format(node.label))
            for child in node.neighbors:
                if child.type == 'server':
                    print(child)
    # Display timeline (similar to timeline widget in WebUI)
    print(dashboard.timeline())
    # Display details (similar to details view in WebUI)
    for server in dashboard.details():
        print(server.geo.country_name)
        # Download screenshots
        for domain in server.domains:
            if domain.screenshot is not None:
                domain.screenshot.download('/tmp/{0}.png'.format(domain.value))
    dashboard.delete()

Resources

resources = dashboard.resources()
for resource in resources:
    print('{0} :: {1}'.format(resource.value, resource.status))
    if resource.type == 'server':
        resource.renew()
    else:
        resource.delete()

Bookmarks

server = dashboard.details()[0]
assert not server.bookmark
server.add_bookmark()
assert server.bookmark
server.del_bookmark()
assert not server.bookmark

Filters

dashboard.add_filter('domain', 'all')
for f in dashboard.filters():
    print(f)
    f.delete()

Search

YuleakClient.search('yuleak.com')
dashboard = YuleakClient.dashboards()[-1]
dashboard.search('yuleak.io')
# Mass search
new_servers = dashboard.list_new_servers()
if YuleakClient.credits() >= new_servers > 0:
    dashboard.searchall()

Changelog

v1.5.0

  • GET dashboard/{id}/statsdns added
  • GET dashboard/{id}/dns added
  • you can now add custom headers in YuleakClient requests

v1.4.0

  • preview screenshot can now be recovered using server.domain.screenshot.download()

v1.3.4

  • requests timeout can now be set with YuleakClient.REQUESTS_TIMEOUT
  • requests retry on error can now be set with YuleakClient.REQUESTS_RETRY

v1.3.3

  • correct error on 'DELETE dashboard/{id}' endpoint

v1.3.2

  • correct error on 'searchall' endpoint

v1.3.1

  • correct error on pip install

v1.3.0

  • GET dashboard/{id}/renewall added
  • POST dashboard/{id}/renewall added

v1.2.0

  • GET dashboard/{id}/searchall added
  • POST dashboard/{id}/searchall added

v1.1.0

  • Change to match the Yuleak API path modifications

Metadata

Release files for yuleak-api 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yuleak-api 1.5.0
File Size Uploaded Provenance
yuleak-api-1.5.0.tar.gz 11.0 kB Without provenance Details

Release files / yuleak-api-1.5.0.tar.gz

Download URL yuleak-api-1.5.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4ef0266e3aac5e779dc7ccc1f63432af1e4eac94e764ff4b172e7a990792ef5
BLAKE2b-256 checksum
How to use checksums
eaf776fa2882015697b086a8c7c2108d6f0df395e5e84358181710838d5f92e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Security for yuleak-api 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page