> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Zone Statistics

> Statistics of DNS zone in common and by record types.

To get summary statistics for all zones use `all` instead of zone name in path.

Note: Consumption statistics is updated in near real-time as a standard practice.
However, the frequency of updates can vary, but they are typically available within a 30 minutes period.
Exceptions, such as maintenance periods, may delay data beyond 30 minutes until servers resume and backfill missing statistics.



## OpenAPI

````yaml /api-reference/services_docs_mintlify/dns_api.yaml get /dns/v2/zones/{name}/statistics
openapi: 3.1.0
info:
  title: Gcore OpenAPI – DNS API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: 1282e760bff2
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Analyze
  - name: Clients
  - name: DNSSEC
  - name: Locations
  - name: Lookup
  - name: Metrics
  - name: NetworkMappings
  - name: Pickers
  - name: RRsets
  - name: Zones
paths:
  /dns/v2/zones/{name}/statistics:
    get:
      tags:
        - Zones
      summary: Get Zone Statistics
      description: >-
        Statistics of DNS zone in common and by record types.


        To get summary statistics for all zones use `all` instead of zone name
        in path.


        Note: Consumption statistics is updated in near real-time as a standard
        practice.

        However, the frequency of updates can vary, but they are typically
        available within a 30 minutes period.

        Exceptions, such as maintenance periods, may delay data beyond 30
        minutes until servers resume and backfill missing statistics.
      operationId: ZoneStatistics
      parameters:
        - name: name
          in: path
          description: |-
            Zone name.

            Use `all` to get statistics for all zones.
          required: true
          schema:
            type: string
        - name: from
          in: query
          description: |-
            Beginning of the requested time period (Unix Timestamp, UTC.)

            In a query string: &from=1709068637
          schema:
            type: integer
            format: int64
        - name: to
          in: query
          description: |-
            End of the requested time period (Unix Timestamp, UTC.)

            In a query string: &to=1709673437
          schema:
            type: integer
            format: int64
        - name: record_type
          in: query
          description: |-
            DNS record type.

            Possible values:

             - A
            - AAAA
            - NS
            - CNAME
            - MX
            - TXT
            - SVCB
            - HTTPS
          schema:
            type: string
        - name: granularity
          in: query
          description: >-
            Granularity parameter string is a sequence

            of decimal numbers, each with optional fraction and a unit suffix,
            such as "300ms", "1.5h" or "2h45m".


            Valid time units are "s", "m", "h".
          schema:
            type: string
      responses:
        '200':
          description: StatisticsZoneResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatisticsZoneResponse'
        '400':
          description: Error message response
          headers:
            error:
              schema:
                type: string
          content: {}
components:
  schemas:
    StatisticsZoneResponse:
      type: object
      properties:
        requests:
          type: object
          description: >-
            Requests amount (values) for particular zone fractionated by time
            intervals (keys).


            Example of response:

            `{

            "requests": {

            "1598608080000": 14716,

            "1598608140000": 51167,

            "1598608200000": 53432,

            "1598611020000": 51050,

            "1598611080000": 52611,

            "1598611140000": 46884

            }

            }`
        total:
          type: integer
          description: Total - sum of all values
          format: uint64
      description: StatisticsZoneResponse
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````