apifetch was extracted from the BigDataPE
package, which wraps the Big Data PE platform — a
public-data REST API run by the Government of the State of Pernambuco,
Brazil. This vignette shows how that service maps onto a single
apifetch profile, and is the canonical worked example of
configuring the package for a real API.
The Big Data PE API has two conventions that differ from the
apifetch defaults:
Authorization header (no Bearer prefix) —
use af_auth_raw().limit/offset as HTTP headers,
not query parameters — use
af_paginate_offset("header").It also returns a status column named "Mensagem" that we
drop when combining chunks (drop_cols = "Mensagem"), and it
is only reachable from the PE Conectado network or VPN,
which we surface via connect_hint.
Function and parameter names are English (R convention), but the
API’s response column names and some values are Portuguese
(e.g. nu_notificacao, "BOA VIAGEM"). That is
intentional — they come straight from the upstream service.