© Brajesh De 2017

Brajesh De, API Management, 10.1007/978-1-4842-1305-6_10

10. API Analytics

Brajesh De

(1)Bangalore, Karnataka, India

As the old saying goes: “You can’t manage what you cannot measure.” This holds true even for the enterprise API programs. API analytics provide data and trends about APIs. API traffic flowing through an API management platform can provide lot of useful insights to businesses, which can help to effectively govern an enterprise API program. It is important for an enterprise to measure the success of its API program. This can help provide information that can be used by actors in various roles in a wide variety of ways to make the right decision. In this chapter, you look at the various API metrics and learn how to effectively use API analytics to drive the success of an API program.

The Importance of API Analytics

An API management platform collects a wide variety of operational and business data as traffic flows through it. The data collected is then analyzed to provide metering and monitoring capabilities. This data should be regularly analyzed by the business to make improvements for the API program and channelize its investments. Only then can the business reap the benefits of the investments made in its API program for digital transformations. Depending on the data collected, API analytics data can provide answers to the following questions:

  • How has API traffic trended over time?

  • Who are the top users of the API—apps as well as end users?

  • Which developer app is generating the maximum traffic for the API?

  • How many developers have signed up for the API program?

  • What is the most recent trend for developer adoption of APIs?

  • How has been the performance of the APIs? How has been the performance of the backend services?

  • What is the API usage pattern across geographical regions?

API Analytics dashboard can provide information about API traffic trend. It shows how APIs are used over time - the peaks and the troughs of API traffic. Aggregated API traffic data can show traffic distribution over a day, week, month, quarter, or even a year. Average API response time aggregated over time can help you understand API performance during peak and low traffic. API traffic distribution identifies the most popular APIs. Data on an API’s users identifies the most popular app. All of this information can help improve the quality and performance of APIs and provide valuable insights into API governance.

API Analytics Stakeholders

The data collected from API traffic for analytics can be used by different stakeholders in a variety of ways. The following are the main stakeholders for API analytics:

  • API product owner

  • API team

  • App developer

  • Operations team

APIs are products that you sell to your customers. Hence, as a product owner of the API, the business user would be interested in knowing how their product is doing. Without proper insight, it is difficult to make the right investments into the API program and make it successful. A business owner of an API program would be interested to get answers to the following questions :

  • How has the API been adopted? An insight into API traffic data can provide an answer to this. A continuously increasing traffic trend over a period of time can be a fair indication of the successful adoption of the API. A constant or a falling trend in API traffic means that there has been low adoption of the APIs.

  • How many new applications are using the API? A report on the new apps registered to use an API can help you understand the interests of the developers. The number of new apps registered over a period of time is a good indicator. But just looking at the new app registration data can be misleading because developers may register apps but not use them to invoke the APIs. Hence, it is also important to look at the traffic generated by these apps to measure the real adoption of APIs.

  • How many active developers are there? A report showing the top developers’ app traffic can provide information about the developers who are actively using the APIs.

  • What is the geographic distribution of API usage? As an API product owner, I would be interested in knowing how the API has been adopted across different geographic regions. Depending on the services provided by the API, its adoption could be concentrated in only a few geographic locations or it could be widespread. For example, Google Maps APIs have a wide geographic distribution, indicating that it is widely adopted by users in different geographic locations. If an API is designed to be used across the world, traffic distribution by geographic region would be of interest to the API product owner to see their adoption in different countries. If the traffic is coming only from one geographic region, it means that its adoption is limited.

  • How are investments in the API being used? Is the API program bringing in new business? An API traffic report can help answer these questions for the business owner. An increasing API traffic trend means end users like the API. Depending on the monetization model setup, this would mean an increasing trend in direct or in-direct revenue from the API. Custom analytics reports can help drill down to specific business transactions to get more insight into the API’s business impact.

An API team is the technical team involved in the development of APIs. API analytics reports can provide the following information to help analyze and optimize the performance of an API:

  • Traffic

  • Response time

  • Message payload size

  • Errors

  • Cache performance

  • Back-end service performance

  • Developer adoption

With this information , the API team knows how the API program is doing overall, how individual APIs are performing, and how to improve the API performance. A higher than expected response time may impact the adoption of the APIs due to a poor overall user experience. Hence, the API team needs to look at the root cause to reduce the response time and improve overall performance. Response caching may help improve response time and may be an option to consider for performance improvement. Message payload size is another consideration in improving API performance. Large payloads not only impact network performance due to bandwidth constraints, but can consume more CPU cycles for message processing. Hence, optimizing the message payload size can improve API performance and help drive its adoption.

App developers are the consumers of APIs. These developers are innovating with your APIs and building creative apps that help drive revenue to your enterprise. Their innovative apps help provide better user experiences. By sharing analytics information with app developers, you get better apps. Analytics help app developers know how their apps are doing and how much they are contributing to the bottom line of your enterprise. App developers want to know how they can improve their apps. Ultimately, everyone wants happy end users.

The operations team uses API analytics reports to understand traffic patterns and anticipate when to add back-end resources or make other critical adjustments. An increasing API traffic trend associated with a degradation of API performance may indicate that the underlying infrastructure is reaching its capacity and may need to be supplemented.

API Metrics and Reports

A lot of operational and business data can be collected from API traffic. The metrics can be divided into traffic metrics and developer metrics.

Some of the key API metrics that should be analyzed are as follows:

  • API traffic

    • Total API traffic across all APIs

    • Traffic distribution and trends by API proxy

    • API traffic by business or technical assets

    • Top APIs and methods

  • Response time

    • Average response time of the API

    • Target service response time

    • Request and response processing latency on the API gateway

  • Error rates

    • Error distribution over a period of time

    • Error distribution by APIs

    • Target service error rate

    • Error distribution by HTTP error code: 5xx, 4xx

  • Message payload size

    • Average request payload size

    • Average response payload size

The following are some of the key API developer metrics:

  • Developer engagement

    • The total number of developers registered with the API program

    • The number of developers with apps

    • The number of active developers

    • Traffic volume trend by developer

    • Traffic generated from developer apps

  • Traffic composition

    • Top 10 apps’ traffic

    • Top 10 developers’ traffic

    • Top 10 API products’ traffic

  • End user engagement

    • Geographic distribution of API traffic

    • API traffic distribution by device: device type, OS families, agents, browser type

    • App error rates

Custom Analytics Reports

Many times, default analytics data captured by the API management platform from API traffic may not be sufficient enough to provide all business insights. You may need to capture certain custom data from the message payload and derive useful analytics information from it. Many API management platforms provide the facility to extract custom data from messages and log it into their analytics database. This data may be extracted from message headers, query parameters, or payloads, and used to create meaningful custom analytics reports. For example, in a hotel reservation API, a business might be interested in knowing the distribution of reservations by city or hotel. Such information can help businesses take actions that result in better customer satisfaction and grow business across cities.

Ensuring good API performance and helping highly engaged developers build apps with your APIs is key to the success of an API program. API analytics provide insights into metrics that should be monitored regularly to ensure the success of an API program. A dip in API traffic can mean user interest is shifting away from the API, the reasons for which could be many. It could be due to the API’s poor performance or customers moving to services provided by other competitors in the market. Business owners should critically look at API analytics reports on a regular basis and reflect on how they should further fuel and tweak their APIs to make them more competitive and popular in the market. Proper implementation of API analytics holds the key to the success of an enterprise’s API program. API management is incomplete without the proper insights provided by API analytics.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.35.229