Cloudflare DNS Analytics API

Access DNS query analytics for a zone with aggregated and time-grouped metrics.

Operations 2

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /zones/{zone_id}/dns_analytics/report Get aggregated DNS query analytics for a zone · Cloudflare Get Dns Analytics Report #
Ask an LLM
“How many DNS queries did my zone get in total?”
“Which response codes and record types show up most in my DNS traffic?”
Tell an agent
Get the aggregated DNS analytics report for zone {zone_id}.
Summarize DNS query totals for {zone_id} from {since} to {until}.
GET /zones/{zone_id}/dns_analytics/report/bytime Get DNS analytics broken down over time · Cloudflare Get Dns Analytics by Time #
Ask an LLM
“How has my zone's DNS query volume changed hour by hour?”
“Can I group DNS analytics into time intervals?”
Tell an agent
Show DNS analytics for zone {zone_id} as a time series.
Chart DNS queries for {zone_id} from {since} to {until} in {time_delta} intervals.

Documentation

📖
Documentation
https://developers.cloudflare.com/api/
📖
GettingStarted
https://developers.cloudflare.com/fundamentals/api/get-started/
📖
Authentication
https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
📖
RateLimits
https://developers.cloudflare.com/fundamentals/api/reference/limits/
📖
Documentation
https://developers.cloudflare.com/api/operations/accounts-list-accounts
📖
APIReference
https://developers.cloudflare.com/api/resources/accounts/
📖
APIReference
https://developers.cloudflare.com/ssl/
📖
Documentation
https://developers.cloudflare.com/api/operations/ip-access-rules-for-a-user-list-ip-access-rules
📖
Documentation
https://developers.cloudflare.com/api/operations/user'-s-account-memberships-list-memberships
📖
Documentation
https://developers.cloudflare.com/api/operations/radar-get-search-global
📖
APIReference
https://developers.cloudflare.com/radar/
📖
GettingStarted
https://developers.cloudflare.com/radar/get-started/
📖
Documentation
https://developers.cloudflare.com/api/operations/user-user-details
📖
APIReference
https://developers.cloudflare.com/api/resources/user/
📖
Documentation
https://developers.cloudflare.com/api/operations/zones-get
📖
APIReference
https://developers.cloudflare.com/api/resources/zones/
📖
Documentation
https://developers.cloudflare.com/dns/
📖
APIReference
https://developers.cloudflare.com/api/resources/dns/
📖
Documentation
https://developers.cloudflare.com/workers/
📖
APIReference
https://developers.cloudflare.com/api/resources/workers/
📖
GettingStarted
https://developers.cloudflare.com/workers/get-started/
📖
Documentation
https://developers.cloudflare.com/workers-ai/
📖
GettingStarted
https://developers.cloudflare.com/workers-ai/get-started/rest-api/
📖
APIReference
https://developers.cloudflare.com/workers-ai/configuration/open-ai-compatibility/
📖
APIReference
https://developers.cloudflare.com/workers-ai/models/
📖
Documentation
https://developers.cloudflare.com/ai-gateway/
📖
APIReference
https://developers.cloudflare.com/ai-gateway/usage/providers/
📖
GettingStarted
https://developers.cloudflare.com/ai-gateway/get-started/
📖
Documentation
https://developers.cloudflare.com/r2/
📖
APIReference
https://developers.cloudflare.com/r2/api/s3/api/
📖
GettingStarted
https://developers.cloudflare.com/r2/get-started/
📖
Documentation
https://developers.cloudflare.com/d1/
📖
APIReference
https://developers.cloudflare.com/api/resources/d1/
📖
GettingStarted
https://developers.cloudflare.com/d1/get-started/
📖
Documentation
https://developers.cloudflare.com/kv/
📖
APIReference
https://developers.cloudflare.com/api/resources/kv/
📖
GettingStarted
https://developers.cloudflare.com/kv/get-started/
📖
Documentation
https://developers.cloudflare.com/queues/
📖
APIReference
https://developers.cloudflare.com/api/resources/queues/
📖
GettingStarted
https://developers.cloudflare.com/queues/get-started/
📖
Documentation
https://developers.cloudflare.com/durable-objects/
📖
GettingStarted
https://developers.cloudflare.com/durable-objects/get-started/
📖
APIReference
https://developers.cloudflare.com/durable-objects/api/
📖
Documentation
https://developers.cloudflare.com/vectorize/
📖
GettingStarted
https://developers.cloudflare.com/vectorize/get-started/intro/
📖
APIReference
https://developers.cloudflare.com/vectorize/reference/client-api/
📖
Documentation
https://developers.cloudflare.com/pages/
📖
APIReference
https://developers.cloudflare.com/pages/configuration/api/
📖
GettingStarted
https://developers.cloudflare.com/pages/get-started/
📖
Documentation
https://developers.cloudflare.com/stream/
📖
GettingStarted
https://developers.cloudflare.com/stream/get-started/
📖
APIReference
https://developers.cloudflare.com/api/resources/stream/
📖
Documentation
https://developers.cloudflare.com/images/
📖
GettingStarted
https://developers.cloudflare.com/images/get-started/
📖
APIReference
https://developers.cloudflare.com/api/resources/images/
📖
Documentation
https://developers.cloudflare.com/turnstile/
📖
GettingStarted
https://developers.cloudflare.com/turnstile/get-started/
📖
APIReference
https://developers.cloudflare.com/api/resources/turnstile/
📖
Documentation
https://developers.cloudflare.com/logs/
📖
APIReference
https://developers.cloudflare.com/api/resources/logpush/
📖
GettingStarted
https://developers.cloudflare.com/logs/get-started/
📖
Documentation
https://developers.cloudflare.com/hyperdrive/
📖
APIReference
https://developers.cloudflare.com/api/resources/hyperdrive/
📖
GettingStarted
https://developers.cloudflare.com/hyperdrive/get-started/

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cloudflare:cloudflare-dns-analytics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cloudflare-dns-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloudflare DNS Analytics API
  version: '1.0'
  description: 'Operations tagged DNS Analytics across 2 of this provider''s published API definitions: cloudflare-dns-openapi.yml, cloudflare-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.cloudflare.com/client/v4
  description: Cloudflare API v4 Production Server
tags:
- name: DNS Analytics
  description: Access DNS query analytics for a zone with aggregated and time-grouped metrics.
paths:
  /zones/{zone_id}/dns_analytics/report:
    get:
      operationId: getDnsAnalyticsReport
      summary: Cloudflare Get Dns Analytics Report
      description: Retrieve aggregated DNS analytics metrics for the zone including query counts, response codes, and record types.
      tags:
      - DNS Analytics
      parameters:
      - $ref: '#/components/parameters/ZoneId'
      - name: since
        in: query
        description: Start date of the analytics query in ISO 8601 format.
        schema:
          type: string
          format: date-time
        example: '2026-01-15T10:30:00Z'
      - name: until
        in: query
        description: End date of the analytics query in ISO 8601 format.
        schema:
          type: string
          format: date-time
        example: '2026-01-15T10:30:00Z'
      responses:
        '200':
          description: Aggregated DNS analytics report.
        '401':
          description: Unauthorized.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      security:
      - bearerAuth: []
    servers:
    - url: https://api.cloudflare.com/client/v4
      description: Cloudflare API v4 Production Server
  /zones/{zone_id}/dns_analytics/report/bytime:
    get:
      operationId: getDnsAnalyticsByTime
      summary: Cloudflare Get Dns Analytics by Time
      description: Retrieve time-grouped DNS analytics metrics for the zone.
      tags:
      - DNS Analytics
      parameters:
      - $ref: '#/components/parameters/ZoneId'
      - name: since
        in: query
        description: Start date in ISO 8601 format.
        schema:
          type: string
          format: date-time
        example: '2026-01-15T10:30:00Z'
      - name: until
        in: query
        description: End date in ISO 8601 format.
        schema:
          type: string
          format: date-time
        example: '2026-01-15T10:30:00Z'
      - name: time_delta
        in: query
        description: Time interval for grouping results.
        schema:
          type: string
          enum:
          - all
          - auto
          - year
          - quarter
          - month
          - week
          - day
          - dekaminute
          - hour
          - minute
        example: all
      responses:
        '200':
          description: Time-grouped DNS analytics report.
        '401':
          description: Unauthorized.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      security:
      - bearerAuth: []
    servers:
    - url: https://api.cloudflare.com/client/v4
      description: Cloudflare API v4 Production Server
components:
  parameters:
    ZoneId:
      name: zone_id
      in: path
      required: true
      description: The unique identifier of the zone.
      schema:
        type: string
  schemas:
    dns-analytics_until:
      description: End date and time of requesting data period in ISO 8601 format.
      type: string
      format: date-time
      example: '2023-11-11T13:00:00Z'
    dns-analytics_api-response-common:
      type: object
      properties:
        errors:
          $ref: '#/components/schemas/dns-analytics_messages'
        messages:
          $ref: '#/components/schemas/dns-analytics_messages'
        success:
          description: Whether the API call was successful.
          type: boolean
          example: true
          enum:
          - true
      required:
      - success
      - errors
      - messages
    dns-analytics_identifier:
      description: Identifier.
      type: string
      example: 023e105f4ecef8ad9ca31a8372d0c353
      maxLength: 32
      x-auditable: true
    dns-analytics_limit:
      description: Limit number of returned metrics.
      type: integer
      example: 100
      default: 100000
    dns-analytics_api-response-common-failure:
      type: object
      properties:
        errors:
          example:
          - code: 7003
            message: No route for the URI
          allOf:
          - $ref: '#/components/schemas/dns-analytics_messages'
          minLength: 1
        messages:
          example: []
          allOf:
          - $ref: '#/components/schemas/dns-analytics_messages'
        result:
          type:
          - object
          - 'null'
          enum:
          - null
        success:
          description: Whether the API call was successful.
          type: boolean
          example: false
          enum:
          - false
      required:
      - success
      - errors
      - messages
      - result
    dns-analytics_result:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/dns-analytics_data'
        data_lag:
          description: Number of seconds between current time and last processed event, in another words how many seconds of data could be missing.
          type: number
          example: 60
          minimum: 0
        max:
          description: Maximum results for each metric (object mapping metric names to values). Currently always an empty object.
          type: object
        min:
          description: Minimum results for each metric (object mapping metric names to values). Currently always an empty object.
          type: object
        query:
          $ref: '#/components/schemas/dns-analytics_query'
        rows:
          description: Total number of rows in the result.
          type: number
          example: 100
          minimum: 0
        totals:
          description: Total results for metrics across all data (object mapping metric names to values).
          type: object
      required:
      - rows
      - totals
      - min
      - max
      - data_lag
      - query
      - data
    dns-analytics_query:
      type: object
      properties:
        dimensions:
          description: Array of dimension names.
          type: array
          items:
            description: Dimension name.
            example: responseCode
            type: string
          example:
          - responseCode
          - queryName
        filters:
          $ref: '#/components/schemas/dns-analytics_filters'
        limit:
          $ref: '#/components/schemas/dns-analytics_limit'
        metrics:
          description: Array of metric names.
          type: array
          items:
            description: Metric name.
            example: queries
            type: string
          example:
          - queryCount
          - responseTimeAvg
        since:
          $ref: '#/components/schemas/dns-analytics_since'
        sort:
          description: Array of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).
          type: array
          items:
            description: Dimension name (may be prefixed by - (descending) or + (ascending).
            example: +responseCode
            type: string
          example:
          - +responseCode
          - -queryName
        until:
          $ref: '#/components/schemas/dns-analytics_until'
      required:
      - dimensions
      - metrics
      - since
      - until
      - limit
    dns-analytics_dimensions:
      description: A comma-separated list of dimensions to group results by.
      type: string
      example: queryType
    dns-analytics_filters:
      description: Segmentation filter in 'attribute operator value' format.
      type: string
      example: responseCode==NOERROR,queryType==A
    dns-analytics_api-response-single:
      type: object
      allOf:
      - $ref: '#/components/schemas/dns-analytics_api-response-common'
    dns-analytics_data:
      description: Array with one row per combination of dimension values.
      type: array
      items:
        properties:
          dimensions:
            description: Array of dimension values, representing the combination of dimension values corresponding to this row.
            type: array
            items:
              description: Dimension value.
              example: NODATA
              type: string
        required:
        - dimensions
        type: object
    dns-analytics_sort:
      description: A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).
      type: string
      example: +responseCode,-queryName
    dns-analytics_metrics:
      description: A comma-separated list of metrics to query.
      type: string
      example: queryCount,uncachedCount
    dns-analytics_report_bytime:
      type: object
      allOf:
      - $ref: '#/components/schemas/dns-analytics_result'
      - properties:
          data:
            type: array
            items:
              properties:
                metrics:
                  description: Array with one item per requested metric. Each item is an array of values, broken down by time interval.
                  type: array
                  items:
                    description: Nominal metric values, broken down by time interval.
                    items:
                      description: Nominal metric value.
                      type: number
                    type: array
              required:
              - metrics
              type: object
          query:
            properties:
              time_delta:
                $ref: '#/components/schemas/dns-analytics_time_delta'
            required:
            - time_delta
            type: object
          time_intervals:
            description: 'Array of time intervals in the response data. Each interval is represented as an array containing two values: the start time, and the end time.

              '
            type: array
            items:
              description: Array with exactly two items, representing the start and end time (respectively) of this time interval.
              items:
                description: Time value.
                example: '2023-11-11T12:00:00Z'
                format: date-time
                type: string
              type: array
        required:
        - time_intervals
        - query
        - data
        type: object
    dns-analytics_since:
      description: Start date and time of requesting data period in ISO 8601 format.
      type: string
      format: date-time
      example: '2023-11-11T12:00:00Z'
    dns-analytics_messages:
      type: array
      items:
        properties:
          code:
            type: integer
            minimum: 1000
          documentation_url:
            type: string
          message:
            type: string
          source:
            type: object
            properties:
              pointer:
                type: string
        required:
        - code
        - message
        type: object
        uniqueItems: true
      example: []
    dns-analytics_report:
      type: object
      allOf:
      - $ref: '#/components/schemas/dns-analytics_result'
      - properties:
          data:
            type: array
            items:
              properties:
                metrics:
                  description: Array with one item per requested metric. Each item is a single value.
                  type: array
                  items:
                    description: Nominal metric value.
                    type: number
              required:
              - metrics
              type: object
        required:
        - data
        type: object
    dns-analytics_time_delta:
      description: Unit of time to group data by.
      type: string
      example: hour
      enum:
      - all
      - auto
      - year
      - quarter
      - month
      - week
      - day
      - hour
      - dekaminute
      - minute
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token authentication. Generate a token from the Cloudflare dashboard with appropriate permissions.
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Auth-Key
      description: Global API key paired with X-Auth-Email header for authentication.
    api_email:
      in: header
      name: X-Auth-Email
      type: apiKey
    api_key:
      in: header
      name: X-Auth-Key
      type: apiKey
    api_token:
      scheme: bearer
      type: http
    user_service_key:
      in: header
      name: X-Auth-User-Service-Key
      type: apiKey
x-refined-from:
- cloudflare-dns-openapi.yml
- cloudflare-openapi.json