> ## 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 Event Statistics

> Retrieve an domain's event statistics



## OpenAPI

````yaml /api-reference/services_documented/waap_api.yaml get /waap/v1/domains/{domain_id}/stats
openapi: 3.1.0
info:
  title: Gcore OpenAPI – WAAP 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-14T07:00:22.640261+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: WAAP Service
    x-displayName: WAAP Service
  - name: Domains
    x-displayName: Domains
  - name: Policies
    x-displayName: Policies
  - name: Analytics
    x-displayName: Analytics
  - name: Custom Page Sets
    x-displayName: Custom Page Sets
  - name: Custom Rules
    x-displayName: Custom Rules
  - name: Filter Templates
    x-displayName: Filter Templates
  - name: Firewall Rules
    x-displayName: Firewall Rules
  - name: Advanced Rules
    x-displayName: Advanced Rules
  - name: Tags
    x-displayName: Tags
  - name: Network Organizations
    x-displayName: Network Organizations
  - name: API Discovery
    x-displayName: API Discovery
  - name: IP Spotlight
    x-displayName: IP Spotlight
  - name: Security Insights
    x-displayName: Security Insights
  - name: IP Reputation
    x-displayName: IP Reputation
paths:
  /waap/v1/domains/{domain_id}/stats:
    get:
      tags:
        - Analytics
      summary: Get Event Statistics
      description: Retrieve an domain's event statistics
      operationId: get_event_statistics_v1_domains__domain_id__stats_get
      parameters:
        - name: domain_id
          in: path
          required: true
          schema:
            type: integer
            exclusiveMinimum: 0
            description: The domain ID
            title: Domain Id
          description: The domain ID
        - name: start
          in: query
          required: true
          schema:
            type: string
            description: >-
              Filter data items starting from a specified date in ISO 8601
              format
            example: '2024-04-13T00:00:00+01:00'
            examples:
              - '2024-04-13T00:00:00+01:00'
            title: Start
          description: Filter data items starting from a specified date in ISO 8601 format
        - name: end
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter data items up to a specified end date in ISO 8601 format.
              If not provided, defaults to the current date and time.
            examples:
              - '2024-04-14T12:00:00Z'
            title: End
          description: >-
            Filter data items up to a specified end date in ISO 8601 format. If
            not provided, defaults to the current date and time.
        - name: ip
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                  format: ipvanyaddress
              - type: 'null'
            description: A list of IPs to filter event statistics.
            examples:
              - 1.2.3.4
              - 5.6.7.8
            title: Ip
          description: A list of IPs to filter event statistics.
        - name: reference_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            description: A list of reference IDs to filter event statistics.
            examples:
              - 13a38422e6ddd05ff7ecee010286909b
              - 31a38422e6ddd05ff7ecee010286909a
            title: Reference Id
          description: A list of reference IDs to filter event statistics.
        - name: action
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/EventAction'
              - type: 'null'
            description: A list of action names to filter on.
            examples:
              - block
              - captcha
            title: Action
          description: A list of action names to filter on.
        - name: result
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/ComputedEventResult'
              - type: 'null'
            description: A list of results to filter event statistics.
            examples:
              - passed
              - allowed
            title: Result
          description: A list of results to filter event statistics.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventStatistics'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: http-bad-request
                title: Bad Request
                status: 400
                detail: 'Invalid domain name: '''''''''
          description: Bad Request
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              example:
                detail: Auth token is missing or invalid
        '403':
          description: Unauthenticated
          content:
            application/problem+json:
              example:
                detail: Permission denied
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: http-not-found
                title: Not Found
                status: 404
                detail: The resource is not found
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APICompositeError'
              example:
                type: request-validation-failed
                title: Request validation error.
                status: 422
                detail: One or more fields have validation errors.
                errors:
                  - loc:
                      - body
                      - name
                    detail: Input should be a valid string
                  - loc:
                      - body
                      - date
                    detail: Field required
                  - loc:
                      - query
                      - limit
                    detail: Field required
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: internal-server-error
                title: Internal server error.
                status: 500
                detail: >-
                  An unexpected condition was encountered which prevented the
                  server from fulfilling the request.
          description: Internal Server Error
      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
            )

            waap_event_statistics =
            client.waap.domains.statistics.get_events_aggregated(
                domain_id=1,
                start="2024-04-13T00:00:00+01:00",
            )

            print(waap_event_statistics.blocked)
        - 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/option\"\n\t\"github.com/G-Core/gcore-go/waap\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twaapEventStatistics, err := client.Waap.Domains.Statistics.GetEventsAggregated(\n\t\tcontext.TODO(),\n\t\t1,\n\t\twaap.DomainStatisticGetEventsAggregatedParams{\n\t\t\tStart: \"2024-04-13T00:00:00+01:00\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", waapEventStatistics.Blocked)\n}\n"
components:
  schemas:
    EventAction:
      type: string
      enum:
        - allow
        - block
        - captcha
        - handshake
      title: EventAction
      description: An action applied to a request according to the security configuration.
    ComputedEventResult:
      type: string
      enum:
        - passed
        - blocked
        - monitored
        - allowed
    EventStatistics:
      properties:
        count:
          $ref: '#/components/schemas/waap_Count'
        blocked:
          $ref: '#/components/schemas/Blocked'
      type: object
      required:
        - count
        - blocked
      title: EventStatistics
      description: A collection of event metrics over a time span
    APIError:
      properties:
        type:
          type: string
          title: Type
          description: A URI identifier that categorizes the type of error.
        title:
          type: string
          title: Title
          description: A brief, human-readable title for the error.
        status:
          type: integer
          title: Status
          description: The HTTP status code applicable to this error.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: A detailed human-readable explanation of the error.
      type: object
      required:
        - type
        - title
        - status
        - detail
      title: APIError
    APICompositeError:
      properties:
        type:
          type: string
          title: Type
          description: A URI identifier that categorizes the type of error.
        title:
          type: string
          title: Title
          description: A brief, human-readable title for the error.
        status:
          type: integer
          title: Status
          description: The HTTP status code applicable to this error.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: A detailed human-readable explanation of the error.
        errors:
          items:
            $ref: '#/components/schemas/APIFieldError'
          type: array
          title: Errors
          description: A list of detailed errors for individual fields.
      type: object
      required:
        - type
        - title
        - status
        - detail
        - errors
      title: APICompositeError
    waap_Count:
      properties:
        action:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Action
          description: >-
            A collection of event counts per action. The first item is the
            action's abbreviation/full action name, and the second item is the
            number of events
        country:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Country
          description: >-
            A collection of event counts per country of origin. The first item
            is the country's ISO 3166-1 alpha-2, and the second item is the
            number of events
        org:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Org
          description: >-
            A collection of event counts per organization that owns the event's
            client IP. The first item is the organization's name, and the second
            item is the number of events
        rule_name:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Rule Name
          description: >-
            A collection of event counts per rule that triggered the event. The
            first item is the rule's name, and the second item is the number of
            events
      type: object
      required:
        - action
        - country
        - org
        - rule_name
      title: Count
      description: A collection of total numbers of events per criteria
    Blocked:
      properties:
        action:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Action
          description: >-
            A collection of event counts per action. The first item is the
            action's abbreviation/full action name, and the second item is the
            number of events
        country:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Country
          description: >-
            A collection of event counts per country of origin. The first item
            is the country's ISO 3166-1 alpha-2, and the second item is the
            number of events
        org:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Org
          description: >-
            A collection of event counts per organization that owns the event's
            client IP. The first item is the organization's name, and the second
            item is the number of events
        rule_name:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          type: array
          title: Rule Name
          description: >-
            A collection of event counts per rule that triggered the event. The
            first item is the rule's name, and the second item is the number of
            events
      type: object
      required:
        - action
        - country
        - org
        - rule_name
      title: Blocked
      description: >-
        A collection of total numbers of events with blocked results per
        criteria
    APIFieldError:
      properties:
        loc:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: string
              type: array
            - {}
          title: Loc
          description: The location of the field or a character number causing the error.
        detail:
          type: string
          title: Detail
          description: A human-readable message describing the error.
      type: object
      required:
        - loc
        - detail
      title: APIFieldError
  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

````