## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", eval = FALSE)

## -----------------------------------------------------------------------------
# library(apifetch)
# 
# bigdatape <- af_api(
#   endpoint     = "https://www.bigdata.pe.gov.br/api/buscar",
#   service      = "BigDataPE",
#   auth         = af_auth_raw(),
#   pagination   = af_paginate_offset("header"),
#   drop_cols    = "Mensagem",
#   connect_hint = "Ensure you are on the PE Conectado network or VPN."
# )

## -----------------------------------------------------------------------------
# af_store_token("dengue", "your-token-here", service = "BigDataPE")
# 
# # A single page of 50 records
# dengue <- af_fetch(bigdatape, "dengue", limit = 50)
# 
# # Everything, in chunks, with a progress message per chunk
# dengue_all <- af_fetch_all(
#   bigdatape, "dengue",
#   chunk_size = 50000,
#   verbosity = 1
# )

