Skip to main content
GET
Get Usage

Overview

Retrieve comprehensive usage statistics and analytics for your API keys. This endpoint provides detailed insights into API usage patterns, rate limit consumption, and performance metrics to help optimize your API key management.
Use this endpoint to monitor API usage, identify optimization opportunities, and ensure you’re staying within rate limits. The data helps with capacity planning and cost optimization.

Parameters

string
Specific API key ID to get usage for (optional)
string
Time period for usage data
  • 1h - Last hour
  • 24h - Last 24 hours (default)
  • 7d - Last 7 days
  • 30d - Last 30 days
  • 90d - Last 90 days
  • 1y - Last year
  • all - All time
string
Data granularity for time series
  • minute - Per-minute data
  • hour - Per-hour data (default)
  • day - Per-day data
  • week - Per-week data
  • month - Per-month data
boolean
Include detailed breakdown by endpoint (default: true)
boolean
Include error statistics (default: true)
boolean
Include latency statistics (default: true)
string
Sort results by field
  • requests - By request count (default)
  • errors - By error count
  • latency - By average latency
  • timestamp - By timestamp
string
Sort order
  • desc - Descending (default)
  • asc - Ascending
number
Number of results to return (default: 100, max: 1000)
number
Number of results to skip for pagination (default: 0)

Response

boolean
Indicates if the request was successful
object
Usage statistics
array
Time series data points
object
Breakdown by endpoint
object
Error statistics
object
Rate limit information
array
Usage alerts and recommendations
object
Pagination information
string
ISO 8601 timestamp of the response

Examples

Response Example

Use Cases

1. Usage Monitoring Dashboard

Create a comprehensive usage dashboard:

2. Performance Optimization

Optimize API usage based on data:

3. Cost Analysis

Analyze API usage costs:

4. Alert Management

Manage usage alerts:

5. Capacity Planning

Plan for future capacity needs:

Best Practices

1. Regular Monitoring

Monitor usage regularly:

2. Automated Alerts

Set up automated alerts:

3. Performance Optimization

Optimize based on usage data:

4. Cost Optimization

Optimize costs:

Troubleshooting

”No usage data found”

Cause: No usage data for the specified timeframe or key. Solution:
  • Check if the API key has been used
  • Try a longer timeframe
  • Verify the key ID is correct

”Invalid timeframe”

Cause: Unsupported timeframe value. Solution:
  • Use supported timeframes: 1h, 24h, 7d, 30d, 90d, 1y, all
  • Check for typos

”Invalid granularity”

Cause: Unsupported granularity value. Solution:
  • Use supported granularities: minute, hour, day, week, month
  • Check for typos

Rate Limits

Usage requests are subject to rate limits:
  • Free tier: 60 requests per minute
  • Starter tier: 300 requests per minute
  • Professional tier: 1,000 requests per minute
  • Enterprise tier: Custom limits
Implement caching to reduce API calls.