Skip to content

whois-api-llc/website-categorization-py

Repository files navigation

website-categorization-py license website-categorizations-py release website-categorization-py build

Overview

The client library for Website Categorization API in Python language.

The minimum Python version is 3.7.

Installation

pip install website-categorization

Examples

Full API documentation available here

Create a new client

from websitecategorization import *

client = Client('Your API key')

Make basic requests

# 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))

Advanced usage

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)