Skip to main content

Overview

This endpoint provides detailed analytics for API checks, including response times, success rates, error rates, and other performance metrics over time. This data is essential for understanding the performance trends of your API endpoints.

Response Example

{
  "data": {
    "checkId": "api_check_123456",
    "checkName": "Production API Health Check",
    "timeframe": {
      "from": "2024-01-01T00:00:00.000Z",
      "to": "2024-01-31T23:59:59.999Z"
    },
    "metrics": {
      "averageResponseTime": 245.5,
      "p95ResponseTime": 380.2,
      "p99ResponseTime": 520.8,
      "successRate": 99.2,
      "errorRate": 0.8,
      "totalRequests": 8640,
      "successfulRequests": 8571,
      "failedRequests": 69
    },
    "timeline": [
      {
        "timestamp": "2024-01-01T00:00:00.000Z",
        "responseTime": 234.5,
        "status": "success"
      },
      {
        "timestamp": "2024-01-01T00:10:00.000Z",
        "responseTime": 256.2,
        "status": "success"
      }
    ],
    "locationBreakdown": [
      {
        "location": "us-east-1",
        "locationName": "N. Virginia, USA",
        "averageResponseTime": 234.5,
        "successRate": 99.5,
        "requestCount": 2880
      },
      {
        "location": "eu-west-1",
        "locationName": "Ireland, Europe",
        "averageResponseTime": 267.8,
        "successRate": 98.9,
        "requestCount": 2880
      }
    ]
  }
}

Query Parameters

  • from (string): Start date for analytics data (ISO 8601 format)
  • to (string): End date for analytics data (ISO 8601 format)
  • period (string): Predefined time period (24h, 7d, 30d, 90d)
Default: Last 30 days if no parameters provided
  • granularity (string): Data point granularity (5m, 15m, 1h, 1d)
  • locations (array): Filter by specific monitoring locations
  • includeTimeline (boolean): Include detailed timeline data (default: true)
Example:
?from=2024-01-01T00:00:00Z&to=2024-01-31T23:59:59Z&granularity=1h&locations=us-east-1,eu-west-1

Metrics Explained

Response Time Metrics

  • Average Response Time: Mean response time across all requests
  • P95 Response Time: 95th percentile response time
  • P99 Response Time: 99th percentile response time

Success Metrics

  • Success Rate: Percentage of successful requests (HTTP 2xx)
  • Error Rate: Percentage of failed requests
  • Total Requests: Total number of check executions

Geographic Breakdown

  • Location Performance: Response times by monitoring location
  • Regional Success Rates: Success rates per geographic region
  • Request Distribution: How requests are distributed across locations

Trend Analysis

  • Timeline Data: Minute-by-minute or hourly performance data
  • Performance Trends: Identify performance degradation patterns
  • Anomaly Detection: Spot unusual response time spikes

Use Cases

Track API response times and identify performance bottlenecks:
  • Monitor average response times across different time periods
  • Identify peak usage times and performance degradation
  • Compare performance across different monitoring locations
  • Set up alerts based on response time thresholds
Ensure your APIs meet service level agreements:
  • Track success rates against SLA targets
  • Monitor P95 and P99 response times for SLA compliance
  • Generate reports for stakeholders and customers
  • Identify trends that might impact SLA compliance
Use analytics data for infrastructure planning:
  • Analyze request volume trends over time
  • Identify peak usage periods for scaling decisions
  • Monitor performance impact of traffic increases
  • Plan infrastructure upgrades based on growth trends
Optimize global API performance:
  • Compare response times across different regions
  • Identify geographic areas with performance issues
  • Make decisions about CDN or additional infrastructure
  • Optimize API routing based on geographic performance

Code Examples

curl -X GET "https://api.checklyhq.com/v1/analytics/api-checks/api_check_123456?from=2024-01-01T00:00:00Z&to=2024-01-31T23:59:59Z&granularity=1h" \
  -H "Authorization: Bearer cu_1234567890abcdef" \
  -H "X-Checkly-Account: 550e8400-e29b-41d4-a716-446655440000"
Analytics data is updated in real-time and includes data from all monitoring locations configured for your API check.