{"openapi":"3.0.3","info":{"title":"選挙運動費用 API","version":"1.1.0","description":"収録済み報告の内訳を提供する読み取り専用API。金額のstatusとbasisを確認し、未記載・未確定を0円として扱わない。"},"servers":[{"url":"https://senkyo-db-290009356139.asia-northeast1.run.app"}],"paths":{"/api/v1/dataset":{"get":{"operationId":"get_dataset_info","summary":"収録範囲とデータ版を確認","description":"最初に実行し、election_id、都道府県ごとの収録状態、dataset_versionを確認する。未収録は0件の選挙区と区別する。","parameters":[{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"elections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"name":{"type":"string"},"date":{"type":"string"}},"required":["id","name","date"],"additionalProperties":false}},"prefectures":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["included","not_collected"]},"district_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"candidacy_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["code","name","status","district_count","candidacy_count"],"additionalProperties":false}},"counts":{"type":"object","properties":{"districts":{"type":"integer","minimum":0,"maximum":9007199254740991},"candidacies":{"type":"integer","minimum":0,"maximum":9007199254740991},"reports":{"type":"integer","minimum":0,"maximum":9007199254740991},"sources":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["districts","candidacies","reports","sources"],"additionalProperties":false},"policies":{"type":"array","items":{"type":"string"}},"web_url":{"type":"string"}},"required":["schema_version","dataset_version","elections","prefectures","counts","policies","web_url"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}},"/api/v1/districts":{"get":{"operationId":"list_districts","summary":"選挙区を探す","description":"選挙IDを指定して収録済み選挙区を返す。prefecture_codeは01〜47。未収録地域の確認はget_dataset_infoを使う。","parameters":[{"name":"election_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},{"name":"prefecture_code","in":"query","required":false,"schema":{"type":"string","pattern":"^(0[1-9]|[1-3][0-9]|4[0-7])$","description":"都道府県コード01〜47。未収録の都道府県も指定できる。"}},{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"number":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string"},"legal_expense_limit_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"legal_limit_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"candidacy_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","prefecture_code","prefecture_name","number","name","legal_expense_limit_yen","legal_limit_sources","candidacy_count","web_url"],"additionalProperties":false}},"total_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["schema_version","dataset_version","items","total_count"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}},"/api/v1/districts/{id}":{"get":{"operationId":"get_district","summary":"選挙区の候補者を見る","description":"選挙区IDに属する収録済み候補者と収支内訳合計を返す。候補者の全員・最終報告が収録済みであることを保証しない。","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"district":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"number":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string"},"legal_expense_limit_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"legal_limit_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"candidacy_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","prefecture_code","prefecture_name","number","name","legal_expense_limit_yen","legal_limit_sources","candidacy_count","web_url"],"additionalProperties":false},"candidacies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"district_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"name":{"type":"string","description":"一覧・詳細・比較に使う当該選挙の表示名。原本の氏名とは異なる場合がある。"},"source_name":{"type":"string","description":"収支報告の原本に記載された氏名。確認済みの文字抽出の欠落・空白は訂正済み。"},"aliases":{"type":"array","items":{"type":"string"},"description":"確認済みの検索用の別表記。"},"name_evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"表示名と原本の氏名の対応や文字抽出の訂正を確認した資料と説明。"},"party_name":{"type":"string","nullable":true,"description":"当該選挙の党派。原本に記載がない場合は確認済み資料で補う。"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":"採用・合算した報告のID。集計方法がunknownの場合は確認対象のID。候補者の全報告IDとは区別する。"},"aggregation":{"type":"object","properties":{"method":{"type":"string","enum":["sum","latest","unknown"],"description":"sumは各回の追加分を合算、latestは最新の記載された累計・全体額、unknownは方法不明。latestは未記載だけを読み飛ばし、0円・一部未記載・不一致は読み飛ばさない。"},"rule_id":{"type":"string","nullable":true,"description":"候補者または選挙・都道府県単位の集計ルールID。候補者の指定を優先する。指定がない場合はnullで、既定のsumを適用する。"},"evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"集計方法の判断根拠となる資料と説明。"}},"required":["method","rule_id","evidence"],"additionalProperties":false}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids","aggregation"],"additionalProperties":false},"note_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","district_id","prefecture_code","name","source_name","aliases","name_evidence","party_name","report_ids","income","expense","public_funding","note_count","web_url"],"additionalProperties":false}}},"required":["schema_version","dataset_version","district","candidacies"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}},"/api/v1/candidacies":{"get":{"operationId":"search_candidacies","summary":"候補者を検索","description":"表示名・原本の氏名・確認済みの別表記・党派名と略称・選挙区名をNFKCと空白除去で部分一致検索。party_nameは完全一致（原本の「－」は「無所属」に統合）。金額未確定の項目は金額ソートの末尾。page_size最大100。","parameters":[{"name":"election_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"prefecture_code","in":"query","required":false,"schema":{"type":"string","pattern":"^(0[1-9]|[1-3][0-9]|4[0-7])$","description":"都道府県コード01〜47。未収録の都道府県も指定できる。"}},{"name":"district_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},{"name":"party_name","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","district","income_yen","expense_yen"],"default":"district"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"district_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"name":{"type":"string","description":"一覧・詳細・比較に使う当該選挙の表示名。原本の氏名とは異なる場合がある。"},"source_name":{"type":"string","description":"収支報告の原本に記載された氏名。確認済みの文字抽出の欠落・空白は訂正済み。"},"aliases":{"type":"array","items":{"type":"string"},"description":"確認済みの検索用の別表記。"},"name_evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"表示名と原本の氏名の対応や文字抽出の訂正を確認した資料と説明。"},"party_name":{"type":"string","nullable":true,"description":"当該選挙の党派。原本に記載がない場合は確認済み資料で補う。"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":"採用・合算した報告のID。集計方法がunknownの場合は確認対象のID。候補者の全報告IDとは区別する。"},"aggregation":{"type":"object","properties":{"method":{"type":"string","enum":["sum","latest","unknown"],"description":"sumは各回の追加分を合算、latestは最新の記載された累計・全体額、unknownは方法不明。latestは未記載だけを読み飛ばし、0円・一部未記載・不一致は読み飛ばさない。"},"rule_id":{"type":"string","nullable":true,"description":"候補者または選挙・都道府県単位の集計ルールID。候補者の指定を優先する。指定がない場合はnullで、既定のsumを適用する。"},"evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"集計方法の判断根拠となる資料と説明。"}},"required":["method","rule_id","evidence"],"additionalProperties":false}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids","aggregation"],"additionalProperties":false},"note_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","district_id","prefecture_code","name","source_name","aliases","name_evidence","party_name","report_ids","income","expense","public_funding","note_count","web_url"],"additionalProperties":false}},"total_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["schema_version","dataset_version","items","total_count","page","page_size"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}},"/api/v1/candidacies/{id}":{"get":{"operationId":"get_candidacy","summary":"候補者の収支と原本を見る","description":"候補者の当該選挙・選挙区の全収録報告と原本を返す。nameは表示名、source_nameは原本の氏名で、対応の根拠はname_evidence。寄附者の氏名・職業は含まない。金額のstatus、basis、notesを必ず確認する。公費のaggregationは集計方法と根拠、report_idsは採用・合算した報告。各回の公費を独自に再合算しない。","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"candidacy":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"district_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"name":{"type":"string","description":"一覧・詳細・比較に使う当該選挙の表示名。原本の氏名とは異なる場合がある。"},"source_name":{"type":"string","description":"収支報告の原本に記載された氏名。確認済みの文字抽出の欠落・空白は訂正済み。"},"aliases":{"type":"array","items":{"type":"string"},"description":"確認済みの検索用の別表記。"},"name_evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"表示名と原本の氏名の対応や文字抽出の訂正を確認した資料と説明。"},"party_name":{"type":"string","nullable":true,"description":"当該選挙の党派。原本に記載がない場合は確認済み資料で補う。"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":"採用・合算した報告のID。集計方法がunknownの場合は確認対象のID。候補者の全報告IDとは区別する。"},"aggregation":{"type":"object","properties":{"method":{"type":"string","enum":["sum","latest","unknown"],"description":"sumは各回の追加分を合算、latestは最新の記載された累計・全体額、unknownは方法不明。latestは未記載だけを読み飛ばし、0円・一部未記載・不一致は読み飛ばさない。"},"rule_id":{"type":"string","nullable":true,"description":"候補者または選挙・都道府県単位の集計ルールID。候補者の指定を優先する。指定がない場合はnullで、既定のsumを適用する。"},"evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"集計方法の判断根拠となる資料と説明。"}},"required":["method","rule_id","evidence"],"additionalProperties":false}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids","aggregation"],"additionalProperties":false},"note_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","district_id","prefecture_code","name","source_name","aliases","name_evidence","party_name","report_ids","income","expense","public_funding","note_count","web_url"],"additionalProperties":false},"district":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"number":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string"},"legal_expense_limit_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"legal_limit_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"candidacy_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","prefecture_code","prefecture_name","number","name","legal_expense_limit_yen","legal_limit_sources","candidacy_count","web_url"],"additionalProperties":false},"reports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"candidacy_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"record_kind":{"type":"string","enum":["report_round","candidate_summary"]},"submission_no":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"version_no":{"type":"integer","minimum":1,"maximum":9007199254740991},"scope_kind":{"type":"string","enum":["single_round","combined_rounds","candidate_summary"]},"covered_submission_nos":{"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}},"publication_notice_number":{"type":"string","nullable":true},"correction":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"notice_number":{"type":"string"},"published_date":{"type":"string"},"received_date":{"type":"string","nullable":true},"summary":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["id","notice_number","published_date","received_date","summary","source"],"additionalProperties":false,"nullable":true},"label":{"type":"string"},"period_from":{"type":"string","nullable":true},"period_to":{"type":"string","nullable":true},"received_date":{"type":"string","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"donation_item_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"donation_item_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"donation_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"income_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"item_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","item_count","source"],"additionalProperties":false}},"expense_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"parenthetical_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","parenthetical_amount_yen","source"],"additionalProperties":false}},"public_funding_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"category_raw":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","category_raw","amount_yen","source"],"additionalProperties":false}},"printed_totals":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"printed_value_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"value_raw":{"type":"string"},"matches_details":{"type":"boolean","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","printed_value_yen","value_raw","matches_details","source"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"text":{"type":"string"},"printed_label":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","text","printed_label","source"],"additionalProperties":false}},"web_url":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"candidacy_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"record_kind":{"type":"string","enum":["report_round","candidate_summary"]},"submission_no":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"version_no":{"type":"integer","minimum":1,"maximum":9007199254740991},"scope_kind":{"type":"string","enum":["single_round","combined_rounds","candidate_summary"]},"covered_submission_nos":{"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}},"publication_notice_number":{"type":"string","nullable":true},"correction":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"notice_number":{"type":"string"},"published_date":{"type":"string"},"received_date":{"type":"string","nullable":true},"summary":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["id","notice_number","published_date","received_date","summary","source"],"additionalProperties":false,"nullable":true},"label":{"type":"string"},"period_from":{"type":"string","nullable":true},"period_to":{"type":"string","nullable":true},"received_date":{"type":"string","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"donation_item_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"donation_item_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"donation_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"income_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"item_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","item_count","source"],"additionalProperties":false}},"expense_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"parenthetical_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","parenthetical_amount_yen","source"],"additionalProperties":false}},"public_funding_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"category_raw":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","category_raw","amount_yen","source"],"additionalProperties":false}},"printed_totals":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"printed_value_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"value_raw":{"type":"string"},"matches_details":{"type":"boolean","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","printed_value_yen","value_raw","matches_details","source"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"text":{"type":"string"},"printed_label":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","text","printed_label","source"],"additionalProperties":false}},"web_url":{"type":"string"}},"required":["id","candidacy_id","record_kind","submission_no","version_no","scope_kind","covered_submission_nos","publication_notice_number","correction","label","period_from","period_to","received_date","source","income","expense","public_funding","donation_item_count","donation_item_amount_yen","donation_sources","income_facts","expense_facts","public_funding_facts","printed_totals","notes","web_url"],"additionalProperties":false},"description":"訂正前の版。候補者の集計には含めない。"}},"required":["id","candidacy_id","record_kind","submission_no","version_no","scope_kind","covered_submission_nos","publication_notice_number","correction","label","period_from","period_to","received_date","source","income","expense","public_funding","donation_item_count","donation_item_amount_yen","donation_sources","income_facts","expense_facts","public_funding_facts","printed_totals","notes","web_url","history"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"filename":{"type":"string"},"download_url":{"type":"string","format":"uri"},"local_url":{"type":"string","nullable":true},"sha256":{"type":"string"},"page_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"published_date":{"type":"string","nullable":true}},"required":["id","election_id","prefecture_code","prefecture_name","filename","download_url","local_url","sha256","page_count","published_date"],"additionalProperties":false}},"expense_categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"label":{"type":"string"},"value":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false}},"required":["category","label","value"],"additionalProperties":false}}},"required":["schema_version","dataset_version","candidacy","district","reports","sources","expense_categories"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}},"/api/v1/reports/{id}":{"get":{"operationId":"get_report","summary":"1件の報告を確認","description":"報告の最新の版の収支内訳、公費、各項目の原本ページ、保存済み印字合計、訂正告示を返す。historyは訂正前の版で、合計に加算しない。covered_submission_nosは報告の対象回。printed_totalsが空でも印字合計が0円だったことを意味しない。","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"report":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"candidacy_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"record_kind":{"type":"string","enum":["report_round","candidate_summary"]},"submission_no":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"version_no":{"type":"integer","minimum":1,"maximum":9007199254740991},"scope_kind":{"type":"string","enum":["single_round","combined_rounds","candidate_summary"]},"covered_submission_nos":{"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}},"publication_notice_number":{"type":"string","nullable":true},"correction":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"notice_number":{"type":"string"},"published_date":{"type":"string"},"received_date":{"type":"string","nullable":true},"summary":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["id","notice_number","published_date","received_date","summary","source"],"additionalProperties":false,"nullable":true},"label":{"type":"string"},"period_from":{"type":"string","nullable":true},"period_to":{"type":"string","nullable":true},"received_date":{"type":"string","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"donation_item_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"donation_item_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"donation_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"income_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"item_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","item_count","source"],"additionalProperties":false}},"expense_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"parenthetical_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","parenthetical_amount_yen","source"],"additionalProperties":false}},"public_funding_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"category_raw":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","category_raw","amount_yen","source"],"additionalProperties":false}},"printed_totals":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"printed_value_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"value_raw":{"type":"string"},"matches_details":{"type":"boolean","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","printed_value_yen","value_raw","matches_details","source"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"text":{"type":"string"},"printed_label":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","text","printed_label","source"],"additionalProperties":false}},"web_url":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"candidacy_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"record_kind":{"type":"string","enum":["report_round","candidate_summary"]},"submission_no":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"version_no":{"type":"integer","minimum":1,"maximum":9007199254740991},"scope_kind":{"type":"string","enum":["single_round","combined_rounds","candidate_summary"]},"covered_submission_nos":{"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}},"publication_notice_number":{"type":"string","nullable":true},"correction":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"notice_number":{"type":"string"},"published_date":{"type":"string"},"received_date":{"type":"string","nullable":true},"summary":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["id","notice_number","published_date","received_date","summary","source"],"additionalProperties":false,"nullable":true},"label":{"type":"string"},"period_from":{"type":"string","nullable":true},"period_to":{"type":"string","nullable":true},"received_date":{"type":"string","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"donation_item_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"donation_item_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"donation_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"income_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"item_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","item_count","source"],"additionalProperties":false}},"expense_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"parenthetical_amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","amount_yen","parenthetical_amount_yen","source"],"additionalProperties":false}},"public_funding_facts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"category_raw":{"type":"string"},"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["category","category_raw","amount_yen","source"],"additionalProperties":false}},"printed_totals":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"printed_value_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"value_raw":{"type":"string"},"matches_details":{"type":"boolean","nullable":true},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","printed_value_yen","value_raw","matches_details","source"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"text":{"type":"string"},"printed_label":{"type":"string"},"source":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"required":["field","text","printed_label","source"],"additionalProperties":false}},"web_url":{"type":"string"}},"required":["id","candidacy_id","record_kind","submission_no","version_no","scope_kind","covered_submission_nos","publication_notice_number","correction","label","period_from","period_to","received_date","source","income","expense","public_funding","donation_item_count","donation_item_amount_yen","donation_sources","income_facts","expense_facts","public_funding_facts","printed_totals","notes","web_url"],"additionalProperties":false},"description":"訂正前の版。候補者の集計には含めない。"}},"required":["id","candidacy_id","record_kind","submission_no","version_no","scope_kind","covered_submission_nos","publication_notice_number","correction","label","period_from","period_to","received_date","source","income","expense","public_funding","donation_item_count","donation_item_amount_yen","donation_sources","income_facts","expense_facts","public_funding_facts","printed_totals","notes","web_url","history"],"additionalProperties":false},"candidacy":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"district_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"name":{"type":"string","description":"一覧・詳細・比較に使う当該選挙の表示名。原本の氏名とは異なる場合がある。"},"source_name":{"type":"string","description":"収支報告の原本に記載された氏名。確認済みの文字抽出の欠落・空白は訂正済み。"},"aliases":{"type":"array","items":{"type":"string"},"description":"確認済みの検索用の別表記。"},"name_evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"表示名と原本の氏名の対応や文字抽出の訂正を確認した資料と説明。"},"party_name":{"type":"string","nullable":true,"description":"当該選挙の党派。原本に記載がない場合は確認済み資料で補う。"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":"採用・合算した報告のID。集計方法がunknownの場合は確認対象のID。候補者の全報告IDとは区別する。"},"aggregation":{"type":"object","properties":{"method":{"type":"string","enum":["sum","latest","unknown"],"description":"sumは各回の追加分を合算、latestは最新の記載された累計・全体額、unknownは方法不明。latestは未記載だけを読み飛ばし、0円・一部未記載・不一致は読み飛ばさない。"},"rule_id":{"type":"string","nullable":true,"description":"候補者または選挙・都道府県単位の集計ルールID。候補者の指定を優先する。指定がない場合はnullで、既定のsumを適用する。"},"evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"集計方法の判断根拠となる資料と説明。"}},"required":["method","rule_id","evidence"],"additionalProperties":false}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids","aggregation"],"additionalProperties":false},"note_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","district_id","prefecture_code","name","source_name","aliases","name_evidence","party_name","report_ids","income","expense","public_funding","note_count","web_url"],"additionalProperties":false},"district":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"number":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string"},"legal_expense_limit_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"legal_limit_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"candidacy_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","prefecture_code","prefecture_name","number","name","legal_expense_limit_yen","legal_limit_sources","candidacy_count","web_url"],"additionalProperties":false},"source":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"filename":{"type":"string"},"download_url":{"type":"string","format":"uri"},"local_url":{"type":"string","nullable":true},"sha256":{"type":"string"},"page_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"published_date":{"type":"string","nullable":true}},"required":["id","election_id","prefecture_code","prefecture_name","filename","download_url","local_url","sha256","page_count","published_date"],"additionalProperties":false}},"required":["schema_version","dataset_version","report","candidacy","district","source"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}},"/api/v1/comparisons":{"get":{"operationId":"compare_candidacies","summary":"同じ選挙区の候補者を比較","description":"同じ選挙・選挙区の異なる候補者2〜8人を入力順に比較。未記載を0円に置換せず、公費を支出に足さない。家屋費は複合額または事務所・会場費の記載額。","parameters":[{"name":"candidacy_ids","in":"query","required":true,"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"minItems":2,"maxItems":8},"style":"form","explode":false},{"name":"dataset_version","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"正常応答。検索0件も正常。","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"district":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"prefecture_name":{"type":"string"},"number":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string"},"legal_expense_limit_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"legal_limit_sources":{"type":"array","items":{"type":"object","properties":{"source_document_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"page_to":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["source_document_id","page","page_to","url"],"additionalProperties":false}},"candidacy_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","prefecture_code","prefecture_name","number","name","legal_expense_limit_yen","legal_limit_sources","candidacy_count","web_url"],"additionalProperties":false},"candidacies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"election_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"district_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"prefecture_code":{"type":"string"},"name":{"type":"string","description":"一覧・詳細・比較に使う当該選挙の表示名。原本の氏名とは異なる場合がある。"},"source_name":{"type":"string","description":"収支報告の原本に記載された氏名。確認済みの文字抽出の欠落・空白は訂正済み。"},"aliases":{"type":"array","items":{"type":"string"},"description":"確認済みの検索用の別表記。"},"name_evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"表示名と原本の氏名の対応や文字抽出の訂正を確認した資料と説明。"},"party_name":{"type":"string","nullable":true,"description":"当該選挙の党派。原本に記載がない場合は確認済み資料で補う。"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}},"income":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"expense":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false},"public_funding":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":"採用・合算した報告のID。集計方法がunknownの場合は確認対象のID。候補者の全報告IDとは区別する。"},"aggregation":{"type":"object","properties":{"method":{"type":"string","enum":["sum","latest","unknown"],"description":"sumは各回の追加分を合算、latestは最新の記載された累計・全体額、unknownは方法不明。latestは未記載だけを読み飛ばし、0円・一部未記載・不一致は読み飛ばさない。"},"rule_id":{"type":"string","nullable":true,"description":"候補者または選挙・都道府県単位の集計ルールID。候補者の指定を優先する。指定がない場合はnullで、既定のsumを適用する。"},"evidence":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url","description"],"additionalProperties":false},"description":"集計方法の判断根拠となる資料と説明。"}},"required":["method","rule_id","evidence"],"additionalProperties":false}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids","aggregation"],"additionalProperties":false},"note_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"web_url":{"type":"string"}},"required":["id","election_id","district_id","prefecture_code","name","source_name","aliases","name_evidence","party_name","report_ids","income","expense","public_funding","note_count","web_url"],"additionalProperties":false}},"expense_categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"label":{"type":"string"},"values":{"type":"array","items":{"type":"object","properties":{"amount_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"known_subtotal_yen":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true},"status":{"type":"string","enum":["complete","partial","not_reported","unresolved"]},"basis":{"type":"string"},"report_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"}}},"required":["amount_yen","known_subtotal_yen","status","basis","report_ids"],"additionalProperties":false}}},"required":["category","label","values"],"additionalProperties":false}},"web_url":{"type":"string"}},"required":["schema_version","dataset_version","district","candidacies","expense_categories","web_url"],"additionalProperties":false}}}},"404":{"description":"記録が見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"409":{"description":"指定したデータ版と異なる","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"422":{"description":"入力条件または比較対象が不正","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}},"429":{"description":"REST・MCP合計で利用者ごと・インスタンスごとに毎分120回を超過。Retry-Afterの秒数後に再試行する。","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"再試行までの秒数。"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"dataset_version":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["schema_version","dataset_version","error"],"additionalProperties":false}}}}}}}}}