Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Cloudflare has two different interfaces that people call the “Web Analytics API.” The account-scoped Web Analytics site-info API manages RUM sites (list, retrieve, create, update, and delete). The separate GraphQL Analytics API queries aggregated Cloudflare network and product data. Choose the interface by your goal: configure a Web Analytics site with site-info endpoints, or retrieve analytics data with GraphQL.
How do I use the Cloudflare Web Analytics API?
Start by identifying the operation you need. The RUM site-info API is a REST-style resource interface for managing Web Analytics sites associated with an account. The documented operation family includes listing sites, retrieving one site, creating a site, updating a site, and deleting a site. Cloudflare’s current API reference should be treated as authoritative for the exact paths, path parameter names, request bodies, response schemas, and permissions; those details are not interchangeable with the GraphQL API.
If your objective is reporting—such as querying request counts, performance measurements, or product datasets—use the GraphQL Analytics API instead. It is a single endpoint that accepts POST requests containing a GraphQL document and variables.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Choose the interface by task
| Need | Use | What it does |
|---|---|---|
| Manage which Web Analytics sites exist | RUM site-info endpoint family | List, get, create, update, and delete Web Analytics site resources. |
| Query aggregated traffic or product measurements | GraphQL Analytics API | Runs filtered and aggregated queries across Cloudflare network and product datasets. |
| Collect visitor data from a website | Web Analytics setup | Installs or enables the Beacon collection method for the site. |
What is the Cloudflare Web Analytics site-info endpoint?
It is the management surface for Web Analytics (RUM) site records at the account scope. Cloudflare lists operations to enumerate the account’s sites, read an individual site, create one, modify one, and remove one. These operations concern site configuration and metadata; they are not a substitute for querying historical analytics measurements.
#1 Best Overall
Verify the live contract before coding
The available reference description does not establish endpoint-level URLs, JSON fields, response envelopes, or permission requirements. Do not infer those from the operation names or from examples for another Cloudflare API. Open the current Cloudflare API reference, select the Web Analytics site-info operation you need, and copy its path, required account identifier, body schema, and authentication scope exactly. Check whether your account or zone is supported and whether deletion is reversible before sending a destructive request.
Authentication boundaries
Cloudflare recommends API tokens for the GraphQL Analytics API. Its documented token configuration uses Account → Account Analytics → Read, with optional zone-resource restrictions, client-IP restrictions, and a token lifetime. The token is shown only when it is created, so store it in a secret manager or environment variable. These GraphQL permissions must not be assumed to be the exact scopes required by every RUM site-info operation; verify each operation in the current reference.
How do I get Web Analytics data from Cloudflare?
Send an HTTP POST request to https://api.cloudflare.com/client/v4/graphql with a JSON object containing query and variables. The query selects the dataset and dimensions documented for the product or network measurement you need. A request can contain multiple dataset queries, but Cloudflare waits for all of them and the request fails if any one fails.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallMinimal request shape
The following shows the transport shape without inventing a dataset name or field that may change. Replace the query with the operation from Cloudflare’s current GraphQL schema.
Rank #2
POST https://api.cloudflare.com/client/v4/graphql
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
{
"query": "query ($accountTag: String!) { ... }",
"variables": { "accountTag": "YOUR_ACCOUNT_ID" }
}
Use the schema explorer or current documentation to select valid types, filters, dimensions, and measures for your account. Handle both HTTP errors and GraphQL errors in the response; a successful HTTP transport does not guarantee that every field-level query succeeded.
Important billing qualification
Cloudflare explicitly says GraphQL Analytics data is not a billing measure. The API measures overall consumption, while billable traffic can exclude traffic such as DDoS traffic. Use the API for analytics, dashboards, and integrations—not to reproduce an invoice total.
How do I enable Cloudflare Web Analytics on a site?
Non-proxied sites
- Open the Web Analytics dashboard and add the site.
- Copy the JavaScript snippet Cloudflare provides.
- Insert it in the site’s HTML immediately before the closing
</body>tag. - Deploy the change and wait a few minutes for data to appear.
If you use a deployment pipeline, verify the snippet is present in the rendered production HTML rather than only in a source template.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesSites proxied through Cloudflare
- Add the hostname in the Web Analytics dashboard.
- Leave automatic setup enabled if you want Cloudflare to inject the Beacon.
- In the setup options, choose whether to exclude EU visitor data, install the snippet manually, or disable Web Analytics.
Automatic setup cannot modify an original payload served with Cache-Control: public, no-transform. Remove that directive where appropriate, or install the snippet manually.
Cloudflare Pages
For a Pages project, enable Web Analytics from the project’s Metrics page. Cloudflare adds the JavaScript snippet on the next deployment, so publish a new deployment after enabling it.
Current Web Analytics limits
Cloudflare’s limits page was last updated August 12, 2026; recheck it before building a long-lived integration.
| Limit | Documented value | Qualification |
|---|---|---|
| Non-proxied Web Analytics sites | 10 | Account limit listed by Cloudflare. |
| Proxied Web Analytics sites | No site-count limit stated | Applies to proxied sites on the limits page. |
| Dashboard aggregate view | 1,000 websites in parallel | For larger portfolios, select specific sites or extract data with GraphQL. |
| Rules on Free | 0 | Rules are available only for proxied sites; with zero rules, injection applies to all subdomains. |
| Rules on Pro | 5 | Rules are available only for proxied sites. |
| Rules on Business | 20 | Rules are available only for proxied sites. |
| Rules on Enterprise | 100 | Rules are available only for proxied sites. |
Implementation workflow for a production integration
- Define the job. Decide whether you are changing site configuration or reading analytics data.
- Confirm account context. Record the account ID, site or hostname, and the Cloudflare plan that controls applicable limits.
- Create a least-privilege token. For GraphQL, use the documented Account Analytics read permission and restrict resources or client IPs where practical. For site-info operations, use the permissions shown by the current endpoint reference.
- Prototype against the live schema. Validate the exact path or GraphQL fields with a non-production account or read-only request.
- Store secrets safely. Keep tokens out of source control, browser code, logs, and error messages.
- Validate responses. Check HTTP status, the API success indicator or GraphQL errors, and expected identifiers before updating local state.
- Add retries carefully. Retry transient network and rate-limit failures with exponential backoff; do not blindly retry create or delete operations unless you have an idempotency strategy supported by the endpoint.
- Monitor collection separately. A successful site record does not prove that the Beacon is installed or receiving data. Check the rendered page and allow several minutes for first data.
Troubleshooting common failures
The request returns an authentication or authorization error
Confirm the token is sent as Authorization: Bearer, has not expired, and belongs to the intended account. For GraphQL, verify Account Analytics read permission and resource restrictions. For RUM site-info calls, compare the operation’s required scope with the current API reference instead of reusing GraphQL permissions.
Free tools Windows power users keep installed
One-click scans. No signup required.
The GraphQL response contains errors despite HTTP 200
Inspect the response’s GraphQL error collection and correct the query, variables, dataset, or field names. When multiple datasets are requested, one failing dataset causes the overall request to fail.
Rank #4
No Web Analytics data appears
For a non-proxied site, confirm the snippet is before </body> in the deployed HTML. For a proxied site, check that automatic setup is enabled and that Cache-Control: public, no-transform is not preventing payload modification. For Pages, confirm a deployment occurred after enabling Metrics. Allow a few minutes, then inspect browser and network errors.
Only some hostnames collect data
Review proxied-site rules and subdomain behavior. On plans with zero rules, Cloudflare documents injection on all subdomains; plans with rules let you control matching behavior within the plan’s stated rule count.
Dashboard aggregation does not show the whole portfolio
The aggregate dashboard view is limited to 1,000 websites in parallel. Select subsets of sites or query the relevant datasets through GraphQL for a larger portfolio.
Recommended Free Tools
Or skip the browser setup
For automated page images or PDFs, ScreenshotNeo provides a single request instead of maintaining a browser and consent-banner scripts. It removes cookie and consent banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response identifies the page verdict and billing status. Its MCP server gives AI agents—including Claude, Cursor, and other MCP clients—tools for screenshots, page information, and PDFs.
Use the API documentation at https://screenshotneo.com/docs/ for all options. A basic call is:
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
There is a free allowance of 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.
FAQ
Is the Cloudflare GraphQL Analytics API the same as Web Analytics?
No. GraphQL queries aggregated Cloudflare network and product datasets; the Web Analytics site-info family manages RUM site resources.
Can GraphQL data be used to calculate my Cloudflare bill?
No. Cloudflare says its GraphQL measurements include overall consumption that differs from billable traffic.
How quickly does a newly enabled site show data?
Cloudflare’s setup guidance says data may take a few minutes to appear after the snippet or automatic setup is active.
Frequently Asked Questions
Is the Cloudflare GraphQL Analytics API the same as Web Analytics?
No. GraphQL queries aggregated Cloudflare network and product datasets; the Web Analytics site-info family manages RUM site resources.
Can GraphQL data be used to calculate my Cloudflare bill?
No. Cloudflare says its GraphQL measurements include overall consumption that differs from billable traffic.
How quickly does a newly enabled site show data?
Cloudflare’s setup guidance says data may take a few minutes to appear after the snippet or automatic setup is active.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

