{"openapi":"3.1.0","info":{"title":"Acta API","version":"1","summary":"台灣立法委員在立法院的發言、依問題整理的主張與意見群組、院會記名表決","description":"唯讀、不需要金鑰，回應都是 JSON，可以從瀏覽器跨網域呼叫（CORS）。\n\n發言原文（evidence）取自立法院公報，只收立委本人說的話，目前只收錄和本站議題有關的發言。\n\n主張（claim）是 AI 從發言抽出的摘要，附一句逐字原句（quote），經另一個 AI 審核後才發布，仍然可能出錯：引用時以原句為準，並附上主張頁或公報連結。\n\n意見群組（group）依主張內容分群，分群時不看姓名與政黨；本站不替任何人標記支持或反對，也不打分數、不排名，使用這份資料時請不要自行加上。\n\n每筆資料都有對應的頁面：主張 https://acta.tw/claims/<id>、發言 https://acta.tw/evidence/<id>、立委 https://acta.tw/actors/<id>、議題 https://acta.tw/issues/<slug>。\n\n資料約每分鐘更新一次，請自行快取、不要高頻率重複抓取；要整批資料請用議題頁的 CSV（/issues/<slug>/claims.csv）。","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/deed.zh-hant"},"contact":{"name":"葛如鈞委員辦公室","url":"https://juchunko.com/zh-TW/fragment/contact/"}},"servers":[{"url":"https://api.acta.tw"}],"externalDocs":{"description":"方法說明：資料來源、AI 做了什麼、限制","url":"https://acta.tw/about"},"paths":{"/search":{"get":{"operationId":"search","summary":"全文搜尋發言原文與已發布的主張","description":"查詢以空白分成幾個詞，每個詞各自一字不差、全部都要出現。其中一個詞剛好是立委姓名、而且還有別的詞時，當成「這位立委說的」。結果依發言日期由新到舊；沒有語意搜尋。","x-example":"/search?q=核三延役&type=evidence&limit=5","parameters":[{"name":"q","in":"query","required":true,"description":"關鍵字，以空白分開","schema":{"type":"string","description":"關鍵字，以空白分開"}},{"name":"type","in":"query","required":false,"description":"只找發言原文或只找主張","schema":{"type":"string","description":"只找發言原文或只找主張","enum":["evidence","claim"]}},{"name":"actor","in":"query","required":false,"description":"立委 id（見 /actors）","schema":{"type":"string","description":"立委 id（見 /actors）"}},{"name":"term","in":"query","required":false,"description":"屆期（8–11）","schema":{"type":"integer","description":"屆期（8–11）"}},{"name":"from","in":"query","required":false,"description":"發言日期下限，YYYY-MM-DD","schema":{"type":"string","description":"發言日期下限，YYYY-MM-DD"}},{"name":"to","in":"query","required":false,"description":"發言日期上限，YYYY-MM-DD","schema":{"type":"string","description":"發言日期上限，YYYY-MM-DD"}},{"name":"limit","in":"query","required":false,"description":"一次回傳幾筆","schema":{"type":"integer","description":"一次回傳幾筆","default":20,"maximum":100}},{"name":"offset","in":"query","required":false,"description":"從第幾筆開始","schema":{"type":"integer","description":"從第幾筆開始","default":0}}],"responses":{"200":{"description":"搜尋結果","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchHit"}},"total":{"type":"integer","description":"符合的總筆數"},"terms":{"type":"array","items":{"type":"string"},"description":"實際拿去比對文字的詞"},"people":{"type":"array","items":{"$ref":"#/components/schemas/Person"},"description":"查詢裡出現的立委姓名"},"actor":{"anyOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]}}}}}}}}},"/quotes/match":{"get":{"operationId":"matchQuote","summary":"引言查證：一句引言在收錄的發言裡最接近的原句","description":"只比對文字（不計標點與空白），不用 AI。matches 是空的只代表收錄的發言裡沒有接近的句子，不代表沒有說過：這裡沒有記者會、社群貼文、節目上的發言，公報文字也可能和實際說出口的差幾個字。引言至少 6 個字、最多 300 個字。","x-example":"/quotes/match?quote=在確認核安無虞的情況下，我不反對核三延役","parameters":[{"name":"quote","in":"query","required":true,"description":"要查的引言","schema":{"type":"string","description":"要查的引言"}},{"name":"actor","in":"query","required":false,"description":"只比對這位立委的發言：立委 id 或完整姓名","schema":{"type":"string","description":"只比對這位立委的發言：立委 id 或完整姓名"}},{"name":"limit","in":"query","required":false,"description":"最多回傳幾段","schema":{"type":"integer","description":"最多回傳幾段","default":5,"maximum":20}}],"responses":{"200":{"description":"最接近的幾段原文，逐字相符的在前","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"type":"string","description":"實際拿去比對的引言"},"actor":{"type":["object","null"],"properties":{"id":{"type":"string","description":"立委 id"},"name":{"type":"string","description":"姓名"}},"description":"套用的立委篩選"},"matches":{"type":"array","items":{"$ref":"#/components/schemas/QuoteMatch"}}}}}}},"400":{"description":"引言太短或沒給","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"missing_quote 或 quote_too_short"}}}}}},"404":{"description":"找不到這位立委","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"actor_not_found"}}}}}}}}},"/issues":{"get":{"operationId":"listIssues","summary":"所有議題、各議題的問題與討論量","x-example":"/issues","responses":{"200":{"description":"議題清單","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","description":"議題代號"},"name":{"type":"string","description":"名稱"},"description":{"type":"string","description":"說明"},"questions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","description":"問題代號（全站唯一）"},"text":{"type":"string","description":"問題"}}}},"keywords":{"type":"array","items":{"type":"string"},"description":"收錄發言時用的關鍵字"},"stats":{"type":"object","properties":{"claims":{"type":"integer","description":"已發布的主張數"},"actors":{"type":"integer","description":"有主張的立委人數"},"opinions":{"type":"integer","description":"已發布的意見群組數"},"firstDate":{"type":["string","null"],"description":"最早的發言日期"},"lastDate":{"type":["string","null"],"description":"最近的發言日期"}},"description":"只有數量與時間，不是評分"}}}},"totals":{"type":"object","properties":{"claims":{"type":"integer","description":"主張總數"},"actors":{"type":"integer","description":"立委人數"},"questions":{"type":"integer","description":"問題數"}}}}}}}}}}},"/issues/{slug}":{"get":{"operationId":"getIssue","summary":"一個議題的全部資料：問題、主張與原句、意見群組、記名表決","description":"回應很大（主張多的議題有數 MB）。只想找特定內容時先用 /search 或 /claims/recent。claims[].questionId 對應 questions[].id；groups[].claimIds 對應 claims[].id，kind 是 group（一種意見）或 common_ground（幾個群組的共同點）。","x-example":"/issues/nuclear-energy","parameters":[{"name":"slug","in":"path","required":true,"description":"議題代號（見 /issues）","schema":{"type":"string"}}],"responses":{"200":{"description":"議題資料","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"type":"object","properties":{"id":{"type":"string","description":"議題 id"},"slug":{"type":"string","description":"代號"},"name":{"type":"string","description":"名稱"},"description":{"type":"string","description":"說明"}}},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"問題 id"},"slug":{"type":"string","description":"問題代號"},"text":{"type":"string","description":"問題"}}}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/IssueClaim"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/OpinionGroup"}},"votes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"表決 id"},"questionId":{"type":"string","description":"所屬問題"},"subject":{"type":"string","description":"公報上的表決議題文字（照錄，不解讀成立場）"},"summary":{"type":["string","null"],"description":"人工寫的說明：這個表決在決定什麼"},"date":{"type":["string","null"],"description":"日期"},"yes":{"type":["integer","null"],"description":"贊成人數"},"no":{"type":["integer","null"],"description":"反對人數"},"abstain":{"type":["integer","null"],"description":"棄權人數"},"officialUrl":{"type":["string","null"],"description":"公報連結"},"records":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","description":"立委 id"},{"type":"string","description":"yes／no／abstain"}]},"description":"每位委員的選擇"}}},"description":"院會記名表決"},"voters":{"type":"object","description":"records 裡出現的立委：id → { name, party }"}}}}}},"404":{"description":"找不到","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"not_found"}}}}}}}}},"/actors":{"get":{"operationId":"listActors","summary":"所有立委（第 8 屆起）","x-example":"/actors","responses":{"200":{"description":"立委清單，依姓名排序","content":{"application/json":{"schema":{"type":"object","properties":{"actors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"立委 id（跨屆相同）"},"name":{"type":"string","description":"姓名"},"party":{"type":["string","null"],"description":"最近一屆的黨籍"},"constituency":{"type":["string","null"],"description":"最近一屆的選區"},"terms":{"type":["string","null"],"description":"任過的屆期，以逗號分開"},"evidenceCount":{"type":"integer","description":"收錄的發言段數"}}}}}}}}}}}},"/actors/{id}":{"get":{"operationId":"getActor","summary":"一位立委：各屆黨籍、已發布的主張（含原句與所屬意見群組）、記名表決、最近的發言","x-example":"/actors/leg_1279?limit=5","parameters":[{"name":"id","in":"path","required":true,"description":"立委 id（見 /actors）","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"一次回傳幾筆","schema":{"type":"integer","description":"一次回傳幾筆","default":20,"maximum":100}},{"name":"offset","in":"query","required":false,"description":"從第幾筆開始","schema":{"type":"integer","description":"從第幾筆開始","default":0}}],"responses":{"200":{"description":"立委資料","content":{"application/json":{"schema":{"type":"object","properties":{"actor":{"type":"object","properties":{"id":{"type":"string","description":"立委 id"},"name":{"type":"string","description":"姓名"},"party":{"type":["string","null"],"description":"最近一屆的黨籍"}}},"terms":{"type":"array","items":{"type":"object","properties":{"term":{"type":"integer","description":"屆期"},"party":{"type":["string","null"],"description":"當屆黨籍"},"constituency":{"type":["string","null"],"description":"當屆選區"}}}},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"問題 id"},"slug":{"type":"string","description":"問題代號"},"text":{"type":"string","description":"問題"}}},"description":"所有問題（對照 questionId 用）"},"timeline":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"主張 id"},"questionId":{"type":"string","description":"回答的問題"},"text":{"type":"string","description":"主張（AI 整理的摘要）"},"quote":{"type":["string","null"],"description":"逐字原句"},"evidenceId":{"type":"string","description":"發言 id"},"date":{"type":["string","null"],"description":"發言日期"},"meetingName":{"type":["string","null"],"description":"會議"},"groupId":{"type":["string","null"],"description":"所屬意見群組"},"groupLabel":{"type":["string","null"],"description":"群組標籤"},"officialUrl":{"type":["string","null"],"description":"公報連結"},"videoUrl":{"type":["string","null"],"description":"IVOD 影片連結"}}},"description":"已發布的主張，依發言日期由舊到新"},"votes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"表決 id"},"questionId":{"type":"string","description":"所屬問題"},"subject":{"type":"string","description":"表決議題文字"},"date":{"type":["string","null"],"description":"日期"},"choice":{"type":"string","description":"yes／no／abstain"}}}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"發言 id"},"preview":{"type":"string","description":"開頭 160 個字"},"meeting":{"anyOf":[{"$ref":"#/components/schemas/Meeting"},{"type":"null"}]}}},"description":"最近的發言（受 limit／offset 控制）"},"evidenceTotal":{"type":"integer","description":"收錄的發言總段數"}}}}}},"404":{"description":"找不到","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"not_found"}}}}}}}}},"/claims/recent":{"get":{"operationId":"recentClaims","summary":"最近加入的主張（依加入本站的時間，新的在前）","x-example":"/claims/recent?issue=nuclear-energy&limit=10","parameters":[{"name":"issue","in":"query","required":false,"description":"只看這個議題（代號）","schema":{"type":"string","description":"只看這個議題（代號）"}},{"name":"actor","in":"query","required":false,"description":"只看這位立委（id）","schema":{"type":"string","description":"只看這位立委（id）"}},{"name":"limit","in":"query","required":false,"description":"最多幾則","schema":{"type":"integer","description":"最多幾則","default":50,"maximum":100}}],"responses":{"200":{"description":"主張清單","content":{"application/json":{"schema":{"type":"object","properties":{"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"主張 id"},"questionId":{"type":"string","description":"回答的問題"},"text":{"type":"string","description":"主張（AI 整理的摘要）"},"quote":{"type":["string","null"],"description":"逐字原句"},"evidenceId":{"type":"string","description":"發言 id"},"date":{"type":["string","null"],"description":"發言日期"},"meetingName":{"type":["string","null"],"description":"會議"},"actorId":{"type":"string","description":"立委 id"},"actorName":{"type":"string","description":"姓名"},"createdAt":{"type":"integer","description":"加入本站的時間（毫秒）"}}}}}}}}}}}},"/claims/{id}":{"get":{"operationId":"getClaim","summary":"一則已發布的主張：原句、發言原文、出處、AI 審核的判定與理由、修改紀錄","x-example":"/claims/clm_ec6682815141f331b8fd","parameters":[{"name":"id","in":"path","required":true,"description":"主張 id","schema":{"type":"string"}}],"responses":{"200":{"description":"主張","content":{"application/json":{"schema":{"type":"object","properties":{"claim":{"type":"object","properties":{"id":{"type":"string","description":"主張 id"},"text":{"type":"string","description":"主張（AI 整理的摘要）"},"questionId":{"type":"string","description":"回答的問題"},"createdBy":{"type":"string","description":"ai 或 human"}}},"actor":{"$ref":"#/components/schemas/Person"},"evidence":{"type":"array","items":{"type":"object","properties":{"quote":{"type":["string","null"],"description":"逐字原句：一定逐字出現在 evidence.text"},"evidence":{"$ref":"#/components/schemas/Evidence"},"meeting":{"anyOf":[{"$ref":"#/components/schemas/Meeting"},{"type":"null"}]},"source":{"type":"object","properties":{"originalUrl":{"type":"string","description":"原始資料網址"},"contentHash":{"type":"string","description":"原始檔案的 hash"}}}}}},"aiReview":{"type":["object","null"],"properties":{"verdict":{"type":"string","description":"pass／fix／reject"},"reason":{"type":"string","description":"判定理由"},"createdAt":{"type":"integer","description":"時間（毫秒）"}},"description":"最近一次 AI 審核"},"revisions":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"修改後的文字"},"reason":{"type":["string","null"],"description":"理由"},"by":{"type":"string","description":"original（原始版本）／ai／human"},"createdAt":{"type":"integer","description":"時間（毫秒）"}}},"description":"修改紀錄"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"群組 id"},"label":{"type":"string","description":"標籤"}}},"description":"所屬的意見群組"}}}}}},"404":{"description":"沒有這則主張，或它沒有公開（被撤下的見 /claims/{id}/withdrawal）","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"not_found"}}}}}}}}},"/claims/{id}/withdrawal":{"get":{"operationId":"getClaimWithdrawal","summary":"撤下紀錄：曾經公開、後來被判定有誤而撤下的主張","description":"只說明何時、由 AI 或人、因為什麼撤下，不再提供主張的文字。從來沒有公開過的主張回 404。","parameters":[{"name":"id","in":"path","required":true,"description":"主張 id","schema":{"type":"string"}}],"responses":{"200":{"description":"撤下紀錄","content":{"application/json":{"schema":{"type":"object","properties":{"withdrawal":{"type":"object","properties":{"actorId":{"type":"string","description":"立委 id"},"actorName":{"type":"string","description":"姓名"},"questionId":{"type":"string","description":"原本回答的問題"},"evidenceId":{"type":["string","null"],"description":"那段發言的 id"},"at":{"type":"integer","description":"撤下的時間（毫秒）"},"by":{"type":"string","description":"ai 或 human"},"reason":{"type":["string","null"],"description":"理由"}}}}}}}},"404":{"description":"找不到","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"not_found"}}}}}}}}},"/evidence/{id}":{"get":{"operationId":"getEvidence","summary":"一段發言：公報原文、完整對話、出處，以及從它整理出的主張","x-example":"/evidence/ev_ivod_163875_f8b3c6deefff","parameters":[{"name":"id","in":"path","required":true,"description":"發言 id","schema":{"type":"string"}}],"responses":{"200":{"description":"發言","content":{"application/json":{"schema":{"type":"object","properties":{"evidence":{"$ref":"#/components/schemas/Evidence"},"actor":{"$ref":"#/components/schemas/Person"},"meeting":{"anyOf":[{"$ref":"#/components/schemas/Meeting"},{"type":"null"}]},"source":{"type":"object","properties":{"originalUrl":{"type":"string","description":"原始資料網址"},"contentHash":{"type":"string","description":"原始檔案的 hash"}}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"主張 id"},"questionId":{"type":"string","description":"回答的問題"},"text":{"type":"string","description":"主張"},"quote":{"type":["string","null"],"description":"原句"}}}}}}}}},"404":{"description":"找不到","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"not_found"}}}}}}}}},"/coverage":{"get":{"operationId":"getCoverage","summary":"收錄範圍與審核統計：每個議題每一屆的發言數與主張數，退回、撤下、人工修改、讀者回報、人工抽查的數量","description":"這些是處理過的數量，不是錯誤率；唯一由人判定的品質數字是 checks（人工抽查）。","x-example":"/coverage","responses":{"200":{"description":"統計","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"Person":{"type":"object","properties":{"id":{"type":"string","description":"立委 id"},"name":{"type":"string","description":"姓名"},"party":{"type":["string","null"],"description":"黨籍"}}},"Meeting":{"type":"object","properties":{"id":{"type":"string","description":"會議 id"},"name":{"type":"string","description":"會議名稱"},"date":{"type":"string","description":"發言當天，YYYY-MM-DD"}}},"Evidence":{"type":"object","properties":{"id":{"type":"string","description":"發言 id"},"text":{"type":"string","description":"這位立委本人說的話（公報文字）"},"dialogue":{"type":["string","null"],"description":"完整對話，含官員答詢；每行「講者：內容」"},"officialUrl":{"type":["string","null"],"description":"公報連結"},"videoUrl":{"type":["string","null"],"description":"IVOD 影片連結（第 10 屆起）"},"spokenOn":{"type":["string","null"],"description":"發言當天"}}},"SearchHit":{"type":"object","properties":{"type":{"type":"string","description":"evidence（發言原文）或 claim（主張）"},"id":{"type":"string","description":"發言或主張的 id；頁面在 https://acta.tw/evidence/<id> 或 https://acta.tw/claims/<id>"},"snippet":{"type":"string","description":"關鍵字前後的文字"},"actor":{"$ref":"#/components/schemas/Person"},"meeting":{"anyOf":[{"$ref":"#/components/schemas/Meeting"},{"type":"null"}]},"officialUrl":{"type":["string","null"],"description":"公報連結"},"videoUrl":{"type":["string","null"],"description":"IVOD 影片連結"}}},"QuoteMatch":{"type":"object","properties":{"evidenceId":{"type":"string","description":"發言 id；頁面在 https://acta.tw/evidence/<id>"},"match":{"type":"string","description":"exact：不計標點，引言整句出現在原文；close：用字接近；partial：部分相近"},"coverage":{"type":"number","description":"引言裡每三個字一組，有多少比例出現在這一段（0–1）"},"passage":{"type":"string","description":"原文裡最接近的那一段（完整的句子）"},"fragments":{"type":"array","items":{"type":"string"},"description":"這一段裡和引言相同的文字"},"actor":{"$ref":"#/components/schemas/Person"},"meeting":{"anyOf":[{"$ref":"#/components/schemas/Meeting"},{"type":"null"}]},"officialUrl":{"type":["string","null"],"description":"公報連結"},"videoUrl":{"type":["string","null"],"description":"IVOD 影片連結"}}},"IssueClaim":{"type":"object","properties":{"id":{"type":"string","description":"主張 id"},"questionId":{"type":"string","description":"回答的問題"},"text":{"type":"string","description":"主張（AI 整理的摘要）"},"quote":{"type":["string","null"],"description":"逐字原句"},"actorId":{"type":"string","description":"立委 id"},"actorName":{"type":"string","description":"姓名"},"actorParty":{"type":["string","null"],"description":"發言當屆的黨籍"},"term":{"type":["integer","null"],"description":"發言當時的屆期"},"evidenceId":{"type":"string","description":"發言 id"},"meetingName":{"type":["string","null"],"description":"會議"},"meetingDate":{"type":["string","null"],"description":"發言日期"},"officialUrl":{"type":["string","null"],"description":"公報連結"},"videoUrl":{"type":["string","null"],"description":"IVOD 影片連結"}}},"OpinionGroup":{"type":"object","properties":{"id":{"type":"string","description":"群組 id"},"questionId":{"type":"string","description":"所屬問題"},"kind":{"type":"string","description":"group（一種意見）或 common_ground（幾個群組的共同點）"},"label":{"type":"string","description":"標籤：只描述主張內容"},"summary":{"type":["string","null"],"description":"摘要"},"claimIds":{"type":"array","items":{"type":"string"},"description":"屬於這一群的主張"}}}}}}