← All FeaturesFeature

API Analytics

You know your API works. But do you know which endpoints matter, where errors concentrate, and how usage grows week over week? Most teams don't, because the only options are heavyweight APM platforms that cost thousands per month and require dedicated infrastructure teams to operate. BetterMeter's Express middleware gives you product-level API analytics in a single line of code, no Datadog or New Relic required. Install it in under a minute, and start seeing which endpoints your customers actually depend on.

One-line Express integration

Add BetterMeter to any Express application with three lines of setup. The middleware automatically captures every request and response, including endpoint pattern, HTTP method, status code, and response duration. It then sends events asynchronously so your API latency is unaffected. There is nothing to configure beyond your site ID and API key.

Express middleware
import { BetterMeter } from "@bettermeter/node";

const bm = new BetterMeter({
  siteId: "my-api",
  apiKey: "bm_...",
});

app.use(bm.expressMiddleware());

Not using Express? Call bm.trackApi() manually from any framework: Hono, Fastify, Koa, or a plain HTTP server. Pass the method, endpoint pattern, status code, and duration in milliseconds, and BetterMeter handles the rest.

What you see in the dashboard

Once the middleware is active, your BetterMeter dashboard populates with five key views that give you a complete picture of how your API is being used. No configuration, no custom queries. Just answers.

  • 01 Top endpoints by volume. See which routes handle the most traffic, ranked by request count with HTTP method breakdowns. Identify your most critical endpoints at a glance.
  • 02 Error rates per endpoint. Track the percentage of 4xx and 5xx responses for every route. Spot endpoints with abnormally high error rates before your customers file tickets.
  • 03 Latency tracking. Monitor average response time per endpoint in milliseconds. Catch performance regressions early and identify slow endpoints that need optimization.
  • 04 Daily trends. View request volume and unique callers over time in a timeseries chart. Understand usage patterns, spot traffic spikes, and measure growth week over week.
  • 05 Overall health metrics. Total requests, overall success rate, and period-over-period change in a single summary card. Know at a glance whether your API is healthy.

Privacy by design

BetterMeter tracks only what you need for product analytics, and nothing more. The middleware records endpoint patterns (like /api/users/:id), HTTP methods, status codes, and response timing in milliseconds.

Request bodies, response bodies, headers, query parameters, and path parameters are never collected, stored, or transmitted. Actual URL paths with real IDs are never sent, only the parameterized route pattern. This means you get meaningful analytics without exposing sensitive user data or triggering privacy compliance concerns.

Not a replacement for APM

Let's be clear about what BetterMeter is and what it isn't. APM tools like Datadog, New Relic, and Sentry are built for infrastructure monitoring: distributed tracing, span analysis, CPU and memory profiling, alerting on latency spikes across microservices. They are essential for debugging production incidents.

BetterMeter is built for product-level visibility. Which endpoints do customers actually use? How is adoption growing? Where do errors concentrate from a product perspective? These are questions APM tools bury under infrastructure noise. Use BetterMeter alongside your existing APM stack. It complements rather than replaces it, and costs a fraction of what full observability platforms charge.

Who this is for

  • SaaS companies tracking API adoption . Understand which API endpoints your customers rely on most, track adoption of new endpoints after launches, and identify underused features that may need better documentation or deprecation.
  • API-first startups measuring endpoint popularity . When your API is your product, you need to know exactly how developers interact with it. See which resources get the most reads, which mutations are most common, and where developers hit errors.
  • Internal teams monitoring microservice health . Get a lightweight overview of traffic patterns across internal services without the overhead of a full APM deployment. Perfect for teams that need visibility but not distributed tracing.

Frequently asked questions

How is BetterMeter different from APM tools?
APM tools like Datadog focus on infrastructure: traces, spans, CPU, memory. BetterMeter focuses on product analytics: which endpoints matter, who calls them, how usage grows. Use both together.
What frameworks are supported?
Express middleware out of the box. For other frameworks (Hono, Fastify, Koa), use the manual trackApi() method.
What data is collected from API requests?
Endpoint pattern (e.g., /api/users/:id), HTTP method, status code, and response duration in milliseconds. No request bodies, response bodies, headers, or query parameters.
Can I track custom API endpoints?
Yes. Use bm.trackApi({ method, endpoint, statusCode, durationMs }) for manual tracking with any framework or custom endpoint pattern.
Does the middleware affect API performance?
No measurable impact. Events are sent asynchronously after the response is sent. The middleware adds sub-millisecond overhead per request.

Prêt à voir l'image complète ?

Installation en 60 secondes. Aucune carte de crédit requise.

Voir les tarifs