Last active
January 5, 2019 11:16
-
-
Save Nishan8583/4868a6d9bdf291293b8dbc18cf6b07de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests,json | |
from pprint import pprint | |
def cymon_query(query,type): | |
api_key = "<You API Key here>" | |
if type == "ip": | |
url = "https://cymon.io/api/nexus/v1/ip/{}/events".format(query) | |
elif type == "domain": | |
url = "https://cymon.io/api/nexus/v1/domain/{}".format(query) | |
headers = {"authorization": "Token {}".format(api_key)} | |
response = requests.get(url,headers=headers) | |
res = json.loads(response.text) | |
return res | |
cymon_query("www.google.com","Domain") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment