How to start categorizing websites in 2 minutes

Step 1: Purchase Plan

After purchasing the plan and logging in, you can use dashboard for categorizations. However, if you need to categorize a large number of texts/websites then we advise you to use our API endpoints. You will see your API key in the dashboard, like this:

Your API key: $2y$10$CbkLX8Ba5n5nD0wSEiuYJ.l3N6K.Ivp4E39eB

Step 2: Prepare list of URLs/domains you want to classify

Next step is to prepare a list of URLs/domains that you want to classify. You can store them in a file named urls.csv with each URL in a new line, like this:

Step 3: Run the script for classification

After storing the URLs, you should create a python script with the following content:
import requests
import json

# your API key (available in dashboard, after login)
api_key = 'b4dcde2ce5fb2d0b887b5eb6f0cd'

# set this to correct API endpoint, for more information on available API endpoints please see #
url_api = ""

# name of file where categorizations of URLs will be stored
f_write = open('results.csv','w')

with open('urls.csv','r') as f:
    urls = f.readlines()
    for url1 in urls:
       url1 = url1.replace('\n','')
       if (('http://' not in url1) or ('https://' not in url1)):
       url = 'http://'+url1
       url = requests.utils.quote(url)
       headers = {
        'Content-Type': 'application/x-www-form-urlencoded'

       response = requests.request("POST", url_api, headers=headers, data=payload)
       data = json.loads(response.text)
          category = data['classification'][0]['category']
          category = 'url could not be loaded'


and run it from command line with (assuming you stored it under name

The results of classifications will then be written out in file results.csv, in the format URL, Category. Example output:,Events and Attractions,Education,Hobbies & Interests,News and Politics,Movies,Hobbies & Interests,Sports,Style & Fashion,Travel,Personal Finance,Shopping,Medical Health,Business and Finance,Hobbies & Interests,Technology & Computing,Travel,Education

These results were obtained by calling the API Endpoint for IAB Tier 1 classification (using iab_category1_url.php in code above).

If you need other types of classifications, you need to replace the corresponding line in python code above, using the definitions from our API documentation..

If you need help on this, please send us an email and we will be happy to help you.