Get website traffic analytics
Get edge traffic analytics for an application’s domains with GET /v2/apps/:app_id/network/analytics: requests, bandwidth, visitors and breakdowns.
GET
Get website traffic analytics
The API key for your account. You can find this in your account settings.
apps:read scope.
Analytics aggregates Cloudflare edge traffic for the application’s default squareweb.app domain and any attached custom domain: request counts, bandwidth, visitor counts, and breakdowns by country, device, OS, browser, protocol, method, path, referer, and client network. Use it to build traffic dashboards or spot unusual patterns without pulling raw request logs.
Results are cached in 5-minute buckets, so polling the same window repeatedly is cheap. Cache misses share one limit of 20 requests per 60 seconds per application owner, across the analytics, errors, logs and performance endpoints. Cached responses do not count. During platform-wide busy periods the endpoint may return the most recent cached data for the requested window instead. The maximum lookback is 7 days, and the effective start is clamped to the application’s creation date. Unlike Network Logs and Network Performance, this endpoint is available on every plan, not just Pro and Enterprise.
For error-focused traffic instead of overall traffic, see Network Errors. To purge cached edge responses after a deploy, see Purge Cache.
Parameters
The ID of the application. You can find this in the URL of your application’s dashboard.
ISO 8601 start timestamp for the analysis window. The maximum retention window is 7 days; the start is clamped to the application’s creation date.
Drill-down filters
Optional filters that narrow every breakdown to the matching traffic. Feed back the exacttype value returned by the corresponding breakdown in a previous response. Filters combine (AND).
A single client network, with the exact
type value the providers breakdown returns, for example GOOGLE (15169). A bare ASN number or SQUARE-CLOUD-PLATFORM also work. Any other value answers INVALID_FILTER.A single response content type, as returned in the
content_types breakdown (Unknown = unclassified).A single verified-bot category, as returned in the
bots breakdown (Unverified = regular non-bot traffic).Response
This route can send a response in a compressed format, optimizing data transmission.
Each breakdown is an array of buckets.
type identifies the dimension, visits is unique visitors, requests is the request count, bytes is the response bytes served, and date is the 15-minute window start. The ips, status_codes, bots, and content_types breakdowns are window totals (top-N over the whole window) and carry no date field. Returns an empty object ({}) when the requested window starts before the application’s creation date. The visits time buckets also carry bytes_in, the request bytes received from visitors (uploads and request bodies).Common errors
Related
- CLI:
squarecloud app network analytics - SDKs:
api.apps.network.analytics()(JavaScript),client.apps.network.analytics()(Python),c.Apps.Network.Analytics()(Go)

