The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
The pixr package provides a tidyverse-style interface to the Brazilian Central Bank (BCB) PIX Open Data API. PIX is Brazil’s instant payment system, launched in November 2020, which has become the country’s primary payment method with over 150 million active users.
This package allows you to retrieve:
You can install pixr from GitHub:
Load the package:
Each endpoint requires a specific date parameter:
| Endpoint | Parameter | Format | R Function |
|---|---|---|---|
| ChavesPix | date |
YYYY-MM-DD | get_pix_keys() |
| TransacoesPixPorMunicipio | database |
YYYYMM | get_pix_transactions_by_municipality() |
| EstatisticasTransacoesPix | database |
YYYYMM | get_pix_transaction_stats() |
| EstatisticasFraudesPix | database |
YYYYMM | get_pix_fraud_stats() |
PIX keys are identifiers used to simplify instant payments. Users can register up to 5 keys (individuals) or 20 keys (companies) per account. Key types include:
# Get all PIX keys data for December 2025
# Note: date uses YYYY-MM-DD format
keys <- get_pix_keys(date = "2025-12-01")
# Filter by key type
cpf_keys <- get_pix_keys(
date = "2025-12-01",
filter = "TipoChave eq 'CPF'",
orderby = "qtdChaves desc",
top = 100
)
# Get summary by institution
get_pix_keys_summary(date = "2025-12-01", n_top = 20)# Get transactions for December 2025
# Note: database uses YYYYMM format
muni <- get_pix_transactions_by_municipality(database = "202512")
# Filter by state using OData filter
maranhao <- get_pix_transactions_by_municipality(
database = "202512",
filter = "Estado eq 'MARANHÃO'",
orderby = "Municipio desc",
top = 10
)
# Aggregate by state
state_summary <- get_pix_transactions_by_state(database = "202512")
# Aggregate by region
region_summary <- get_pix_transactions_by_region(database = "202512")# Get detailed transaction statistics for September 2025
stats <- get_pix_transaction_stats(database = "202509")
# Filter by transaction nature (P2P, P2B, etc.)
p2p <- get_pix_transaction_stats(
database = "202509",
filter = "NATUREZA eq 'P2P'"
)
# Get summary by transaction nature
get_pix_summary(database = "202509", group_by = "NATUREZA")
# Get summary by region
get_pix_summary(database = "202509", group_by = "PAG_REGIAO")
# Get data for multiple months
q3_data <- get_pix_transaction_stats_multi(
databases = c("202507", "202508", "202509")
)All functions support OData query parameters for filtering and ordering:
# Filter by state
get_pix_transactions_by_municipality(
database = "202512",
filter = "Estado eq 'SÃO PAULO'"
)
# Multiple filters with 'and'
get_pix_transaction_stats(
database = "202509",
filter = "NATUREZA eq 'P2P' and PAG_REGIAO eq 'SUDESTE'"
)
# Order by value descending
get_pix_transaction_stats(
database = "202509",
orderby = "VALOR desc",
top = 100
)| Goal | Filter |
|---|---|
| Filter by state | "Estado eq 'SÃO PAULO'" |
| Filter by region | "Sigla_Regiao eq 'NE'" |
| Filter by transaction type | "NATUREZA eq 'P2P'" |
| Filter by key type | "TipoChave eq 'CPF'" |
| Numeric comparison | "VALOR gt 10000" |
| Multiple conditions | "NATUREZA eq 'P2P' and PAG_REGIAO eq 'SUDESTE'" |
See the Working with OData Queries article for complete documentation.
All functions return tibbles that integrate seamlessly with the tidyverse:
library(dplyr)
library(ggplot2)
# Analyze transactions by region
get_pix_transactions_by_region(database = "202512") |>
mutate(
total_value_billions = (vl_pagador_pf + vl_pagador_pj) / 1e9
) |>
ggplot(aes(x = reorder(Regiao, total_value_billions), y = total_value_billions)) +
geom_col(fill = "#008060") +
coord_flip() +
labs(
title = "PIX Transaction Volume by Region",
x = "Region",
y = "Transaction Value (R$ Billions)"
) +
theme_minimal()The default timeout is 120 seconds. Change it for slow connections:
Use pix_url() to see the URL that would be called:
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.