Statistics

Updated 25 Sep 2026

One call returns a zone's traffic as a series of days or hours, plus a breakdown of the period by country and by network. The figures are the ones behind the statistics page, in UTC, and they are read with a GET that takes its filters from a JSON body (curl and every HTTP library send one; a browser's fetch() cannot).

Read the statistics#

GEThttps://api.cachegenie.com/v1/cdn/{ZONE_ID}/stats
  • FROM_TIMESTAMPIntegeroptionalthe start, Unix seconds. Rounded down to the day, or to the hour with hourly detail. The default is midnight UTC 28 days ago.
  • TO_TIMESTAMPIntegeroptionalthe end, Unix seconds. The default is now.
  • GRANULARITYStringoptionalday (the default) or hour. Hourly figures are kept for 90 days, so a range that starts before that is answered by day whatever was asked for, and the GRANULARITY in the response says day.
  • NODEStringoptionala location id, to count one location only: any id Locations returns, or one a past response listed under NODES.
curl -X GET https://api.cachegenie.com/v1/cdn/AB12CD34E/stats \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"FROM_TIMESTAMP": 1788652800, "GRANULARITY": "day"}'
{
  "CODE": 200,
  "MESSAGE": "CDN Zone Statistics Returned.",
  "DATA": {
    "GRANULARITY": "day",
    "NODE": "",
    "NODES": [
      { "ID": "alpha1", "LOCATION": "Alpha City, XX" },
      { "ID": "beta1", "LOCATION": "Beta City, XX" }
    ],
    "CDN_DAILY_STATS": [
      {
        "DAY_TIMESTAMP": 1788652800,
        "REQUESTS": 184220,
        "CACHE_HITS": 171905,
        "CACHE_MISS": 12315,
        "BANDWIDTH_BYTES": 812390411264,
        "ORIGIN_BYTES": 54310789120,
        "BLOCKED": 0
      }
    ],
    "CDN_COUNTRIES": [
      {
        "COUNTRY": "GB",
        "REQUESTS": 120410,
        "BANDWIDTH_BYTES": 530112233472,
        "BLOCKED": 0
      },
      {
        "COUNTRY": "IE",
        "REQUESTS": 22815,
        "BANDWIDTH_BYTES": 101922177792,
        "BLOCKED": 0
      }
    ],
    "CDN_NETWORKS": [
      {
        "ASN": 5089,
        "REQUESTS": 60122,
        "BANDWIDTH_BYTES": 265056116736,
        "BLOCKED": 0
      },
      {
        "ASN": 0,
        "REQUESTS": 4110,
        "BANDWIDTH_BYTES": 18110000000,
        "BLOCKED": 0
      }
    ]
  }
}

The series#

  • GRANULARITYStringthe detail that applied, day or hour.
  • NODEStringthe location filter that applied, or empty when none did.
  • NODESArraythe locations that served the zone in the period, as ID and LOCATION. Not narrowed by NODE. An ID of unassigned is traffic recorded before its server was placed in a location, and cannot be filtered on.
  • CDN_DAILY_STATSArrayone row per day, or per hour with hourly detail, oldest first, for the buckets that had traffic. DAY_TIMESTAMP is the start of the day or hour; REQUESTS is CACHE_HITS plus CACHE_MISS; BANDWIDTH_BYTES is bytes sent to viewers; ORIGIN_BYTES is bytes fetched from your origin; BLOCKED is requests your blocking rules refused, which are not in REQUESTS.

What each figure counts, what is deliberately not counted, and the units are in Statistics. A GRANULARITY other than the two answers 400 GRANULARITY must be "day" or "hour".; an unknown NODE answers 400 NODE is not a known CDN location; see NODES in the response of a request without it. A body that is not JSON is ignored and the defaults apply.

Countries and networks#

  • CDN_COUNTRIESArraythe period broken down by COUNTRY, a two-letter code, empty when the address could not be placed; up to 250 rows, busiest first.
  • CDN_NETWORKSArraythe period broken down by ASN, the AS number as an integer, 0 for addresses no network announces and for the long tail of small networks; up to 50 rows, busiest first. The statistics page lists only the AS numbers the zone blocks, so this breakdown is the API's alone.

Each row carries REQUESTS, BANDWIDTH_BYTES and BLOCKED. Both breakdowns are counted per whole UTC day whatever GRANULARITY says, so they can reach a little either side of an hourly period.

Ask a human

To
Subject
Docs: Statistics

Read and answered by the people who build CacheGenie, seven days a week.

Write to us