---
title: Analytics Query
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Analytics Query

##### [Query analytics summary](https://developers.cloudflare.com/api/typescript/resources/analytics_query/methods/summary)

client.analyticsQuery.summary(stringdataset, AnalyticsQuerySummaryParams {account\_id, filters, from, 3 more } params, RequestOptionsoptions?): [AnalyticsQuerySummaryResponse](<https://developers.cloudflare.com/api/typescript/resources/analytics_query#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_summary_response%20%3E%20(schema)>) {currentTotal, previousTotal }

POST/accounts/{account\_id}/analytics/query/{dataset}/summary

##### [Query analytics timeseries](https://developers.cloudflare.com/api/typescript/resources/analytics_query/methods/timeseries)

client.analyticsQuery.timeseries(stringdataset, AnalyticsQueryTimeseriesParams {account\_id, filters, from, 4 more } params, RequestOptionsoptions?): [AnalyticsQueryTimeseriesResponse](<https://developers.cloudflare.com/api/typescript/resources/analytics_query#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_timeseries_response%20%3E%20(schema)>) {resolution, slots }

POST/accounts/{account\_id}/analytics/query/{dataset}/timeseries

##### [Query analytics top-N](https://developers.cloudflare.com/api/typescript/resources/analytics_query/methods/top_n)

client.analyticsQuery.topN(stringdataset, AnalyticsQueryTopNParams {account\_id, filters, from, 5 more } params, RequestOptionsoptions?): SinglePage< [AnalyticsQueryTopNResponse](<https://developers.cloudflare.com/api/typescript/resources/analytics_query#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_top_n_response%20%3E%20(schema)>)>

POST/accounts/{account\_id}/analytics/query/{dataset}/top-n

##### ModelsExpand Collapse

<details>

<summary>

AnalyticsQuerySummaryResponse {currentTotal, previousTotal }

</summary>

currentTotal: Array&lt;Record&lt;string, unknown&gt;&gt;

Aggregated stats for the requested time range.

<a href="#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_summary_response%20%3E%20(schema)%20%3E%20(property)%20currentTotal">Link to this property</a>

previousTotal: Array&lt;Record&lt;string, unknown&gt;&gt;

Aggregated stats for the equivalent preceding time range, for trend comparison.

<a href="#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_summary_response%20%3E%20(schema)%20%3E%20(property)%20previousTotal">Link to this property</a>

</details>

[Link to this property](<#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_summary_response%20%3E%20(schema)>)

<details>

<summary>

AnalyticsQueryTimeseriesResponse {resolution, slots }

</summary>

resolution: string

The resolution used for time bucketing.

<a href="#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_timeseries_response%20%3E%20(schema)%20%3E%20(property)%20resolution">Link to this property</a>

slots: Array&lt;Record&lt;string, unknown&gt;&gt;

Time-bucketed result rows. Each slot contains a <code>time_bucket</code> field plus the requested stats and group-by dimensions.

<a href="#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_timeseries_response%20%3E%20(schema)%20%3E%20(property)%20slots">Link to this property</a>

</details>

[Link to this property](<#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_timeseries_response%20%3E%20(schema)>)

AnalyticsQueryTopNResponse = Record<string, unknown>

Maps field names to values. Keys represent stat names and group-by column names. Values depend on the dataset (strings, numbers, booleans).

[Link to this property](<#(resource)%20analytics_query%20%3E%20(model)%20analytics_query_top_n_response%20%3E%20(schema)>)

#### Analytics QueryData Security

#### Analytics QueryData SecurityContent Findings

##### [Top integrations by content findings](https://developers.cloudflare.com/api/typescript/resources/analytics_query/subresources/data_security/subresources/content_findings/methods/top_n)

client.analyticsQuery.dataSecurity.contentFindings.topN(ContentFindingTopNParams {account\_id, filters, from, 2 more } params, RequestOptionsoptions?): SinglePage< [ContentFindingTopNResponse](<https://developers.cloudflare.com/api/typescript/resources/analytics_query#(resource)%20analytics_query.data_security.content_findings%20%3E%20(model)%20content_finding_top_n_response%20%3E%20(schema)>)>

POST/accounts/{account\_id}/analytics/query/data-security/content-findings/top-n

##### ModelsExpand Collapse

ContentFindingTopNResponse = Record<string, unknown>

Maps field names to values. Keys represent stat names and group-by column names. Values depend on the dataset (strings, numbers, booleans).

[Link to this property](<#(resource)%20analytics_query.data_security.content_findings%20%3E%20(model)%20content_finding_top_n_response%20%3E%20(schema)>)

#### Analytics QueryData SecurityFindings

##### [Data security findings summary](https://developers.cloudflare.com/api/typescript/resources/analytics_query/subresources/data_security/subresources/findings/methods/summary)

client.analyticsQuery.dataSecurity.findings.summary(FindingSummaryParams {account\_id, filters, from, to } params, RequestOptionsoptions?): [FindingSummaryResponse](<https://developers.cloudflare.com/api/typescript/resources/analytics_query#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_summary_response%20%3E%20(schema)>) {currentTotal, previousTotal }

POST/accounts/{account\_id}/analytics/query/data-security/findings/summary

##### [Data security findings timeseries](https://developers.cloudflare.com/api/typescript/resources/analytics_query/subresources/data_security/subresources/findings/methods/timeseries)

client.analyticsQuery.dataSecurity.findings.timeseries(FindingTimeseriesParams {account\_id, filters, from, to } params, RequestOptionsoptions?): [FindingTimeseriesResponse](<https://developers.cloudflare.com/api/typescript/resources/analytics_query#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_timeseries_response%20%3E%20(schema)>) {slots, resolution }

POST/accounts/{account\_id}/analytics/query/data-security/findings/timeseries

##### ModelsExpand Collapse

<details>

<summary>

FindingSummaryResponse {currentTotal, previousTotal }

</summary>

currentTotal: Array&lt;Record&lt;string, unknown&gt;&gt;

Aggregated stats for the requested time range.

<a href="#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_summary_response%20%3E%20(schema)%20%3E%20(property)%20currentTotal">Link to this property</a>

previousTotal: Array&lt;Record&lt;string, unknown&gt;&gt;

Aggregated stats for the equivalent preceding time range, for trend comparison.

<a href="#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_summary_response%20%3E%20(schema)%20%3E%20(property)%20previousTotal">Link to this property</a>

</details>

[Link to this property](<#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_summary_response%20%3E%20(schema)>)

<details>

<summary>

FindingTimeseriesResponse {slots, resolution }

Merged CASB and CDE findings timeseries result.

</summary>

slots: Array&lt;Record&lt;string, unknown&gt;&gt;

Contains time-bucketed result rows. Each slot includes a <code>timestamp</code> plus <code>content</code> and <code>posture</code> maps with <code>cloud</code> and <code>saas</code> keys.

<a href="#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_timeseries_response%20%3E%20(schema)%20%3E%20(property)%20slots">Link to this property</a>

resolution?: string| null

Always null for this endpoint.

<a href="#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_timeseries_response%20%3E%20(schema)%20%3E%20(property)%20resolution">Link to this property</a>

</details>

[Link to this property](<#(resource)%20analytics_query.data_security.findings%20%3E%20(model)%20finding_timeseries_response%20%3E%20(schema)>)