DEV Community

Cover image for How to Show the Business Value of Your APIs with Embedded Metrics
K for moesif

Posted on • Originally published at

How to Show the Business Value of Your APIs with Embedded Metrics

When you’re providing APIs to your customers, you want to ensure they are getting value from them. At the same time, the best APIs are designed to be fully automated without requiring human intervention. This can leave your customers in the dark on whether your API is even being used by the organization and if you’re meeting any SLA obligations in your enterprise contracts.

Types of metrics to surface

Most API first companies have some sort of developer portal for customers to log into, manage API keys, and customize features. This area is a great way to also expose key metrics to your customers demonstrating how much value they are getting from your API. This can be as simple as a counter showing number of API transactions made within a billing period or provide additional metrics around what those transactions are. Each customer has different metrics they want to look at.

Developers will want to look at access logs where as product and engineering leadership are more interested in usage and performance metrics. Finally, the finance department may need to look at billing usage for capacity and financial planning.

Providing API Logs

A quick and easy way to demonstrate your empathy towards your developers is by providing API logs. Engineers are now integrating countless APIs to ship their applications. They don’t have time to understand every response or error code that your API creates. Yet, having detailed and structured logs is super helpful for debugging integration issues.

Instead of relying on your customers to instrument your integration, you can easily provide API logs directly in your developer portal. If you take this approach, ensure your access logs are useful by including the following features:

  • Structured data which enables developers to drill down quickly without slow search
  • Included context beyond request parameters such as client location or API version
  • Advanced filters which enable creating compound queries including body fields
  • Replay functionality in tools like Curl, Swagger UI, and Postman
  • Event Ids that can be shared with developer support

Displaying API usage

While business and engineering leadership may need to inspect the API logs themselves, they are keen on having the right metrics in place to make informed decisions. If they’re sponsoring a new project, they want to ensure they’re getting their money’s worth. Providing metrics on usage of your platform helps demonstrate the value business leaders receive.

value diagram

API calls themselves don’t show value, but they represent some sort of business transactions, whether making a payment or sending a text message to remind an end user that a delivery is present. Because of this, ensure your usage reports can show the historical number of transactions in a given period. Requirements for usage reports include:

  • Ability to see usage by different intervals like hour/day/month
  • Shows number of business transactions, even if your API can handle requests in batch
  • A way to break usage down by user demographics

Displaying Performance Metrics

While some APIs are used by only internal applications, many are integrated within customer-facing apps. If your API has performance or reliability issues, this can impact their end users. This can tarnish their reputation or cause lost revenue. If you have an obligation to meet certain SLAs (Service Level Agreements), show that to your customers. This can provide peace of mind knowing that your APIs are reliable and performant.

api metrics

Providing Billing Dashboards

Most APIs leverage consumption based billing. If you’re providing a payments API, this may be the number of transactions per month or percentage of dollar volume. Whereas if you’re providing a messaging API, you may bill based on the number of messages sent within a billing period.

Your customers will want to optimize their usage to maximize the value of your API, which means you should show where their money is being spent. Keep in mind you should have a consistent source of truth for billing, otherwise your support team will be bombarded with requests due to a billing discrepancy.

Outside of billing, you should also show any rate limits or quotas that your customers are bound by. In fact, this can be an easy way to upsell to larger plans by showing how close they are to current limits. Because many business teams are unaware of or don’t log into your developer portal, you should also send out notifications letting your customers know once quotas are breached.

Email notification

How to get started with embedded charts

Using Moesif it takes just a few minutes to embed API logs and usage reports with a three-step process:

  1. Create an embed template within the Moesif UI
  2. An API on your backend that calls the Moesif management API to get a time-limited workspace URL. This is returned to your frontend.
  3. Embed the chart using an iFrame with the generated workspace URL

For more details on the integration see the explanation here on our website. Also, you can find a working React app using Moesif embed template here on Github.

Looking for a complete customer-centric API analytics solution? Check out Moesif!

This article was written by Moesif CEO, Derric Gilling for the Moesif blog.

Latest comments (0)