Package: yuleak-api
Yuleak APIThe official Python library for theYuleak API.FeaturesConvenient methods for making calls to the API.Automatic parsing of API responses into Python objects.Installationyuleak-apiis available onPYPIpipinstallyuleak-apiDocumentationYou can use the API with default demo key for development purpose but to use it you'll need toregister to Yuleak.Authenticationfromyuleak_api.clientimportYuleakClientYuleakClient.set_apikey('my_secret_api_key')ErrorsIn case of error, GET methods will return an empty list and POST/DELETE will return False.The error will be displayed inyuleak-apilogger.Warnings will (such as a deprecated endpoint) will also be displayed inyuleak-apilogger.PaginationPagination will be handle by the YuleakClient, you do not have to care about.UsageThis 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.CreditsPlease check your credits amount before making any search or renew action to avoid errors.print(YuleakClient.credits())Dashboardsdashboards=YuleakClient.dashboards()fordashboardindashboards:# 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)fornodeindashboard.graph():ifnode.type=='asn':print('AS:{0}'.format(node.label))forchildinnode.neighbors:ifchild.type=='server':print(child)# Display timeline (similar to timeline widget in WebUI)print(dashboard.timeline())# Display details (similar to details view in WebUI)forserverindashboard.details():print(server.geo.country_name)# Download screenshotsfordomaininserver.domains:ifdomain.screenshotisnotNone:domain.screenshot.download('/tmp/{0}.png'.format(domain.value))dashboard.delete()Resourcesresources=dashboard.resources()forresourceinresources:print('{0}::{1}'.format(resource.value,resource.status))ifresource.type=='server':resource.renew()else:resource.delete()Bookmarksserver=dashboard.details()[0]assertnotserver.bookmarkserver.add_bookmark()assertserver.bookmarkserver.del_bookmark()assertnotserver.bookmarkFiltersdashboard.add_filter('domain','all')forfindashboard.filters():print(f)f.delete()SearchYuleakClient.search('yuleak.com')dashboard=YuleakClient.dashboards()[-1]dashboard.search('yuleak.io')# Mass searchnew_servers=dashboard.list_new_servers()ifYuleakClient.credits()>=new_servers>0:dashboard.searchall()Changelogv1.5.0GET dashboard/{id}/statsdns addedGET dashboard/{id}/dns addedyou can now add custom headers in YuleakClient requestsv1.4.0preview screenshot can now be recovered using server.domain.screenshot.download()v1.3.4requests timeout can now be set with YuleakClient.REQUESTS_TIMEOUTrequests retry on error can now be set with YuleakClient.REQUESTS_RETRYv1.3.3correct error on 'DELETE dashboard/{id}' endpointv1.3.2correct error on 'searchall' endpointv1.3.1correct error on pip installv1.3.0GET dashboard/{id}/renewall addedPOST dashboard/{id}/renewall addedv1.2.0GET dashboard/{id}/searchall addedPOST dashboard/{id}/searchall addedv1.1.0Change to match the Yuleak API path modifications