Skip to main content

Usage by Endpoint

developer
GET/v1/analytics/usage/by-endpoint

Returns detailed usage statistics for each API endpoint individually — request count, average response time, error rate, and cache hit rate. Implements the RED Method (Rate, Errors, Duration) per endpoint, enabling targeted optimization of your highest-volume or worst-performing API calls.

What It Does

Breaks down API usage by individual endpoint path, aggregating from usage logs for the selected period. For each endpoint, calculates: total request count (Rate), error count and error rate percentage (Errors), average response time in milliseconds (Duration), and cache hit rate. Results are sorted by request count descending. Period options: 7d, 30d, or current (default).

Why It's Useful

The RED Method (Rate, Errors, Duration) is the industry-standard approach for monitoring request-driven services. Per-endpoint breakdown reveals which API calls drive your usage, which have unacceptable error rates, and which suffer from high latency. This data directly informs optimization priorities — a single endpoint responsible for 60% of your requests with a 0% cache hit rate is a clear optimization target.

Use Cases

Performance Engineer

High-Volume Endpoint Optimization

Identify the top 10 endpoints by request volume. For each, check cache hit rate — endpoints with high volume and low cache hit rates are prime candidates for adding application-level caching or adjusting query patterns to be more cache-friendly.

Reduce billable requests by 30-50% by optimizing caching for your highest-volume endpoints.

Developer

Error Rate Investigation

Sort endpoints by error rate to identify integration issues. An endpoint with a 15% error rate likely has misconfigured parameters, missing authentication, or is hitting rate limits. Cross-reference with the errors endpoint for specific error messages.

Quickly locate and fix integration issues by pinpointing which endpoints have elevated error rates.

Solutions Architect

Architecture & Integration Review

Review endpoint consumption patterns to understand how your systems use the API. Identify redundant calls (multiple services querying the same endpoint for the same domain), unused endpoints (low or zero requests), and opportunities to use composite endpoints instead of multiple individual calls.

Optimize API integration architecture — reduce redundant calls and improve efficiency with data-driven refactoring.

Parameters

NameTypeRequiredDescription
periodstringOptionalTime range: 7d (last 7 days), 30d (last 30 days), or current (current billing period). Default: current.Example: 30d

Response Fields

FieldTypeDescription
endpointsarrayUsage stats per endpoint: path, request_count, avg_response_time_ms, error_rate, cache_hit_rate
total_endpoints_usednumberCount of unique endpoints called in the period

Code Examples

cURL
curl "https://api.edgedns.dev/v1/analytics/usage/by-endpoint" \
  -H "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
  'https://api.edgedns.dev/v1/analytics/usage/by-endpoint',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const data = await response.json();
console.log(data);
Python
import requests

response = requests.get(
    'https://api.edgedns.dev/v1/analytics/usage/by-endpoint',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={

    }
)

data = response.json()
print(data)

Read the full Usage by Endpoint guide

Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.

Read the guide →

Related Endpoints

External References

Learn more about the standards and protocols behind this endpoint.

Try This Endpoint

Test the Usage by Endpoint endpoint live in the playground.