fetch_all_records: Fetch All Records from Finna API

View source: R/fennica_all_records.R

fetch_all_recordsR Documentation

Fetch All Records from Finna API

Description

This function fetches records from the Finna API in chunks of 100,000, automatically paginating through the results until the maximum number of records is reached.

Usage

fetch_all_records(
  base_query = "*",
  base_filters = c("collection:\"FEN\""),
  sort = "main_date_str asc",
  limit_per_query = 1e+05,
  total_limit = Inf
)

Arguments

base_query

A string specifying the base query. Defaults to "*".

base_filters

A character vector of filters to apply to the query. Defaults to c('collection:"FEN"').

sort

A string defining the sort order of the results. Default is "main_date_str asc".

limit_per_query

An integer specifying the number of records to fetch per query. Defaults to 100000.

total_limit

An integer specifying the maximum number of records to fetch. Defaults to Inf.

Value

A tibble containing all fetched records.

Examples

## Not run: 
  results <- fetch_all_records(
    base_query = "*",
    base_filters = c('collection:"FEN"'),
    sort = "main_date_str asc",
    limit_per_query = 100000,
    total_limit = Inf
  )
  print(results)

## End(Not run)

finna documentation built on April 4, 2025, 2:33 a.m.