% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fetch.R
\name{af_fetch}
\alias{af_fetch}
\title{Fetch a single page from an API}
\usage{
af_fetch(api, name, limit = Inf, offset = 0L, query = list(), verbosity = 0L)
}
\arguments{
\item{api}{An \code{apifetch_api} object (see \code{\link[=af_api]{af_api()}}).}

\item{name}{The token name to authenticate with (looked up via the API's
\code{service}).}

\item{limit}{Maximum number of records to request. Default \code{Inf} (no limit).
Non-positive or infinite values omit the parameter.}

\item{offset}{Starting record. Default \code{0} (omitted).}

\item{query}{A named list of additional query-string filters. Default empty.}

\item{verbosity}{\code{0} (silent, default), \code{1} (progress messages), or \code{2}
(progress plus full HTTP request/response details).}
}
\value{
A tibble with the parsed response.
}
\description{
Performs one authenticated request against an \code{\link[=af_api]{af_api()}} profile, applying its
pagination strategy, and returns the parsed body as a tibble. HTTP errors and
connection failures are translated into friendly \code{cli} messages.
}
\examples{
\dontrun{
api <- af_api("https://www.bigdata.pe.gov.br/api/buscar",
              service = "BigDataPE", auth = af_auth_raw(),
              pagination = af_paginate_offset("header"))
af_store_token("dengue", "token", service = "BigDataPE")
af_fetch(api, "dengue", limit = 50)
}
}
