air_get_records: Get records from an Airtable table

View source: R/airtable.R

air_get_recordsR Documentation

Get records from an Airtable table

Description

Downloads an Airtable table into a list of records

Usage

air_get_records(
  table,
  base_id,
  api_key = Sys.getenv("AIRTABLE_KEY"),
  query = list()
)

Arguments

table

name of the table (string)

base_id

id of the Airtable base where the table is located

api_key

API key for Airtable. By default it looks at the AIRTABLE_KEY environment variable.

query

additional parameters for the airtable query like for example fields, view, pageSize, maxRecords, sort, filterByFormula, cellFormat, timeZone, userLocale, etc... See the airtable documentation for more details.

Details

Airtable API returns one page of records at a time. Each page will contain pageSize (a query parameter) records, which is 100 by default. Internally, this function will automatically download all records until maxRecords has been reached.

Value

a list with a results field containing all records

See Also

air_records_to_tibble

Examples

## Not run: 
# Get all records for the table boats
air_get_records(table = "boats", base_id = "appjEVaN8kBNXAWak")

# Get records only in a specified view
air_get_records("boats", "appjEVaN8kBNXAWak",
  query = list(view = "Boats with wrong registration")
)

# Get only the first 5 records
air_get_records("boats", "appjEVaN8kBNXAWak", query = list(maxRecords = 5))

## End(Not run)


WorldFishCenter/peskas.timor.data.pipeline documentation built on April 14, 2025, 1:47 p.m.