Website categorization can be used in many ways. Maybe you are building an online directory, analyzing a large list of websites for behavior analysis, looking to filter your network traffic or categorizing ads on your platform.
In each of these scenarios, you need a reliable URL categorization partner who offers a quick and painless solution for your needs. Our service allows you to perform URL categorization in four simple steps with a REST API which you can use with your platform of choice.
Access keys allow you to connect to our services without sharing your username and password or other sensitive information in your application. Since they are unique, you can rest assured that no one except you will be able to use resources from your account.
To generate API keys:
In this post we will use HTTP Basic Authentication to make requests to the API. It’s also possible to generate “pre-signed URLs” which grant access to the API for specific requests without using basic authentication. To check out this method, please refer to our documentation.
Since we are using the Python library “requests” to send HTTP requests to the server, we’ll use the basic authentication built into the “requests” library which will add the necessary HTTP header for us.
Make sure you have your access key and secret key and substitute them into the sample code. Your next step is to send the request to our server.
To do that, we simply use get function from the library passing the encoded URL and your API keys.
Our categorization API provides the response in standard JSON format and to get that we use the json() function to parse the response and pass it to your application.
Here is the example of the response:
In this example, we are going to use HTTP status code returned to know if the categorization was completed or if it’s being evaluated.
In this if/else statement, we covered three possible scenarios: