A generic function to access LegCo APIs.

legco_api(db, query, n = 1000, count = FALSE, verbose = TRUE)

Arguments

db

the database you wish to access. "hansard" for the hansard database. "attn" for the attendance database. "bill" for the bills database. "schedule" for the schedule database. Or the path name for databases not listed here (i.e. the string between the domain name and data endpoints, e.g. "OpenData/HansardDB").

query

the query for retrieving data. Should include the data endpoint and parameters if any.

n

the number of record to fetch. Defaults to 1000.

count

logical: Whether to return only the total count of records that matches the parameter(s) instead of the result. Defaults to FALSE.

verbose

logical: Whether to display progress messages when fetching data? Defaults to TRUE.

Examples

# Fetch data from the "bills" endpoint of the hansard database
# \donttest{
x <- legco_api("hansard", "Bills")
#> Retrieving records...
#> Retrieved 1000 record(s). 4719 record(s) available in total.
# }