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

# Get EndUser statistics

> Get summarized statistics for a given EndUser



## OpenAPI

````yaml https://app.herondata.io/swagger get /api/end_users/statistics
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/end_users/statistics:
    get:
      tags:
        - EndUserCalculations
      summary: Get EndUser statistics
      description: Get summarized statistics for a given EndUser
      parameters:
        - description: >-
            end_user_id for statistics; either end_user_id or end_user_heron_id
            is required
          in: query
          name: end_user_id
          required: false
          schema:
            default: null
            example: your_end_user_id
            nullable: true
            type: string
        - description: >-
            Heron-generated id for end user; either end_user_id or
            end_user_heron_id is required
          in: query
          name: end_user_heron_id
          required: false
          schema:
            default: null
            example: eus_Lj7uJkvAqxQCcLVMbqbwoe
            nullable: true
            type: string
        - description: ISO 4217 currency code to convert to
          in: query
          name: to_currency
          required: false
          schema:
            enum:
              - GBP
              - USD
              - EUR
              - CAD
              - AUD
              - null
            example: USD
            nullable: true
            type: string
        - description: >-
            Filter for transactions with timestamp after the input value (as
            date)
          in: query
          name: from_date
          required: false
          schema:
            default: null
            example: '2026-07-04'
            format: date
            nullable: true
            type: string
        - description: >-
            Filter for transactions with timestamp before the input value (as
            date)
          in: query
          name: to_date
          required: false
          schema:
            default: null
            example: '2026-07-03'
            format: date
            nullable: true
            type: string
        - description: Aggregate results over time, e.g., by week or by quarter
          in: query
          name: date_granularity
          required: false
          schema:
            default: month
            enum:
              - day
              - week
              - month
              - quarter
              - year
            example: month
            type: string
        - description: Pivot results by merchant or by category
          in: query
          name: group_by
          required: false
          schema:
            default: category
            enum:
              - category
              - merchant
            example: category
            type: string
        - description: Filter by specific categories
          explode: true
          in: query
          name: category_heron_ids
          required: false
          schema:
            default: []
            example:
              - ctg_JEMQykdaBBstFJhac5QiSK
              - ctg_nG6n2uLcAHUVKzv99DwVq5
            items:
              type: string
            type: array
          style: form
        - description: Filter by specific merchants
          explode: true
          in: query
          name: merchant_heron_ids
          required: false
          schema:
            default: []
            example:
              - mrc_5FQkL7DXcjwoExSVRy8f34
              - mrc_3pp7m4D89RJUStJM6nPUtN
            items:
              type: string
            type: array
          style: form
        - description: Filter by specific account reference IDs
          explode: true
          in: query
          name: account_ids
          required: false
          schema:
            default: []
            example:
              - '1234'
              - '5678'
            items:
              type: string
            type: array
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  statistics:
                    items:
                      $ref: '#/components/schemas/EndUserStatsOutputSchema'
                    type: array
                type: object
          description: OK
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EndUserStatsOutputSchema:
      properties:
        currency:
          description: ISO 4217 currency code
          example: USD
          nullable: true
          type: string
        dt:
          description: Date, impacted by input date granularity
          example: '2026-07-04'
          type: string
        heron_id:
          description: >-
            Heron ID of either merchant or category, depending on what was
            specified in group_by
          example: mrc_krEurmcbAkF4wunH4zbjLf
          type: string
        label:
          description: >-
            Label of either merchant or category, depending on what was
            specified in group_by
          example: Revenue
          type: string
        metrics:
          $ref: '#/components/schemas/EndUserStatsOutputMetrics'
      type: object
    EndUserStatsOutputMetrics:
      properties:
        inflow:
          allOf:
            - $ref: '#/components/schemas/EndUserStatsOutputMetricsInstance'
          description: Metrics only counting inflows
        net:
          allOf:
            - $ref: '#/components/schemas/EndUserStatsOutputMetricsInstance'
          description: Net metrics
        outflow:
          allOf:
            - $ref: '#/components/schemas/EndUserStatsOutputMetricsInstance'
          description: Metrics only counting outflows
      type: object
    EndUserStatsOutputMetricsInstance:
      properties:
        amount:
          description: Aggregate amount of transactions
          example: 42.42
          type: number
        avg_amount:
          description: Average value of transactions
          example: 1.01
          type: number
        'n':
          description: Number of transactions
          example: 42
          type: integer
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````