import requests # импортируем модуль requests # заголовки headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0', 'Accept': 'application/json, text/plain, */*', 'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'Content-Type': 'application/json', } # набор символов для генерации alf = "0123456789" with open("domens.txt", "w") as f: # тут 3 цикла, для генерации 3-хсимвольного домена, а далее проверки на "is_available" for x1 in alf: for x2 in alf: for x3 in alf: json_data = { 'domainList': f'["{x1+x2+x3}.pw"]', } response = requests.post('https://2domains.ru/wizard/api/domain/check', headers=headers, json=json_data).json()[0] if (response["is_available"] == True): f.write(f'{response["domain"]} - {response["price"]}\n') print(f'{response["domain"]} - {response["price"]}')