Prompt
How do I track which API endpoints are used most?
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
To track which API endpoints are used most, you typically want to measure request count per route over time, then rank the results.
Simple approach
Log every API request with at least:
- endpoint/path
- HTTP method
- timestamp
- status code
- latency
- user/client ID if relevant
Then aggregate:
- requests per endpoint
- requests per endpoint per time window (hour/day/week)
- optionally filter by:
- success vs error
- authenticated user / tenant
- client app
- region
Example metrics to collect
For each request:
GET /users/{id}POST /orders- response time
- 2xx / 4xx / 5xx
- caller identity
Then compute:
- top endpoints by total requests
- top endpoints by unique users
- top endpoints by error rate
- top endpoints by traffic growth
Tools you can use
If you already have logs
- ELK / OpenSearch
- Datadog Logs
- Splunk
- CloudWatch Logs + Insights
- Grafana Loki
If you want metrics directly
- Prometheus with labeled counters like
http_requests_total{route="/users", method="GET"} - OpenTelemetry + your backend/observability platform
If you’re behind an API gateway / proxy
Many gateways provide this out of the box:
- Kong
- NGINX / NGINX Plus
- AWS API Gateway
- Apigee
- Azure API Management
- Cloudflare
Recommended implementation
If you control the app, add middleware that increments a counter per route.
Example concept
- Normalize paths so
/users/123becomes/users/:id - Increment:
http_requests_total{route="/users/:id", method="GET"} += 1
This avoids treating every user ID as a separate endpoint.
Useful dashboards
Create charts for:
- Top 10 endpoints by request volume
- Requests over time by endpoint
- Error rate by endpoint
- Latency by endpoint
- Unique callers by endpoint
Important note
Make sure you track route templates, not raw URLs, or your data will be too fragmented.
If you want, I can show you:
- a code example in Python/Node/Go,
- a Prometheus metric setup, or
- how to do this with logs / SQL / Grafana.