# CDN Site Daily Traffic Stats

> CDN Site Daily Traffic Stats is a paid API for AI agents from cdn.withzero.xyz, paid per call via MPP, metered — billed by usage, live (last probed 2026-10-13, last successful call 2026-10-05).

Agents call it through Zero, which pays per call: no API key and no wallet of your own. New accounts start with $5.

Returns daily request and page view counts for a hosted static site over a configurable window of 1–90 days, including CDN-cached traffic.

## Facts

- Endpoint: GET https://cdn.withzero.xyz/api/v1/sites/{slug}/stats?utm_source=zero.xyz
- Price: metered — billed by usage
- Payment: MPP
- Status: healthy
- Last checked: 2026-10-13
- Last successful call: 2026-10-05
- Success rate: 100% of calls made through Zero
- Activations on Zero: 11
- Provider: cdn.withzero.xyz
- Website: https://cdn.withzero.xyz
- Canonical page: https://www.zero.xyz/c/cdn-withzero-xyz-cdn-site-daily-traffic-stats-c407238b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xHfXvxNkhZXzcXCdObcJg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability cdn-withzero-xyz-cdn-site-daily-traffic-stats-c407238b
```

Example prompt: Can you pull the daily traffic stats for my withzero-hosted site 'my-portfolio' for the last 30 days — I want to see both total requests and page views per day?

## When to prefer this

Use this endpoint when you need time-series traffic data (requests and page views) for a static site hosted on cdn.withzero.xyz. It is the only endpoint in this ecosystem that provides per-day CDN traffic analytics including cache hits. Prefer it over general web analytics tools when the site is already hosted on withzero and you want a lightweight, no-setup traffic report scoped to 1–90 days.

## Known failure modes

- Unknown slug returns 404 if the site does not exist or is not owned by the caller
- days parameter out of range (< 1 or > 90) may return a 400 validation error
- No data returned for days with zero traffic — gaps in the array are expected, not errors
- Counts may trail real time by a few minutes
- estimated=true means counts are approximations scaled from sampled data

## How this service works

Daily requests and page views for a public site you host, including visits served from the CDN cache. ?days=1–90 (default 7).

## Output

Returns a JSON object with the site slug, an array of daily records (UTC date, request count, page view count — oldest first, days with zero traffic omitted), and an 'estimated' boolean flag indicating whether counts were scaled up from a sample due to sampling.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "slug"
 ],
 "properties": {
  "slug": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "slug",
  "days",
  "estimated"
 ],
 "properties": {
  "days": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "day",
     "requests",
     "pageViews"
    ],
    "properties": {
     "day": {
      "type": "string",
      "description": "UTC date, YYYY-MM-DD. Days with no traffic are omitted."
     },
     "requests": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": -9007199254740991,
      "description": "Successful requests for any file of the site, including cached ones."
     },
     "pageViews": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": -9007199254740991,
      "description": "Of those, requests for pages (directories, .html, extensionless paths)."
     }
    },
    "additionalProperties": false
   },
   "description": "Oldest first. Counts trail real time by a few minutes."
  },
  "slug": {
   "type": "string"
  },
  "estimated": {
   "type": "boolean",
   "description": "True when request logging is sampled, so counts are scaled up from a sample."
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cdn-withzero-xyz-cdn-site-daily-traffic-stats-c407238b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cdn.withzero.xyz](https://www.zero.xyz/host/cdn.withzero.xyz/llms.txt)
