Get a weekly Cloudflare report on traffic, caching and blocked threats

Every Monday: requests, cache hit ratio, bandwidth and threats per Cloudflare zone for last week, against the week before, with top countries.

Runs
Mondays at 8:00
Posts
Report card

From your apps to your board

How the skill works: your agent reads zones from Cloudflare; zones from What you tell it, mondays at 8:00, and gives you report card and the report in the chat.

Reads

  • CloudflareZones
  • What you tell itZones
reads
Your agentClaude Code, Codex, Cursor or GeminiMondays at 8:00
posts

You get

  • Report cardOn your board, updated in place every run
  • The report in the chatEvery run, with or without Briefkin

What you get

  • Totals: requests, unique visitors, bandwidth, cache hit ratio and threats, with the weekly change.
  • Per zone: the same, one row each.
  • Top countries by requests, with any sudden riser flagged.
  • Security actions: blocked and challenged requests by source, where available.
  • One line on what to look at, such as a cache rule that stopped matching.

The card on the right is a sample. Yours shows your own numbers and updates in place every run.

What lands on your board

AcmeCloudflare weekly traffic and threats report · Claude Code

Traffic up 6%, cache hit ratio down on shop.example.com

12.4M requests across 3 zones last week, up 6%. shop.example.com fell from 78% to 64% served from cache after Thursday's deploy.

Requests12.4M+6.0% vs previous period
Cache hit ratio71%
Threats48,210+22% vs previous period, worse
ZoneRequestsCachedBandwidthThreats
example.com7.1M76%412 GB31,040
shop.example.com4.2M64%286 GB15,900
docs.example.com1.1M68%38 GB1,270
United States5,210,000 requests
Germany1,640,000 requests
United Kingdom1,120,000 requests
Singapore980,000 requests
Canada610,000 requests

Singapore traffic tripled on shop.example.com, mostly to /api/products. Check whether it is a scraper before raising cache TTLs.

Done
An example with made-up numbers. Your agent posts your real ones.

What it does

The Cloudflare dashboard has good charts per zone, and most people with five zones look at one of them now and then. A falling cache hit ratio after a deploy, or a week where one country sends ten times its usual traffic, goes unnoticed until the origin bill or an outage points at it.

The agent reads the GraphQL Analytics API for every zone on the account and lays last week next to the week before: requests, share served from cache, bandwidth, threats, and the countries traffic came from. It points at the zone that changed and the likely reason.

How it works

  1. 1List the zones

    GET https://api.cloudflare.com/client/v4/zones?status=active returns each zone's id and name. Use the list in the prompt to skip parked domains.

  2. 2Query daily traffic for two weeks

    GraphQL viewer { zones(filter: {zoneTag: $zone}) { httpRequests1dGroups(limit: 14, filter: {date_geq: $start, date_leq: $end}, orderBy: [date_ASC]) { dimensions { date } sum { requests cachedRequests bytes cachedBytes threats countryMap { clientCountryName requests threats } } uniq { uniques } } } }, then split into last week and the week before.

  3. 3

    3Compute the ratios

    Cache hit ratio = cachedRequests / requests, bandwidth saved = cachedBytes / bytes. Sum countryMap by country for the top five, and flag a country whose requests grew more than threefold.

  4. 4Break down security actions

    Where your plan keeps security events for the week, query firewallEventsAdaptiveGroups(limit: 10, filter: {datetime_geq, datetime_leq}, orderBy: [count_DESC]) { count dimensions { action source } } to show what was blocked or challenged, and by which rule type.

  5. 5

    5Report

    Account totals with the weekly change, then one row per zone, then the top countries and security actions. Call out a cache hit ratio that dropped more than 5 points.

  6. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/cloudflare-weekly-traffic-and-threats/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the cloudflare-weekly-traffic-and-threats skill

    Or paste the prompt instead of installing:

    promptUsing the Cloudflare GraphQL Analytics API (or the Cloudflare API MCP server), for each active zone on my account query httpRequests1dGroups for the last 14 days with sum { requests cachedRequests bytes cachedBytes threats countryMap { clientCountryName requests threats } } and uniq { uniques }. Compare last week (Monday to Sunday) with the week before. Give totals and one row per zone: requests, unique visitors, bandwidth, cache hit ratio (cachedRequests / requests) and threats, with the change. List the top five countries by requests and flag any that grew more than threefold. If my plan keeps security events for a week, add firewallEventsAdaptiveGroups by action and source. Point out any zone whose cache hit ratio fell by more than 5 points. Read only.
  3. Put it on a schedule

    Mondays at 8:00, from cron on any machine where Claude Code is signed in:

    crontab0 8 * * 1 claude -p "Run the cloudflare-weekly-traffic-and-threats skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: cloudflare-weekly-traffic-and-threats
description: "Every Monday: requests, cache hit ratio, bandwidth and threats per Cloudflare zone for last week, against the week before, with top countries. Use when the user asks for this, or when it runs on a schedule."
---

# Cloudflare weekly traffic and threats report

Every Monday: requests, cache hit ratio, bandwidth and threats per Cloudflare zone for last week, against the week before, with top countries.

The Cloudflare dashboard has good charts per zone, and most people with five zones look at one of them now and then. A falling cache hit ratio after a deploy, or a week where one country sends ten times its usual traffic, goes unnoticed until the origin bill or an outage points at it.

The agent reads the GraphQL Analytics API for every zone on the account and lays last week next to the week before: requests, share served from cache, bandwidth, threats, and the countries traffic came from. It points at the zone that changed and the likely reason.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- A Cloudflare API token with Zone Analytics read access for the zones (and Account Analytics read) in `CLOUDFLARE_API_TOKEN`.
- Or the Cloudflare API MCP server at `https://mcp.cloudflare.com/mcp`.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **List the zones** (Cloudflare): `GET https://api.cloudflare.com/client/v4/zones?status=active` returns each zone's `id` and `name`. Use the list in the prompt to skip parked domains.
2. **Query daily traffic for two weeks** (Cloudflare): GraphQL `viewer { zones(filter: {zoneTag: $zone}) { httpRequests1dGroups(limit: 14, filter: {date_geq: $start, date_leq: $end}, orderBy: [date_ASC]) { dimensions { date } sum { requests cachedRequests bytes cachedBytes threats countryMap { clientCountryName requests threats } } uniq { uniques } } } }`, then split into last week and the week before.
3. **Compute the ratios**: Cache hit ratio = `cachedRequests / requests`, bandwidth saved = `cachedBytes / bytes`. Sum `countryMap` by country for the top five, and flag a country whose requests grew more than threefold.
4. **Break down security actions** (Cloudflare): Where your plan keeps security events for the week, query `firewallEventsAdaptiveGroups(limit: 10, filter: {datetime_geq, datetime_leq}, orderBy: [count_DESC]) { count dimensions { action source } }` to show what was blocked or challenged, and by which rule type.
5. **Report**: Account totals with the weekly change, then one row per zone, then the top countries and security actions. Call out a cache hit ratio that dropped more than 5 points.

## Route B: the browser

### What you need

- Signed in to the Cloudflare dashboard with a member role that can read analytics for the zones, such as Analytics or Administrator Read Only.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://dash.cloudflare.com/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Start with the account view**: The dashboard opens on the account list; pick the account. In the account sidebar open **Analytics & Logs** > **Account analytics**, set the time range to **Previous 7 days**, and read total requests, bandwidth and the per-zone breakdown. Repeat with the custom range for the week before.
2. **Open each zone's traffic analytics**: Go back to the account home, click the zone, then **Analytics & Logs** > **Traffic**. With **Previous 7 days** set, read **Requests**, **Bandwidth** (served versus cached) and **Unique visitors**; cache hit ratio is cached requests divided by requests.
3. **Read the countries**: Further down the Traffic page, the **Top countries** list and map give requests by country for the range. Note the top five and compare with the previous week's range for any country that grew more than threefold.
4. **Read the security actions**: In the zone sidebar open **Security** > **Analytics** (or **Security** > **Events** on zones that still show the older layout), same range. Read mitigated requests, then the breakdown by **Action** (block, managed challenge, JS challenge) and by **Service** or source (WAF, rate limiting, bot management).
5. **Report**: Account totals with the weekly change, one row per zone, the top countries and the security actions. Call out any zone whose cache hit ratio dropped more than 5 points.

Note: The dashboard ranges are rolling (previous 7 days from now), not Monday to Sunday, so numbers differ slightly from the API report; custom ranges fix that on plans that allow them. How far back Security analytics goes depends on the plan, and on Free zones it can be shorter than a week. Account analytics may be sampled on very busy accounts.

## The report

- **Totals**: requests, unique visitors, bandwidth, cache hit ratio and threats, with the weekly change.
- **Per zone**: the same, one row each.
- **Top countries** by requests, with any sudden riser flagged.
- **Security actions**: blocked and challenged requests by source, where available.
- One line on what to look at, such as a cache rule that stopped matching.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "cloudflare-weekly-traffic-and-threats/<date of this run, e.g. 2026-10-16>",
  "item_key": "cloudflare-weekly-traffic-and-threats",
  "project": "Acme",
  "source": "Cloudflare weekly traffic and threats report skill",
  "kind": "update",
  "title": "Traffic up 6%, cache hit ratio down on shop.example.com",
  "summary": "**12.4M** requests across 3 zones last week, up 6%. **shop.example.com** fell from 78% to **64%** served from cache after Thursday's deploy.",
  "widget": [
    {
      "type": "Grid",
      "props": {
        "columns": 3
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "Requests",
            "value": "12.4M",
            "delta": 6
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Cache hit ratio",
            "value": 71,
            "unit": "%"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Threats",
            "value": 48210,
            "delta": 22,
            "better": "lower"
          }
        }
      ]
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Zone",
          "Requests",
          "Cached",
          "Bandwidth",
          "Threats"
        ],
        "align": [
          "left",
          "right",
          "right",
          "right",
          "right"
        ],
        "rows": [
          [
            "example.com",
            "7.1M",
            "76%",
            "412 GB",
            "31,040"
          ],
          [
            "shop.example.com",
            "4.2M",
            "64%",
            "286 GB",
            "15,900"
          ],
          [
            "docs.example.com",
            "1.1M",
            "68%",
            "38 GB",
            "1,270"
          ]
        ]
      }
    },
    {
      "type": "Bars",
      "props": {
        "unit": "requests",
        "items": [
          {
            "label": "United States",
            "value": 5210000
          },
          {
            "label": "Germany",
            "value": 1640000
          },
          {
            "label": "United Kingdom",
            "value": 1120000
          },
          {
            "label": "Singapore",
            "value": 980000
          },
          {
            "label": "Canada",
            "value": 610000
          }
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Singapore traffic tripled on shop.example.com, mostly to /api/products. Check whether it is a scraper before raising cache TTLs.",
        "tone": "warn"
      }
    }
  ]
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

## Run it on a schedule

Suggested: Mondays at 8:00 (`0 8 * * 1`). From cron, with the agent signed in on that machine:

```bash
0 8 * * 1 claude -p "Run the cloudflare-weekly-traffic-and-threats skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/cloudflare-weekly-traffic-and-threats#schedule

Source: https://briefkin.dev/skills/cloudflare-weekly-traffic-and-threats

What your agent needs

  • A Cloudflare API token with Zone Analytics read access for the zones (and Account Analytics read) in CLOUDFLARE_API_TOKEN.

  • Or the Cloudflare API MCP server at https://mcp.cloudflare.com/mcp.

Connecting Cloudflare

  1. Cloudflare API MCP server, Cloudflare's official remote server at https://mcp.cloudflare.com/mcp. In Claude Code run claude mcp add --transport http cloudflare https://mcp.cloudflare.com/mcp, in Codex codex mcp add cloudflare --url https://mcp.cloudflare.com/mcp, and in Cursor add the URL to mcp.json; you then authorize through Cloudflare and choose the permissions to grant. It reaches the whole API through two tools, search to find endpoints and execute to call them (GraphQL analytics queries included), plus a docs tool (docs). The older per-product servers, such as Observability and GraphQL, are deprecated in its favor.
  2. The same server with an API token, for unattended runs: create a token at dash.cloudflare.com/profile/api-tokens and send it as Authorization: Bearer. An account token also needs Account Resources: Read so the server can find the account ID.
  3. API and Wrangler. The skill reads CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID (the names Wrangler uses too) and posts GraphQL queries; wrangler tail <worker> streams live logs when you need to watch an error happen.

Create the token with only Account Analytics: Read, Zone Analytics: Read and Workers Scripts: Read on the accounts and zones in the report; with no Edit permissions, execute can't change anything.

Questions

What counts as a threat?

threats in the HTTP request analytics counts requests Cloudflare classified as a threat and mitigated, for example by a WAF rule, a challenge or a block. For detail on which rule did it, the security events query breaks mitigated requests down by action and source.

Why is the security breakdown missing on my zone?

How far back security events can be queried depends on the plan, and on lower plans it can be shorter than a week. The traffic numbers, threats total included, come from a dataset every plan has, so the rest of the report still works.

Do I need Briefkin to use the Cloudflare weekly traffic and threats report skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Cloudflare pages themselves: the agent opens dash.cloudflare.com in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Read this report on your board, not in a chat log

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.