Analytics for your APIs

Knowing usage is an integral part of managing your APIs. On top of that, Knowru provides various analytics features that you'd love in managing your APIs, such as visualizing distributions of key variables on the fly, setting alarms and monitoring response time. This post will talk about how to use various analytics features that Knowru offers. If you are not familiar with how to create APIs conveniently using Knowru, please find this page on creating an API for a random forest model that predicts a forest cover type built by R H2O.

Number of requests

The overview page right after sign-in shows the usage trends of all APIs you have read access. An API's detail page also shows visualizations of that particular API's usage trends. The left bottom shows the percentage of requests that got processed without any error. The right bottom shows the proportion of requests that got handled within the reasonable time frame which you adjust in the API's configuration (edit) form. The default value is 400 ms.

Response time

An API's detail page shows a hourly distribution of five metrics (min, 25 percentile, median, 75 percentile and max) of the API's response time in a semi-log scale.

List and search requests

Clicking the "List Runs" button directs you to a page listing requests for the API. The list shows important timestamps, input and output values to the API, and captured standard output and error messages if the API outputs any.

Using the search feature, you can also search runs with particular characteristics. You can even search runs that have a particular value at a particular path in input or output values. For example, if your API output looks like below:

    "output" {
        "decision": "approve|review|decline"
        , "reason": "abc"

and you want to find runs whose decision in the output object is review, you enter "output__decision" and "review" in the Output Path and Output Path Value fields respectively.

Key variable distribution

Another great feature of Knowru is to visualize trends of key variables on the fly. First, click the "Analytics" button. Choose whether the key variable is within input or output of the API. Then enter the path. If the key variable is nested within another object or array, notate the relationship using double underscores (_) like the example above.

Analytics input section

The feature automatically decides whether the variable at the path is numeric or categorical, decides an appropriate graph and visualizes the trends.

Analytics on a numeric variable
Analytics on a categorical variable


Once you get a sense of how the distribution of a key variable looks like, you want to get a notification when the distribution deviates significantly from its normal. Knowru provides alarms for both numeric and categorical types of variables. First to create an alarm for a numeric variable, click the "Create Numeric Simple Alarm." Specify which percentile of which variable you want to set an alarm for, how frequently you want to evaluate the alarm, and how long period you want to look at. If the data points is less than "Minimum simple count," the alarm won't get evaluated. If the percentile of the values of the variable over the path you specified is greater or less than the threshold you specified, an alarm email will be sent to the recipients.

An alarm for a categorical variable works in a similar way. Click the "Create Categorical Simple Alarm" button. In the example below, an alarm will be sent to if the value class_1 shows up more than 50 percents at the path predict in output among the data points over the last 1 day when evaluated everyday.


If you want to experience these marvelous analytics features without bothering creating an API, please take a look at this API with our demo account (ID: demo, password: KnowruForAPI!). If any question, please feel free to contact us using the link below!

Receive notices on new features, blog posts and so many more!