Created
November 7, 2024 05:40
-
-
Save avirajkhare00/6f04eff44c68eba4f4a71a2cfb5498dc to your computer and use it in GitHub Desktop.
godaddy-domain-finder
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 itertools | |
import requests | |
import json | |
# generate permutations | |
def generateDomainList(length, characters, tld): | |
if length > 64: | |
print("Error: Can't generate domains larger than 64 Characters") | |
exit(2) | |
domains = [''.join(x) for x in itertools.product(characters, repeat=length)] | |
domains = list(map(lambda x: x + '.' + tld, domains)) | |
return domains | |
# set api key and api secret | |
API_KEY = "" | |
API_SECRET= "" | |
headers = { | |
"Authorization": "sso-key " + API_KEY + ':' + API_SECRET, | |
"Content-Type": "application/json" | |
} | |
# give domain name inside list | |
# body = ["avirajkhare00.com", "avirajkhare000.com"] | |
r = requests.post('https://api.ote-godaddy.com/v1/domains/available?checkType=FAST&forTransfer=false', headers=headers, data=json.dumps(generateDomainList(4, 'abcd', 'xyz'))) | |
# print(generateDomainList(6, 'aviraj')) | |
data = json.loads(r.text) | |
for i in data['domains']: | |
if i['available'] == True: | |
print(i['domain']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pip install requests