The client library for Website Categorization API in Python language.
The minimum Python version is 3.7.
pip install website-categorization
Full API documentation available here
from websitecategorization import *
client = Client('Your API key')
# Get categories for a domain name.
response = client.data('whoisxmlapi.com')
print("Responded? " + "Yes" if response.website_responded else "No")
if response.website_responded:
for cat in response.categories:
print("Cat: " + str(cat.name))
Extra request parameters
# Specifying minimal level of confidence
response = client.data('whoisxmlapi.com', 0.75)
# Getting raw API response in XML
xml = client.raw_data('whoisxmlapi.com', output_format=Client.XML_FORMAT)