Skip to content

Instantly share code, notes, and snippets.

@avirajkhare00
Created November 7, 2024 05:40
Show Gist options
  • Save avirajkhare00/6f04eff44c68eba4f4a71a2cfb5498dc to your computer and use it in GitHub Desktop.
Save avirajkhare00/6f04eff44c68eba4f4a71a2cfb5498dc to your computer and use it in GitHub Desktop.
godaddy-domain-finder
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'])
@avirajkhare00
Copy link
Author

pip install requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment