So here is the code, simple enough, but it does not resolve for addresses like 0x94DBCE8a42E2F578ad80266863bc9C7d2e04ea6A which corresponds to Askar.eth
def resolveAddress(address):
# get the holders per page
url = "https://deep-index.moralis.io/api/v2/resolve/" + address + "/reverse"
headers = {
"Content-Type": "application/json",
"X-API-Key": "key",
}
# get the response, if we fail once, end the search
try:
response = requests.request("GET", url, headers=headers)
data = response.json()
print(data)
except Exception as err:
print(err)
print("error in getting ens domain, do not count")
time.sleep(2)
return "Error"
if __name__ == "__main__":
address = "0x94DBCE8a42E2F578ad80266863bc9C7d2e04ea6A"
resolveAddress(address)