Prompt
How do I see which API endpoints are used most?
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
To see which API endpoints are used most, you generally want to aggregate request counts by endpoint path over a time window.
Typical approaches
1) From API gateway / ingress logs
If you have logs from:
- API Gateway
- Nginx / Apache
- Load balancer
- Kubernetes ingress
- Application server logs
you can count requests grouped by endpoint.
Example logic:
SELECT endpoint, COUNT(*) AS hits
FROM api_logs
WHERE timestamp >= NOW() - INTERVAL '24 hours'
GROUP BY endpoint
ORDER BY hits DESC;
2) From metrics in observability tools
If you use tools like:
- Prometheus + Grafana
- Datadog
- New Relic
- CloudWatch
look for metrics such as:
http_requests_totalrequest_countapi_calls
Then group by labels like:
routepathresourceendpoint
Example PromQL:
topk(10, sum by (route) (rate(http_requests_total[5m])))
3) From application instrumentation
If your app records request traces or metrics, you can:
- add middleware to log the route
- increment counters per endpoint
- export to your monitoring system
This is often better than raw URL strings, because it can normalize:
/users/123→/users/{id}so dynamic IDs don’t create many separate endpoints.
Important tip: normalize endpoint patterns
Count the route template, not the raw URL, or results get fragmented.
Bad:
/users/1/users/2/users/3
Good:
/users/{id}
If you’re using a specific tool
I can give you exact steps/queries for:
- AWS API Gateway / CloudWatch
- Nginx logs
- Prometheus / Grafana
- Datadog
- Elastic / Kibana
- Postgres / SQL logs
If you tell me your stack, I’ll show the exact query or dashboard setup.