Return to homepage

Introduction to Website categorization API

Website categorization API is one of the most accurate website categorisation services based on widely trusted IAB Taxonomy. It also returns categories for Website Filtering Taxonomy.

You can use our API service with websites, but also on texts. URL classification accepts full-path URLs and returns real-time, live URL based website categorization.

Supported taxonomies are:

- IAB Taxonomy (v3), supporting 4 Tiers (with 608 categories, see list of categories here)

- Web Content Filtering Taxonomy

- Products Taxonomy (with 5474 categories, see list of categories here )

Authentication

API requests should be sent to the URL: https://www.websitecategorizationapi.com/api/

A valid API key is needed to obtain results from our API endpoints and is available by purchasing subscription to our plans.

After obtaining plan, please login to retrieve your API key.

Our API service expects for the API key to be included in all API requests to the server, as parameter:

api_key: b4dade2ce5fb2d0b189b5eb6f0cd

HTTP responses that are successful will have the status code 200 and the response formatted according to specification, please see documentation for examples.

Our servers return API data in JSON format by default.

Rules and limits

Please set up your script to wait for a successful response before sending your next request.

If you need multi-threading / concurrency / higher throughput please contact us and we will provide you with custom API endpoint.

The API returns both your total credits (under total_credits) as well as your remaining credits (under remaining_credits).

Pay attention to the number of API credits you still have remaining. If you exhaust your credits you can purchase them at our pricing page or upgrade your plan.

Website Categorization of URLs

Our categorization API classifies URLs according to 2 taxonomies. Classification according to IAB is returned under key iab_taxonomy, example: "iab_taxonomy":[["Category name: News","Confidence: 0.9032876491546631"]].

Classification according to Web Filtering is returned under key filtering_taxonomy, example: "filtering_taxonomy":[["Category name: News","Confidence: 0.8032876491546631"]].

Example of requests:

Curl POST Request

To run your API request with Curl, copy paste the following command and make sure to replace your_api_key with your own API key:

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d 'query=www.alpha-quantum.com&api_key=euieruZi9hee7Sgx&data_type=url' 'https://www.websitecategorizationapi.com/api/iab/iab_content_filtering.php'

Query Parameters

Parameter Type Description
query string text to be categorized
api_key string API key

The above command returns response in JSON format, structured like this:

{"iab_taxonomy":[["Category name: Technology & Computing > Artificial Intelligence","Confidence: 0.7501822113990784"],["Category name: Technology & Computing > Computing > Internet","Confidence: 0.25541040301322937"]],"content_taxonomy":[["Category name: /Science/Computer Science/Machine Learning & Artificial Intelligence","Confidence: 0.7501822113990784"],["Category name: /Internet & Telecom/Web Services/Web Stats & Analytics","Confidence: 0.25541040301322937"]],"filtering_taxonomy":[["Category name: Computers & Technology","Confidence: 0.7501822113990784"],["Category name: Web-based Applications","Confidence: 0.25541040301322937"]],"classification":[["Category name: Technology & Computing > Artificial Intelligence","Confidence: 0.7501822113990784"],["Category name: Technology & Computing > Computing > Internet","Confidence: 0.25541040301322937"]],"category":[["Category name: Technology & Computing > Artificial Intelligence","Confidence: 0.7501822113990784"],["Category name: Technology & Computing > Computing > Internet","Confidence: 0.25541040301322937"]],"status":200}

Example code

Below you can find minimal example code for using our API, for different programming languages.

Example code in Python

import http.client

conn = http.client.HTTPSConnection("www.websitecategorizationapi.com")
payload = 'query=www.alpha-quantum.com&api_key=your_api_key&data_type=url'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/api/iab/iab_content_filtering.php", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Example code in Javascript

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("query", "www.alpha-quantum.com");
urlencoded.append("api_key", "a12");
urlencoded.append("data_type", "url");

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://www.websitecategorizationapi.com/api/iab/iab_content_filtering.php", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Errors

The API returns a status value in each request. Example of status returned as 200:

{"classification": "status": 200, ....}

In case of error, the status error code can be interpreted using the following table:

Error Code Meaning
200 Request was successful.
400 Error in forming request. Please check documentation on how to form an API request.
401 Your API key is invalid. You need to purchase a subscription to use this service. If you have a paid plan, please check your API key for potential misspelling. If the problem persists please contact us via email.
403 You have used up your monthly quota for API requests. Please upgrade your plan to one that includes more API requests per month. Alternatively, add credits to your account.