> ## 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_documented/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: '2026-05-15T06:37:28.230198+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Analyze
    x-displayName: Analyze
  - name: DNS Locations
    x-displayName: DNS Locations
  - name: Lookup
    x-displayName: Lookup
  - name: Metrics
    x-displayName: Metrics
  - name: NetworkMappings
    x-displayName: NetworkMappings
  - name: Pickers
    x-displayName: Pickers
  - name: DNS Clients
    x-displayName: DNS Clients
  - name: Zones
    x-displayName: Zones
  - name: DNSSEC
    x-displayName: DNSSEC
  - name: RRsets
    x-displayName: RRsets
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: {}
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            response = client.dns.zones.get_statistics(
                name="name",
            )
            print(response.requests)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/dns\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.DNS.Zones.GetStatistics(\n\t\tcontext.TODO(),\n\t\t\"name\",\n\t\tdns.ZoneGetStatisticsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Requests)\n}\n"
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

````