---
name: cdnpulse-analytics
description: Query CDN performance analytics from CDNPulse. Use when you need to retrieve real-user CDN timing metrics, compare performance across regions or cities, or pull a time-series of CDN latency data for a monitored application.
---

# CDNPulse Analytics

Query real-user CDN performance data collected by the CDNPulse monitoring script.

## Authentication

All analytics endpoints (except public ones) require a Bearer token.
See the `cdnpulse-setup` skill for how to authenticate.

## Endpoints

All endpoints take an optional `days` query parameter (default: `7`, max: `90`).
Replace `{name}` with your application slug.

### Summary

```http
GET https://api.cdnpulse.io/api/apps/{name}/analytics/summary?days=7
Authorization: Bearer <token>
```

Returns aggregate metrics: total requests, average TTFB, average download time, p50/p75/p95 latency percentiles, and error rate.

### By Region

```http
GET https://api.cdnpulse.io/api/apps/{name}/analytics/regions?days=7
Authorization: Bearer <token>
```

Returns a ranked list of regions with request counts and average latency per region.

### By City

```http
GET https://api.cdnpulse.io/api/apps/{name}/analytics/cities?days=7
Authorization: Bearer <token>
```

Returns a ranked list of cities with request counts and average latency per city.

### Time Series

```http
GET https://api.cdnpulse.io/api/apps/{name}/analytics/timeseries?days=7&city=Berlin
Authorization: Bearer <token>
```

Returns hourly data points with average latency. Filter to a specific city with the optional `city` parameter.

### Full Analytics

```http
GET https://api.cdnpulse.io/api/apps/{name}/analytics?days=7
Authorization: Bearer <token>
```

Returns the complete analytics dataset combining summary, regions, cities, and timeseries in one response.

## Public Analytics (No Auth Required)

Applications with `public: true` expose their analytics without authentication:

```http
GET https://api.cdnpulse.io/api/apps/public/{name}/analytics?days=7
GET https://api.cdnpulse.io/api/apps/public/{name}/analytics/timeseries?days=7
```

## Interpreting Results

- **TTFB** (Time to First Byte) — measures CDN cache/edge response speed.
- **Download time** — measures transfer speed from CDN edge to user.
- Low TTFB + high download time → CDN edge is fast but connection bandwidth is the bottleneck.
- High TTFB → CDN may be missing cache or routing to a distant PoP.

Full API reference: https://cdnpulse.io/openapi.yaml
