Skip to contents

Tests the connection to all BCB PIX Open Data API endpoints. Each endpoint is tested with a single record request (top=1).

Usage

pix_ping()

Value

A tibble (invisibly) with columns:

endpoint

Name of the endpoint tested

status

Result: "OK" or error message

time_seconds

Time taken for the request in seconds

Examples

if (FALSE) # It usually takes much longer than 5 seconds.
# Test all endpoints
pix_ping()

# Capture results
results <- pix_ping()
#> 
#> ── Testing BCB PIX API Endpoints ──
#> 
#>  Testing ChavesPix...
#>  ChavesPix: "OK" (0.62s)
#>  Testing TransacoesPixPorMunicipio...
#>  TransacoesPixPorMunicipio: "OK" (2.93s)
#>  Testing EstatisticasTransacoesPix...
#>  EstatisticasTransacoesPix: "OK" (13.57s)
#>  Testing EstatisticasFraudesPix...
#>  EstatisticasFraudesPix: "OK" (11.09s)
#> ────────────────────────────────────────────────────────────────────────────────
#>  Total time: 28.22s
#>  Success: 4/4 endpoints
print(results)
#> # A tibble: 4 × 3
#>   endpoint                  status time_seconds
#>   <chr>                     <chr>         <dbl>
#> 1 ChavesPix                 OK            0.621
#> 2 TransacoesPixPorMunicipio OK            2.93 
#> 3 EstatisticasTransacoesPix OK           13.6  
#> 4 EstatisticasFraudesPix    OK           11.1  
 # \dontrun{}