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

# Get Key Statistics

> Use this endpoint to fetch usage and risk statistics for a specific Pix key.

**Notes:**
- Returns both key-level statistics and owner-level statistics in a single response.
- Key statistics track data specific to the Pix key as an entity independent of its current owner.
- Owner statistics provide the same data as the person statistics endpoint for the key's current owner.
- This endpoint queries the provider directly and does not store data locally.
- Use this information for comprehensive risk assessment when processing payments to a Pix key.



## OpenAPI

````yaml /pt/openapi/v3-current/indirect-pix.yaml get /v1/dict/statistics/keys/{key}
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    API for Pix Indirect via BTG. It covers DICT keys and claims; MED infraction
    reports, fraud markers, refund requests, and funds recoveries; DICT
    statistics and reconciliation; Pix transfers, refunds, and schedules; static
    QR codes and QR code decoding; immediate and due-date collections; Pix
    Automático for the payer; transaction reports and TemposTransacoes
    statistics; and inbound and outbound webhook records.
  license:
    name: Lerian Studio General License
  title: Pix BTG API
  version: 1.14.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
paths:
  /v1/dict/statistics/keys/{key}:
    get:
      tags:
        - Statistics
      summary: Get Key Statistics
      description: >-
        Use this endpoint to fetch usage and risk statistics for a specific Pix
        key.


        **Notes:**

        - Returns both key-level statistics and owner-level statistics in a
        single response.

        - Key statistics track data specific to the Pix key as an entity
        independent of its current owner.

        - Owner statistics provide the same data as the person statistics
        endpoint for the key's current owner.

        - This endpoint queries the provider directly and does not store data
        locally.

        - Use this information for comprehensive risk assessment when processing
        payments to a Pix key.
      operationId: dict-get-key-statistics
      parameters:
        - description: >-
            Pix key value (CPF, CNPJ, email, phone, or EVP). Maximum 77
            characters.
          in: path
          name: key
          required: true
          schema:
            description: >-
              Pix key value (CPF, CNPJ, email, phone, or EVP). Maximum 77
              characters.
            maxLength: 77
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyStatisticsOutput'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Bad Request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Internal Server Error
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Error
components:
  schemas:
    KeyStatisticsOutput:
      additionalProperties: false
      properties:
        keyStatistics:
          $ref: '#/components/schemas/KeyStatistics'
          description: Statistics for the Pix key entity
        ownerStatistics:
          $ref: '#/components/schemas/PersonStatisticsOutput'
          description: Statistics for the key's current owner
      required:
        - keyStatistics
        - ownerStatistics
      type: object
    LegacyErrorBody:
      additionalProperties: false
      properties:
        code:
          type: string
        fields:
          additionalProperties:
            type: string
          type: object
        headers:
          additionalProperties:
            type: string
          type: object
        message:
          type: string
        paths:
          additionalProperties:
            type: string
          type: object
        queryParams:
          additionalProperties:
            type: string
          type: object
        raw:
          type: string
        title:
          type: string
      required:
        - code
        - title
        - message
      type: object
    KeyStatistics:
      additionalProperties: false
      properties:
        entries:
          $ref: '#/components/schemas/KeyEntriesStatistics'
          description: DICT entry statistics for this key
        fraudMarkers:
          $ref: '#/components/schemas/FraudMarkersStatistics'
          description: Fraud marker statistics for this key
        infractionReports:
          $ref: '#/components/schemas/InfractionReportsStatistics'
          description: Infraction report statistics for this key
        spi:
          $ref: '#/components/schemas/SpiStatistics'
          description: SPI settlement statistics for this key
      required:
        - infractionReports
        - entries
      type: object
    PersonStatisticsOutput:
      additionalProperties: false
      properties:
        entries:
          $ref: '#/components/schemas/PersonEntriesStatistics'
          description: Pix key entries statistics
        fraudMarkers:
          $ref: '#/components/schemas/FraudMarkersStatistics'
          description: Fraud marker statistics
        infractionReports:
          $ref: '#/components/schemas/InfractionReportsStatistics'
          description: Infraction report statistics
        spi:
          $ref: '#/components/schemas/SpiStatistics'
          description: SPI settlement statistics
      required:
        - fraudMarkers
        - infractionReports
        - entries
      type: object
    KeyEntriesStatistics:
      additionalProperties: false
      properties:
        distinctAccounts:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Number of distinct accounts with this key
        watermark:
          description: Datetime of last considered event for key entry statistics
          examples:
            - '2024-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    FraudMarkersStatistics:
      additionalProperties: false
      properties:
        applicationFrauds:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Counters for APPLICATION_FRAUD type markers
        distinctFraudReporters:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Number of distinct fraud reporters
        muleAccounts:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Counters for MULE_ACCOUNT type markers
        otherFrauds:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Counters for OTHER type fraud markers
        scammerAccounts:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Counters for SCAMMER_ACCOUNT type markers
        totalFraudTransactionAmount:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Total fraud transaction amount (BRL)
        unknownFrauds:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Counters for UNKNOWN type fraud markers (historical)
        watermark:
          description: Datetime of last considered event for fraud marker statistics
          examples:
            - '2024-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    InfractionReportsStatistics:
      additionalProperties: false
      properties:
        openReports:
          description: Number of currently open infraction reports
          examples:
            - 0
          format: int64
          type: integer
        openReportsDistinctReporters:
          description: Number of distinct participants with open reports
          examples:
            - 0
          format: int64
          type: integer
        rejectedReports:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Counters for rejected infraction reports
        watermark:
          description: Datetime of last considered event for infraction report statistics
          examples:
            - '2024-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    SpiStatistics:
      additionalProperties: false
      properties:
        settlements:
          $ref: '#/components/schemas/TimeBasedValues'
          description: Settlement transaction counters
        watermark:
          description: Datetime of last considered event for SPI statistics
          examples:
            - '2024-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    PersonEntriesStatistics:
      additionalProperties: false
      properties:
        registeredAccounts:
          description: Number of accounts with registered Pix keys
          examples:
            - 2
          format: int64
          type: integer
        watermark:
          description: Datetime of last considered event for entry statistics
          examples:
            - '2024-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    TimeBasedValues:
      additionalProperties: false
      properties:
        d90:
          description: Counter for the last 90 days
          examples:
            - '36'
          type: string
        m12:
          description: Counter for the last 12 months
          examples:
            - '51'
          type: string
        m60:
          description: Counter for the last 60 months (5 years)
          examples:
            - '44'
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.