A function for retrieving information on Norwegian MPs from the parliament API
Arguments
- mpid
Character string, or a vector of strings, indicating the id of the MP to retrieve.
- good_manners
Numeric. Seconds delay between calls when making multiple calls to the same function. Note that the Stortinget API is limited to 100 calls per minute (see https://data.stortinget.no/nyhetsoversikt/begrensning-pa-api-kall/).
Value
A data.frame with the following variables:
| response_date | Date of data retrieval |
| version | Data version from the API |
| death | MP date of death, if applicable |
| last_name | MP last name |
| birth | MP date of birth |
| first_name | MP first name |
| id | MP id |
| gender | MP gender |
Examples
if (FALSE) { # \dontrun{
# Request one MP by id
get_mp("AAMH")
# Request several MPs by id
mps <- get_mp(c("AAMH", "AMSK", "MAAA"), good_manners = 2)
} # }