The client library for Domains & Subdomains Discovery API in Python language.
The minimum Python version is 3.6.
pip install domain-discovery
Full API documentation available here
from domaindiscovery import *
client = Client('Your API key')
terms = {
'include': ['example.*']
}
# Get the list of domains (up to 10,000)
result = client.get(domains=terms)
# Total count
print(result.domains_count)
domain_terms = {
'include': ['blog.*'],
'exclude': ['*.com']
}
subdomain_terms = {
'include': ['*news*']
}
# Search for subdomains
result = client.get(subdomains=subdomain_terms)
# Search in subdomains of the required domain names
result = client.get(
domains=domain_terms,
subdomains=subdomain_terms)
import datetime
terms = {
'include': ['blog.*'],
'exclude': ['*.com']
}
since_date = datetime.date(2021, 8, 12)
# Get raw response in XML and filter by date
raw_result = client.get_raw(
domains=terms,
output_format=Client.XML_FORMAT,
since_date=since_date)
Response:
- domains_count: int
- domains_list: [str]