Skip to content

Provides access to legislators' basic demographic and background information through the Legislative Yuan's V1 API interface.

Usage

get_legislators(term = NULL, verbose = TRUE)

Arguments

term

numeric or NULL The data is available from the 2nd term.

verbose

logical, indicates whether get_meetings should print out detailed output when retrieving the data. The default is set to TRUE.

Value

list contains:

query_time

the queried time

queried_term

the queried term

url

the retrieved json url

variable_names

the variables of the tibble dataframe

manual_info

the official manual from https://data.ly.gov.tw/getds.action?id=16, or use legisTaiwan::get_variable_info("get_legislators")

data

a tibble dataframe, whose variables include:

name

委員姓名

ename

委員姓名

sex

性別

party

黨籍

partyGroup

黨團

committee

委員會

onboardDate

到職日(西元年)

degree

學歷

experience

經歷

picPath

照片位址

leaveFlag

離職日期(西元年)

leaveReason

離職原因

Details

This function retrieves comprehensive data about legislators including their personal information, political background, and demographic details. The data is available starting from the 2nd legislative term.

get_legislators produces a list, which contains query_time, queried_term, url, variable_names, manual_info and data.

Note

To retrieve the user manual and more information about variable of the data frame, please use get_variable_info("get_legislators") or visit the API manual at https://data.ly.gov.tw/getds.action?id=16. 提供委員基本資料,最早資料可追溯至第2屆。

See also

get_variable_info("get_legislators"), review_session_info()

Author

Yen-Chieh Liao (davidycliao@gmail.com)

Examples

## query the Executives' answered response by term and the session period.
## 輸入「立委屆期」與「會期」下載「行政院答復」
get_executive_response(term = 8, session_period = 1)
#> 
#> Input Format Information:
#> ------------------------
#> Term: Must be numeric (e.g., 8, 9, 10, 11)
#> Session Period: Must be numeric (1-8)
#> ------------------------
#> 
#> Downloading executive response data...
#> 
  |                                                                      
  |                                                                |   0%
  |                                                                      
  |=============                                                   |  20%
  |                                                                      
  |==========================                                      |  40%
  |                                                                      
  |======================================                          |  60%
  |                                                                      
  |===================================================             |  80%
  |                                                                      
  |================================================================| 100%
#> 
#> 
#> ====== Retrieved Information ======
#> -----------------------------------
#>  URL: 
#>  https://data.ly.gov.tw/odw/ID2Action.action?term=08&sessionPeriod=01&sessionTimes=&item=&fileType=json 
#>  Term:  08 
#>  Session Period:  1 
#>  Total Responses:  1065 
#> 
#> Session Distribution:
#>  Session 01: 1065
#> ===================================
#> $title
#> [1] "Executive Response Records"
#> 
#> $query_time
#> [1] "2025-01-21 21:04:55 GMT"
#> 
#> $retrieved_number
#> [1] 1065
#> 
#> $retrieved_term
#> [1] "08"
#> 
#> $url
#> [1] "https://data.ly.gov.tw/odw/ID2Action.action?term=08&sessionPeriod=01&sessionTimes=&item=&fileType=json"
#> 
#> $variable_names
#>  [1] "term"          "sessionPeriod" "sessionTimes"  "meetingTimes" 
#>  [5] "eyNumber"      "lyNumber"      "subject"       "content"      
#>  [9] "docUrl"        "selectTerm"   
#> 
#> $manual_info
#> [1] "https://data.ly.gov.tw/getds.action?id=2"
#> 
#> $data
#> # A tibble: 1,065 × 10
#>    term  sessionPeriod sessionTimes meetingTimes eyNumber lyNumber subject
#>    <chr> <chr>         <chr>        <chr>        <chr>    <chr>    <chr>  
#>  1 08    01            01           null         (行政院函 中… (立法院函 編… (一八一)行…
#>  2 08    01            01           null         (行政院函 中… (立法院函 編… (一八二)行…
#>  3 08    01            01           null         (行政院函 中… (立法院函 編… (一八三)行…
#>  4 08    01            01           null         (行政院函 中… (立法院函 編… (一八四)行…
#>  5 08    01            01           null         (行政院函 中… (立法院函 編… (一八五)行…
#>  6 08    01            01           null         (行政院函 中… (立法院函 編… (一八六)行…
#>  7 08    01            01           null         (行政院函 中… (立法院函 編… (一八七)行…
#>  8 08    01            01           null         (行政院函 中… (立法院函 編… (一八八)行…
#>  9 08    01            01           null         (行政院函 中… (立法院函 編… (一八九)行…
#> 10 08    01            01           null         (行政院函 中… (立法院函 編… (一九○)行…
#> # ℹ 1,055 more rows
#> # ℹ 3 more variables: content <chr>, docUrl <chr>, selectTerm <chr>
#> 

if (FALSE) { # \dontrun{
# Get data for the 9th term
legislators_data <- get_legislators(term = 9)
legislators_data
} # }