Skip to main content
client.apps.network works on web apps only. Every method takes the app id first. Examples use the client from Creating the client. app_id is the id of one of your apps: client.account.me() lists them.

Time windows

analytics, errors, logs and performance take a start and an end, each an ISO 8601 string or a datetime. A naive datetime is local time, converted to UTC. A window is at most 7 days, and start is clamped to the app’s creation date. An invalid window is 400 INVALID_TIME_RANGE.
Results are cached in 5-minute buckets. Cache misses of these four methods share a limit of 20 requests per 60 seconds per account: going over it is 429 RATE_LIMITED.

Analytics

network.analytics(app_id, start, end, **filters) returns traffic totals and breakdowns. It returns None for a window with no traffic.
The breakdowns are countries, devices, os, browsers, protocols, methods, paths, referers, providers, ips, status_codes, bots and content_types. Each bucket has type, visits, requests and bytes.

Filters

Filters are keyword arguments and narrow every breakdown. Each takes the exact type value of its breakdown:
An invalid filter is 400 INVALID_FILTER. A filter set to None or '' is not sent.

Errors

network.errors(app_id, start, end, include_4xx=False) returns the 5xx responses of the window, plus 4xx with include_4xx=True (keyword-only). It returns None for an empty window.

Request logs

network.logs(app_id, start, end) returns individual requests with client, request and response details. Available on Pro and Enterprise plans (403 UPGRADE_REQUIRED otherwise).

Performance

network.performance(app_id, start, end) returns latency percentiles (p50, p95, p99, in ms) at the edge and at the origin, by country, by location and for the slowest paths. It returns None for an empty window. Available on Pro and Enterprise plans.

DNS

network.dns(app_id) returns the DNS records your custom domain needs, with their status. Without a custom domain it is 400 NO_CUSTOM_DOMAIN.

Custom domain

network.set_domain(app_id, domain) attaches a custom domain (Standard plan and up). Pass "@" to remove it.

Purging the cache

network.purge_cache(app_id) clears the app’s edge cache. It is limited to one purge every 60 seconds (429 KEEP_CALM).

Errors of the analytics methods

Next steps

Realtime

Stream live logs and status.

Network API reference

The REST endpoints behind these methods.

Edge analytics from the CLI

The same actions from the terminal.