Skip to content

Analytics

4 operations in the WP Waterfall API.

Plan usage across the company, with a row per site

get/companies/me/analytics/usagePermalink to Plan usage across the company, with a row per site

  • Scope: sites:read
  • Permission: sites.read

Returns usage across the company's sites for one window, with a row per site. The window is the current billing period by default, the period before it with period=previous, or the from and to you send. A member limited to some sites gets the usage of those sites with no plan or billed figures.

Parameters

NameInTypeDescription
fromquerystring (date-time)Defaults to the start of the current billing period.
toquerystring (date-time)
periodquerystringprevious is the billing period before the current one (a month earlier, whole). It ignores from and to. The answer carries the dates it used. One of: current, previous.

Responses

StatusBodyDescription
200AnalyticsUsagePlan usage
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
scope requiredstringOne of: environment, company.
environment_id requiredstring or null (uuid)UUIDv7
from requiredstring (date-time)
to requiredstring (date-time)
billing_period requiredbooleanTrue when the window is a whole billing period (the current one, or the previous one with period=previous), so the bars compare with the plan.
plan_name requiredstring or null
source requiredstringWhere the numbers come from: the node logs, the demo seed, or nowhere yet. One of: node_logs, demo, none.
note requiredstring or null
query_version requiredstring
last_collected_at requiredstring or null (date-time)
meters requiredarray of object
meters[].metric requiredstringWhat the meter counts. One of: visits, server_bandwidth, cdn_bandwidth, disk, sites.
meters[].unit requiredstringbytes for disk and bandwidth, count for visits and sites. One of: count, bytes.
meters[].used requirednumber or nullNull when the figure is not measured, so nothing is shown rather than a guess. Range: 0 to any.
meters[].included requirednumber or nullWhat the plan includes for the period. Null when the plan does not limit it. Range: 0 to any.
meters[].percent requirednumber or nullUsed over included, as a percentage with one decimal. Null without both numbers. Range: 0 to any.
meters[].available requiredbooleanTrue when used holds a measured figure.
meters[].note requiredstring or nullWhere the figure comes from, or why it is missing, in a plain sentence. Null when none.
meters[].statestringpermission_needed when Cloudflare refused the platform token; used is then null. One of: permission_needed, not_configured, not_on_plan.
daily requiredarray of object
daily[].day requiredstring
daily[].visits requiredintegerRange: 0 to any.
daily[].page_views requiredintegerRange: 0 to any.
daily[].bytes requiredintegerServer bandwidth without bots. Range: 0 to any.

An analytics view rolled up across the company's environments

get/companies/me/analytics/{view}Permalink to An analytics view rolled up across the company's environments

  • Scope: sites:read
  • Permission: sites.read

Returns one view, such as visits, bandwidth, response-codes, or top-countries, added up over the environments of the sites the caller can see. The window runs from from to to (the last 7 days by default, and no further back than 396 days) in buckets of time_span (default day). available is false with a plain note when the source of a view has sent nothing yet.

Parameters

NameInTypeDescription
view requiredpathstring
fromquerystring (date-time)
toquerystring (date-time)
time_spanquerystringOne of: hour, day, week, month. Default: day.
traffic_typequerystringOnly the top-traffic-* views read it. One of: all, visitors, named_bots, ai_crawlers, automation_tools. Default: all.

Responses

StatusBodyDescription
200AnalyticsResultThe view
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
view requiredstringOne of: visits, visits-dispersion, bandwidth, cdn-bandwidth, edge-cache-bandwidth, disk-space, response-codes, top-countries, top-asns, top-hosts, top-referrers, top-browsers, page-views, requests, top-requests, top-paths-bytes, top-cities, top-user-agents, top-client-ips, device-series, bot-classes, bot-results, top-traffic-paths, top-traffic-user-agents, top-traffic-countries, top-traffic-ips, redirect-series, client-error-series, server-error-series, status-codes, top-404, top-cached-paths, top-bypassed-paths, php-throughput, php-share, cache-status, response-time, bot-traffic, cache-series, response-series, cache-breakdown.
scope requiredstringOne of: environment, company.
environment_id requiredstring or null (uuid)UUIDv7
from requiredstring (date-time)
to requiredstring (date-time)
time_span requiredstringOne of: hour, day, week, month.
unit requiredstringOne of: count, bytes, percent, ms.
total requirednumber
available requiredboolean
note requiredstring or null
statestringWhy a figure is missing, when it is: permission_needed means Cloudflare refused the platform token (it needs Zone > Analytics > Read), not_configured means no Cloudflare token is set, and not_on_plan means the zone's plan does not offer the field. Absent when the view has numbers or the reason is something else. One of: permission_needed, not_configured, not_on_plan.
query_version requiredstringVersions the counting rules, such as visits-v2-node for node visits.
rows requiredarray of object
rows[].bucket requiredstring or null (date-time)Start of the bucket (ISO 8601) for a series, null for a top list.
rows[].key requiredstring or nullThe dimension value, such as a country code, host, or client IP. Null for a total series.
rows[].label requiredstring
rows[].value requirednumber
rows[].share requirednumber or nullShare of the total, 0 to 1. Null when the total is zero. Range: 0 to 1.
rows[].bytesinteger or nullBytes sent for the row, on top lists that know them (top requests, countries). Range: 0 to any.
rows[].requestsinteger or nullRequests for the row, on top lists that rank by something else (paths ranked by bytes carry the bytes in value). Absent on series and on lists with no request count. Range: 0 to any.

Plan usage for one environment: visits, bandwidth, and disk against the plan

get/environments/{id}/analytics/usagePermalink to Plan usage for one environment: visits, bandwidth, and disk against the plan

  • Scope: sites:read
  • Permission: sites.read

Read from the hourly rollups of the node's access logs. The default window is the current billing period; period=previous reads the whole period before it. Bots are left out of visits and bandwidth. Each day carries the server bytes and, when Cloudflare has answered, the CDN bytes. CDN bandwidth reads Cloudflare for the environment's domains; when Cloudflare cannot answer, the meter says why.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the environment.
fromquerystring (date-time)Defaults to the start of the current billing period.
toquerystring (date-time)
periodquerystringprevious is the billing period before the current one (a month earlier, whole). It ignores from and to. The answer carries the dates it used. One of: current, previous.

Responses

StatusBodyDescription
200AnalyticsUsagePlan usage
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
scope requiredstringOne of: environment, company.
environment_id requiredstring or null (uuid)UUIDv7
from requiredstring (date-time)
to requiredstring (date-time)
billing_period requiredbooleanTrue when the window is a whole billing period (the current one, or the previous one with period=previous), so the bars compare with the plan.
plan_name requiredstring or null
source requiredstringWhere the numbers come from: the node logs, the demo seed, or nowhere yet. One of: node_logs, demo, none.
note requiredstring or null
query_version requiredstring
last_collected_at requiredstring or null (date-time)
meters requiredarray of object
meters[].metric requiredstringWhat the meter counts. One of: visits, server_bandwidth, cdn_bandwidth, disk, sites.
meters[].unit requiredstringbytes for disk and bandwidth, count for visits and sites. One of: count, bytes.
meters[].used requirednumber or nullNull when the figure is not measured, so nothing is shown rather than a guess. Range: 0 to any.
meters[].included requirednumber or nullWhat the plan includes for the period. Null when the plan does not limit it. Range: 0 to any.
meters[].percent requirednumber or nullUsed over included, as a percentage with one decimal. Null without both numbers. Range: 0 to any.
meters[].available requiredbooleanTrue when used holds a measured figure.
meters[].note requiredstring or nullWhere the figure comes from, or why it is missing, in a plain sentence. Null when none.
meters[].statestringpermission_needed when Cloudflare refused the platform token; used is then null. One of: permission_needed, not_configured, not_on_plan.
daily requiredarray of object
daily[].day requiredstring
daily[].visits requiredintegerRange: 0 to any.
daily[].page_views requiredintegerRange: 0 to any.
daily[].bytes requiredintegerServer bandwidth without bots. Range: 0 to any.

An analytics view for one environment

get/environments/{id}/analytics/{view}Permalink to An analytics view for one environment

  • Scope: sites:read
  • Permission: sites.read

Views: visits, visits-dispersion, bandwidth, cdn-bandwidth, disk-space, response-codes, top-countries, top-asns, top-hosts, top-referrers, top-browsers, page-views, requests, top-requests, top-paths-bytes, cache-status, response-time, bot-traffic, status-codes, top-404, top-cached-paths, top-bypassed-paths, php-throughput, php-share, cache-series, response-series. cache-series and response-series answer one row per bucket and key (Hit, Miss, Bypass, or the status classes 2, 3, 4, 5), for stacked charts. top-paths-bytes ranks the busiest paths by bytes sent (unit bytes), among the 50 most requested paths of each day. status-codes ranks the exact HTTP status codes (301, 404, 500), top-404 ranks the paths that answered 404 for visitors that are not bots, and top-cached-paths and top-bypassed-paths rank the pages served from the page cache and the pages that ran PHP with no cached copy. php-throughput answers PHP requests per minute for each bucket, and php-share answers the share of requests that ran PHP against those served static or from the page cache. A server whose agent does not send these counts yet answers available false with a note. Most views read the hourly rollups of the node's access logs. cdn-bandwidth, visits-dispersion, top-browsers, and top-asns read Cloudflare for this environment's domains only. Visits follow the versioned counting rules in query_version. A view with nothing to show yet answers available false with a note. Retention is 13 months.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the environment.
view requiredpathstring
fromquerystring (date-time)
toquerystring (date-time)
time_spanquerystringOne of: hour, day, week, month. Default: day.
traffic_typequerystringOnly the top-traffic-* views read it. One of: all, visitors, named_bots, ai_crawlers, automation_tools. Default: all.

Responses

StatusBodyDescription
200AnalyticsResultThe view
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
view requiredstringOne of: visits, visits-dispersion, bandwidth, cdn-bandwidth, edge-cache-bandwidth, disk-space, response-codes, top-countries, top-asns, top-hosts, top-referrers, top-browsers, page-views, requests, top-requests, top-paths-bytes, top-cities, top-user-agents, top-client-ips, device-series, bot-classes, bot-results, top-traffic-paths, top-traffic-user-agents, top-traffic-countries, top-traffic-ips, redirect-series, client-error-series, server-error-series, status-codes, top-404, top-cached-paths, top-bypassed-paths, php-throughput, php-share, cache-status, response-time, bot-traffic, cache-series, response-series, cache-breakdown.
scope requiredstringOne of: environment, company.
environment_id requiredstring or null (uuid)UUIDv7
from requiredstring (date-time)
to requiredstring (date-time)
time_span requiredstringOne of: hour, day, week, month.
unit requiredstringOne of: count, bytes, percent, ms.
total requirednumber
available requiredboolean
note requiredstring or null
statestringWhy a figure is missing, when it is: permission_needed means Cloudflare refused the platform token (it needs Zone > Analytics > Read), not_configured means no Cloudflare token is set, and not_on_plan means the zone's plan does not offer the field. Absent when the view has numbers or the reason is something else. One of: permission_needed, not_configured, not_on_plan.
query_version requiredstringVersions the counting rules, such as visits-v2-node for node visits.
rows requiredarray of object
rows[].bucket requiredstring or null (date-time)Start of the bucket (ISO 8601) for a series, null for a top list.
rows[].key requiredstring or nullThe dimension value, such as a country code, host, or client IP. Null for a total series.
rows[].label requiredstring
rows[].value requirednumber
rows[].share requirednumber or nullShare of the total, 0 to 1. Null when the total is zero. Range: 0 to 1.
rows[].bytesinteger or nullBytes sent for the row, on top lists that know them (top requests, countries). Range: 0 to any.
rows[].requestsinteger or nullRequests for the row, on top lists that rank by something else (paths ranked by bytes carry the bytes in value). Absent on series and on lists with no request count. Range: 0 to any.