Cloudflare Analytics
Cloudflare Analytics exposes traffic, security, and performance metrics for your Cloudflare zones and account through the GraphQL Analytics API. This connector pulls HTTP traffic totals, firewall/WAF events, and Web Analytics (RUM) page-load metrics for a zone. It uses Cloudflare's GraphQL endpoint at api.cloudflare.com/client/v4/graphql; the legacy REST analytics endpoints are end-of-life and are not supported.
Power end-to-end data operations for your Cloudflare Analytics API with Nexla. Our bi-directional Cloudflare Analytics connector is purpose-built for Cloudflare Analytics, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Cloudflare Analytics or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Cloudflare Analytics workflows fast, secure, and fully governed.
Features
Type: API
- Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
- Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
- API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
- Request optimization with intelligent batching, retry, and caching to minimize API calls and costs
Prerequisites
Before creating a Cloudflare Analytics credential, you need a scoped Cloudflare API Token with read access to the Analytics API, along with the Zone ID and Account ID for the domain you want to report on. Cloudflare's GraphQL Analytics API authenticates with a Bearer token sent in the Authorization header on every request.
To create an API token with Analytics read access, follow these steps:
-
Sign in to the Cloudflare dashboard with an account that has permission to manage API tokens.
-
Navigate to My Profile > API Tokens for a user-owned token, or Manage Account > API Tokens for an account-owned token.
-
Click Create Token, then select Get started under Create Custom Token (you can also start from a template and adjust it).
-
Under Permissions, set the three dropdowns to grant read access to the Analytics API:
- For account-scoped datasets such as Web Analytics (RUM), select Account, then Account Analytics, then Read.
- For zone-scoped datasets such as HTTP requests and firewall events, add a permission row with Zone, then Analytics, then Read.
-
Under Zone Resources, select the specific zone (or all zones in an account) that the token should be able to read.
-
Optionally configure Client IP Address Filtering and a TTL (start/end validity dates) to further restrict the token, then click Continue to summary.
-
Review the configuration on the API Token Summary page, then click Create Token.
-
Copy the token value and store it securely. Cloudflare displays the token only once and it cannot be retrieved again after you leave the page.
To obtain the identifiers used by the connector:
-
Zone ID: Open the target domain in the Cloudflare dashboard and copy the 32-character Zone ID from the zone's Overview page (right-hand sidebar under API).
-
Account ID: On the same Overview page, copy the 32-character Account ID shown alongside the Zone ID. This is required for account-scoped datasets such as RUM page-load events.
If your API token is compromised, revoke it from the same API Tokens page in the Cloudflare dashboard and issue a new one. For complete details on token permissions and the Analytics API, see the Cloudflare Analytics API token documentation and the GraphQL Analytics API overview.
Authenticate
Credentials required
| Field | Required | Secret | Description |
|---|---|---|---|
| API Token | Yes | Yes | Scoped API Token from Cloudflare dashboard > My Profile > API Tokens (needs Zone > Analytics > Read). Sent as Authorization: Bearer <token>. |
| Zone ID | Yes | No | The 32-character Zone Identifier (zoneTag) for the domain, found on the zone's Overview page. Used by zone-scoped datasets (HTTP requests, firewall events). |
| Account ID | Yes | No | The 32-character Account Identifier, from the account Overview page. Required for account-scoped datasets like RUM pageload events. |
Create a credential in Nexla
-
After selecting the data source type, click the Add Credential tile to open the Add New Credential overlay.
-
Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.
-
Enter your Cloudflare API Token in the API Token field. Nexla sends this token as
Authorization: Bearer <token>on every request and validates it against Cloudflare's token verification endpoint. This value is stored securely and should be kept confidential. -
Enter the 32-character Zone ID for your domain in the Zone ID field. This identifies the zone for zone-scoped datasets such as HTTP requests and firewall events.
-
Enter the 32-character Account ID in the Account ID field. This is required for account-scoped datasets such as Web Analytics (RUM) page-load events.
-
Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source creation.
Use as a data source
To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Cloudflare Analytics connector tile, then select the credential that will be used to connect to Cloudflare, and click Next; or, create a new Cloudflare Analytics credential for use in this flow.
Endpoint templates
Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Cloudflare GraphQL Analytics datasets. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.
Each Cloudflare Analytics dataset requires a reporting-window filter. Provide the Since and Until values described in each template below; the GraphQL Analytics API rejects queries on these datasets without a date or datetime range.
Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.
Manual configuration
Cloudflare Analytics data sources can also be manually configured to query any valid Cloudflare GraphQL Analytics dataset, including datasets not covered by the pre-built templates, custom field selections, or additional filters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, request body, date/time macros, path to data, and request headers.
Cloudflare's Analytics API is a single GraphQL endpoint at https://api.cloudflare.com/client/v4/graphql. Queries are sent as POST requests with a JSON body containing your GraphQL query, and every dataset requires a date or datetime filter.
Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Cloudflare Analytics data source. Nexla will now begin ingesting data from the configured dataset and will organize any data that it finds into one or more Nexsets.