On a schedule
Get a weekly Cloudflare traffic report
Every Monday you see requests, bandwidth and blocked threats for each site, with the change from the week before.
- Runs
- On a schedule
- Apps
- Cloudflare
- AI
- Not needed
- Access
- Zone Analytics: Read
Send this to your assistant
Create a ClickRuntime automation: every Monday at 9am, email me last week's Cloudflare requests, bandwidth and threats blocked for example.com and shop.example.com, compared with the previous week.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Site owners often discover a traffic problem from a customer complaint. A bot wave inflates requests, bandwidth jumps after a viral post, or a firewall rule starts blocking real visitors, and nobody sees it because Cloudflare's analytics pages are only opened when something already seems wrong.
Every Monday, this queries Cloudflare's GraphQL analytics for the last seven days and the seven before, calculates the changes, and emails you requests, bandwidth and threats blocked for each site. The comparison with the prior week makes it obvious whether something moved.
Agencies with many client sites, and owners of a few busy ones, use it as a quick Monday health check. The figures are queried from Cloudflare's analytics for each zone, so they match what you would see in the dashboard, without opening each site to read them off.
What you get out of it
Notice traffic surprises on Monday morning
A sudden 60% jump in requests or bandwidth shows up in the email on the first day of the week. You can investigate before the hosting bill or the origin server feels the strain.
Show that protection is working
Threats blocked per site gives you a figure to report to clients or leadership. It demonstrates that the firewall is doing real work rather than sitting idle. You can send clients a clear figure for what the firewall stopped, which supports the case for keeping protection switched on.
Catch accidental blocking
If threats blocked climb sharply while requests fall, a rule may be catching genuine visitors. That pattern is much easier to see in a weekly comparison than in a live chart. Threats blocked rising as requests fall is a classic sign of a rule catching real visitors, and the weekly comparison makes it visible.
Plan capacity and bandwidth costs
Week-over-week bandwidth figures let you anticipate when you will pass a plan's allowance. You can adjust caching or upgrade before overage charges arrive. Seeing bandwidth week by week lets you predict when a plan allowance will run out, and choose caching or an upgrade in advance.
Report to clients without opening Cloudflare
Agencies can forward a clean weekly email to clients who want traffic numbers. It saves exporting screenshots and keeps client reporting consistent. Agencies can forward the same tidy email to clients who ask for numbers, which saves them from screenshots and one-off exports.
How it works
What happens, step by step
Every Monday at 9, ClickRuntime pulls Cloudflare traffic for each of your sites.
It gets requests, bandwidth and blocked threats for the last week and the week before.
It works out the percentage change for each figure.
The report arrives in your inbox, one line per site.
Before it runs live
- Connect Cloudflare
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Cloudflare steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
CF = "https://api.cloudflare.com/client/v4"
def cf(path, **params):
resp = http.get(f"{CF}{path}", params=params, headers={"Authorization": f"Bearer {credentials.secret('CLOUDFLARE_API_TOKEN')}"})
resp.raise_for_status()
return resp.json()["result"]
ZONES = ["example.com", "shop.example.com"]
QUERY = """query($zone: String!, $from: Date!, $to: Date!) { viewer { zones(filter: {zoneTag: $zone}) {
httpRequests1dGroups(limit: 7, filter: {date_geq: $from, date_lt: $to}) { sum { requests bytes threats } } } } }"""
def week(zone_id, end):
body = {"query": QUERY, "variables": {"zone": zone_id, "from": str(end - timedelta(days=7)), "to": str(end)}}
resp = http.post(f"{CF}/graphql", json=body, headers={"Authorization": f"Bearer {credentials.secret('CLOUDFLARE_API_TOKEN')}"})
days = resp.json()["data"]["viewer"]["zones"][0]["httpRequests1dGroups"]
return {k: sum(d["sum"][k] for d in days) for k in ("requests", "bytes", "threats")}
@on_trigger
def run(event):
today, lines = date.today(), []
for name in ZONES:
zone_id = cf("/zones", name=name)[0]["id"]
cur, prev = week(zone_id, today), week(zone_id, today - timedelta(days=7))
pct = lambda k: f"{(cur[k] - prev[k]) / prev[k] * 100:+.0f}%" if prev[k] else "n/a"
lines.append(f"{name}: {cur['requests']:,} requests ({pct('requests')}), {cur['bytes'] / 1e9:.1f} GB ({pct('bytes')}), "
f"{cur['threats']:,} threats ({pct('threats')})")
notify.email_me("Cloudflare traffic last week", "\n".join(lines))
return {"zones": len(lines)}FAQ
Common questions
Are the numbers per site or combined?
Which Cloudflare plan do I need for analytics?
Can it cover only certain domains?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Email yourself a weekly DNS backup
Each week a copy of every DNS record in your zones lands in your inbox, ready to restore from.
See how it worksGet a Slack alert when a DNS record changes
Within the hour you know about any DNS record that was added, removed or edited, and what it looked like before.
See how it worksGet warned 30 days before a certificate expires
Each certificate close to expiry is flagged once, a month ahead, so you have time to renew it.
See how it worksKeep exploring
Set up “Get a weekly Cloudflare traffic report” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.