Skip to content

API analytics

API analytics for Hono, Express, Fastify, Next.js, Workers and Go

Totallytics is free during beta and adds one middleware that reports requests per route, status codes, p50, p95 and p99 latency, error samples, clients and consumers, with email alerts when things break.

What you see

Metric Details
Requests Totals per route, status code, client and consumer, compared with the previous period
Status mix 2xx, 3xx, 4xx and 5xx over time, with 4xx and 5xx rates
Latency p50, p95 and p99 per route, within about 4%
Errors 4xx and 5xx per route and status, with rate, last seen and recent samples
Clients The calling library or browser from the user agent, such as curl, python-requests, okhttp or googlebot
Consumers An optional id you attach to each request, such as an account id

Routes are stored as templates, so /users/42 and /users/43 land in one /users/:id row. Clients include AI crawlers such as GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot and PerplexityBot.

Supported frameworks

Framework Import Route reported
Hono totallytics/hono The matched pattern, including sub-apps and basePath
Cloudflare Workers totallytics/workers The raw path, turned into a template by Totallytics
Express totallytics/express req.baseUrl + req.route.path
Fastify 4 and 5 totallytics/fastify The matched route, including plugin prefixes
Next.js 14.2+ totallytics/next Rebuilt from params, so /users/42 becomes /users/:id
Go 1.22+ github.com/bitgate/totallytics-go The matched ServeMux pattern, with modules for chi, gin and echo

The npm package has no dependencies and runs on Node.js 18+, Bun, Deno and Workers.

Add the middleware

npm install totallytics
import { Hono } from "hono";
import { totallytics } from "totallytics/hono";

const app = new Hono();
app.use("*", totallytics());

Set your site's API key as TOTALLYTICS_API_KEY. Without a key, the middleware does nothing. Requests are aggregated in memory and sent in small background batches, and the middleware never throws into your code or delays a response. The API analytics docs have an example for every framework.

What never leaves your server

The middleware never sends request or response bodies, headers other than User-Agent, query strings or IP addresses. Error samples do include the raw path and the error message; set errorSamples: false in JavaScript to turn them off.

Alerts

Email alerts fire on error rate, p95 latency or silence, measured over 5, 15 or 60 minutes, for the whole API or a single route. A site can have 20 rules with up to 10 recipients each. A rule sends one email when it fires and one when it recovers, so a flapping endpoint doesn't flood your inbox.

FAQ

Does it slow down my API?

No. Metrics are batched in memory and sent in the background, and the middleware never delays a response.

How much does it cost?

It's free during beta and comes with Totallytics web analytics, in the same dashboard.

When is an APM the better choice?

When you need distributed tracing, database query profiling or memory profiling. Totallytics covers traffic, latency, errors and callers per route.

Where is the data stored?

In Frankfurt, Germany.

Updated September 30, 2026