Learn R Programming

pixr (version 0.1.0)

get_pix_keys: Get PIX Keys Stock by Participant

Description

Retrieves the stock of PIX keys registered in the Directory of Transactional Account Identifiers (DICT) at the end of each month, broken down by PIX participant and key type.

Usage

get_pix_keys(
  date,
  filter = NULL,
  columns = NULL,
  top = NULL,
  skip = NULL,
  orderby = NULL,
  verbose = TRUE
)

Value

A tibble::tibble with PIX keys data.

Arguments

date

Character string in "YYYY-MM-DD" format specifying the reference date. This parameter is required. The API returns data for the last day of the specified month.

filter

OData filter expression as a character string. Examples:

  • "NaturezaUsuario eq 'PF'" - Filter by user type (PF or PJ)

  • "TipoChave eq 'CPF'" - Filter by key type

  • "Nome eq 'BANCO DO BRASIL S.A.'" - Filter by institution name

columns

Character vector of columns to return. If NULL, returns all columns. See "Available Columns" section.

top

Integer; maximum number of records to return.

skip

Integer; number of records to skip (for pagination).

orderby

Character string specifying the column to sort by. Use "Column" for ascending or "Column desc" for descending order.

verbose

Logical; if TRUE (default), prints progress messages.

Available Columns

Data

Reference date (last day of month, YYYY-MM-DD format)

ISPB

8-digit code identifying the financial institution

Nome

Name of the PIX participant (financial institution)

NaturezaUsuario

User type: PF (Individual) or PJ (Legal Entity)

TipoChave

Key type: CPF, CNPJ, Celular, e-mail, or Aleatória

qtdChaves

Number of registered keys

Details

The BCB PIX API requires a date parameter specifying which date's data to retrieve. The data shows the number of PIX keys registered by each financial institution (participant).

Note: The API returns data for the last day of the month containing the specified date. For example, date = "2025-12-01" returns data for 2025-12-31.

Examples

Run this code
# It usually takes much longer than 5 seconds.
# Get all PIX keys data for December 2025
keys <- get_pix_keys(date = "2025-12-01")

# Filter by key type and order by quantity
cpf_keys <- get_pix_keys(
  date = "2025-12-01",
  filter = "TipoChave eq 'CPF'",
  orderby = "qtdChaves desc",
  top = 100
)

# Filter by institution
bb_keys <- get_pix_keys(
  date = "2025-12-01",
  filter = "Nome eq 'BANCO DO BRASIL S.A.'"
)

Run the code above in your browser using DataLab