{"openapi":"3.1.0","info":{"title":"УИК API","description":"\nПубличный API с результатами по участковым избирательным комиссиям (УИК): протоколы\nодномандатных округов (**candidates**) и партийных списков (**parties**), история версий протоколов,\nсводные результаты по любым выборкам УИК.\n\n**Руководство с примерами:** [/](./) · **ReDoc:** [/redoc](./redoc)\n\n### Ключевые понятия\n* **Округ** — номер одномандатного округа (1–225).\n* **УИК** — номер участковой комиссии. Номер уникален только внутри региона, поэтому\n  один и тот же номер встречается в разных округах. Однозначно УИК определяется парой\n  `округ:УИК` или `commission_id` (UUID комиссии в ЦИК).\n* **Версия протокола** — протокол с конкретным SHA256. Если протокол переписывали,\n  у УИК несколько версий; по умолчанию API отдаёт последнюю увиденную.\n* **Выгрузка** (`download`) — снимок данных. Параметр `download=<код>` показывает данные\n  так, как они выглядели в этой выгрузке.\n\n### Лимиты\nAPI открытый, без ключей. Ограничения на IP: бюджет **120 очков за 60 с**.\nОбычный запрос стоит 1 очко, `per_page` > 200 или `history=true` — +2, POST-запросы — 3,\nагрегаты по произвольным фильтрам — 5, CSV-выгрузка — 10. Тяжёлые запросы (CSV, POST, агрегаты)\nс одного IP выполняются по одному. В ответах есть заголовки `X-RateLimit-Limit`,\n`X-RateLimit-Remaining`, `X-RateLimit-Reset`, `X-RateLimit-Cost`; при превышении — `429` и `Retry-After`.\n\nВсе даты — в UTC (ISO 8601). Проценты голосов считаются от числа бюллетеней в ящиках.\n","version":"1.0.0"},"paths":{"/api/v1/stats":{"get":{"tags":["Общее"],"summary":"Сводка по базе","description":"Сколько округов/УИК/протоколов загружено, общие итоги, список выгрузок.","operationId":"stats_api_v1_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}}}}},"/api/v1/downloads":{"get":{"tags":["Общее"],"summary":"Список выгрузок","description":"Выгрузки (снимки данных). Код выгрузки можно передать в параметр `download` у других методов,\nчтобы получить данные в том виде, в каком они были в этой выгрузке.","operationId":"list_downloads_api_v1_downloads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Download"},"type":"array","title":"Response List Downloads Api V1 Downloads Get"}}}}}}},"/api/v1/okrugs":{"get":{"tags":["Округа"],"summary":"Список округов","description":"Все округа с итогами: число УИК, явка, лидеры по кандидатам и партиям.","operationId":"list_okrugs_api_v1_okrugs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OkrugBrief"},"type":"array","title":"Response List Okrugs Api V1 Okrugs Get"}}}}}}},"/api/v1/okrugs/{okrug}":{"get":{"tags":["Округа"],"summary":"Округ целиком","description":"Итоги округа: сводка + полные результаты кандидатов и партий (по текущим версиям протоколов).","operationId":"get_okrug_api_v1_okrugs__okrug__get","parameters":[{"name":"okrug","in":"path","required":true,"schema":{"type":"integer","minimum":1,"title":"Okrug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkrugDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/uiks":{"get":{"tags":["УИК"],"summary":"Поиск и выборка УИК","description":"Главный метод получения данных по УИК. Можно запросить сразу много УИК:\n\n* `?okrug=1` — все УИК округа 1\n* `?okrug=1&uik=15,16,20-30` — конкретные УИК в округе\n* `?pair=1:15,171:74` — точные пары из разных округов\n* `?uik=15` — все УИК №15 во всех округах\n* `?commission_id=<uuid>,<uuid>`\n* `?okrug=1-10&turnout_min=90&sort=-turnout` — УИК с явкой ≥ 90%\n* `?changed=true` — УИК, где протокол переписывали\n* `?format=csv` — вся выборка файлом","operationId":"list_uiks_api_v1_uiks_get","parameters":[{"name":"type","in":"query","required":false,"schema":{"enum":["all","candidates","parties"],"type":"string","description":"Какие протоколы вернуть","default":"all","title":"Type"},"description":"Какие протоколы вернуть"},{"name":"basis","in":"query","required":false,"schema":{"anyOf":[{"enum":["candidates","parties"],"type":"string"},{"type":"null"}],"description":"По какому протоколу применять фильтры метрик и сортировку. По умолчанию — type, если он один, иначе parties.","title":"Basis"},"description":"По какому протоколу применять фильтры метрик и сортировку. По умолчанию — type, если он один, иначе parties."},{"name":"votes","in":"query","required":false,"schema":{"type":"boolean","description":"Включить голоса по кандидатам/партиям","default":true,"title":"Votes"},"description":"Включить голоса по кандидатам/партиям"},{"name":"history","in":"query","required":false,"schema":{"type":"boolean","description":"Включить историю версий протоколов (дороже по лимиту)","default":false,"title":"History"},"description":"Включить историю версий протоколов (дороже по лимиту)"},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Поля через запятую, `-` — по убыванию: okrug, uik, voters, ballots, invalid, turnout, cik_created_at, versions","title":"Sort"},"description":"Поля через запятую, `-` — по убыванию: okrug, uik, voters, ballots, invalid, turnout, cik_created_at, versions"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Per Page"}},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"type":"string","description":"csv — выгрузить ВСЮ выборку файлом (без пагинации)","default":"json","title":"Format"},"description":"csv — выгрузить ВСЮ выборку файлом (без пагинации)"},{"name":"layout","in":"query","required":false,"schema":{"enum":["long","wide"],"type":"string","description":"Для CSV: wide — строка на протокол, голоса в колонках; long — строка на кандидата/партию","default":"wide","title":"Layout"},"description":"Для CSV: wide — строка на протокол, голоса в колонках; long — строка на кандидата/партию"},{"name":"okrug","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Округ(а): `1`, `1,2,3`, `10-20`. Можно повторять параметр.","title":"Okrug"},"description":"Округ(а): `1`, `1,2,3`, `10-20`. Можно повторять параметр."},{"name":"uik","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Номер(а) УИК: `15`, `15,16`, `100-200`. Номер УИК уникален только внутри региона — без округа вернутся все УИК с таким номером.","title":"Uik"},"description":"Номер(а) УИК: `15`, `15,16`, `100-200`. Номер УИК уникален только внутри региона — без округа вернутся все УИК с таким номером."},{"name":"pair","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Точные пары округ:УИК — `1:15,1:16,171:74`.","title":"Pair"},"description":"Точные пары округ:УИК — `1:15,1:16,171:74`."},{"name":"commission_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"UUID комиссий через запятую.","title":"Commission Id"},"description":"UUID комиссий через запятую."},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Данные на момент выгрузки (например `download-1`). По умолчанию — последняя известная версия протокола.","title":"Download"},"description":"Данные на момент выгрузки (например `download-1`). По умолчанию — последняя известная версия протокола."},{"name":"voters_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Voters Min"}},{"name":"voters_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Voters Max"}},{"name":"ballots_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Ballots Min"}},{"name":"ballots_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Ballots Max"}},{"name":"invalid_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Invalid Min"}},{"name":"invalid_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Invalid Max"}},{"name":"turnout_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Явка от, %","title":"Turnout Min"},"description":"Явка от, %"},{"name":"turnout_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Явка до, %","title":"Turnout Max"},"description":"Явка до, %"},{"name":"changed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true — только УИК, где цифры протокола менялись; false — только неизменные","title":"Changed"},"description":"true — только УИК, где цифры протокола менялись; false — только неизменные"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UikList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/uiks/query":{"post":{"tags":["УИК"],"summary":"Выборка УИК (POST, большие списки)","description":"То же, что `GET /uiks`, но фильтры передаются JSON-телом — удобно, когда нужно сразу\nнесколько сотен/тысяч конкретных УИК.","operationId":"query_uiks_api_v1_uiks_query_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UikQuery"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UikList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/uiks/{commission_id}":{"get":{"tags":["УИК"],"summary":"УИК по ID комиссии","operationId":"get_uik_api_v1_uiks__commission_id__get","parameters":[{"name":"commission_id","in":"path","required":true,"schema":{"type":"string","description":"UUID комиссии","title":"Commission Id"},"description":"UUID комиссии"},{"name":"type","in":"query","required":false,"schema":{"enum":["all","candidates","parties"],"type":"string","default":"all","title":"Type"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"votes","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Votes"}},{"name":"history","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"History"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Uik"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/okrugs/{okrug}/uiks/{uik}":{"get":{"tags":["УИК"],"summary":"УИК по номеру округа и номеру УИК","operationId":"get_uik_by_number_api_v1_okrugs__okrug__uiks__uik__get","parameters":[{"name":"okrug","in":"path","required":true,"schema":{"type":"integer","title":"Okrug"}},{"name":"uik","in":"path","required":true,"schema":{"type":"integer","title":"Uik"}},{"name":"type","in":"query","required":false,"schema":{"enum":["all","candidates","parties"],"type":"string","default":"all","title":"Type"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"votes","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Votes"}},{"name":"history","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"History"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Uik"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/uiks/{commission_id}/history":{"get":{"tags":["УИК"],"summary":"История версий протоколов УИК","description":"Все версии протоколов (по SHA256) с моментами, когда их видели, и разницей с предыдущей версией.","operationId":"uik_history_api_v1_uiks__commission_id__history_get","parameters":[{"name":"commission_id","in":"path","required":true,"schema":{"type":"string","title":"Commission Id"}},{"name":"type","in":"query","required":false,"schema":{"enum":["all","candidates","parties"],"type":"string","default":"all","title":"Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ProtocolVersion"}},"title":"Response Uik History Api V1 Uiks  Commission Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/results":{"get":{"tags":["Результаты"],"summary":"Сводные результаты по выборке","description":"Суммирует протоколы выбранных УИК: итоги (избиратели, бюллетени, явка) и голоса.\n\nФильтры те же, что у `/uiks`: можно посчитать результат по произвольному набору УИК,\nпо диапазону явки, по конкретной выгрузке и т.д. Для кандидатов процент и место считаются\nвнутри своего округа.","operationId":"results_api_v1_results_get","parameters":[{"name":"type","in":"query","required":false,"schema":{"enum":["candidates","parties"],"type":"string","default":"parties","title":"Type"}},{"name":"group_by","in":"query","required":false,"schema":{"enum":["none","okrug"],"type":"string","description":"okrug — отдельные итоги по каждому округу","default":"none","title":"Group By"},"description":"okrug — отдельные итоги по каждому округу"},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"type":"string","default":"json","title":"Format"}},{"name":"okrug","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Округ(а): `1`, `1,2,3`, `10-20`. Можно повторять параметр.","title":"Okrug"},"description":"Округ(а): `1`, `1,2,3`, `10-20`. Можно повторять параметр."},{"name":"uik","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Номер(а) УИК: `15`, `15,16`, `100-200`. Номер УИК уникален только внутри региона — без округа вернутся все УИК с таким номером.","title":"Uik"},"description":"Номер(а) УИК: `15`, `15,16`, `100-200`. Номер УИК уникален только внутри региона — без округа вернутся все УИК с таким номером."},{"name":"pair","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Точные пары округ:УИК — `1:15,1:16,171:74`.","title":"Pair"},"description":"Точные пары округ:УИК — `1:15,1:16,171:74`."},{"name":"commission_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"UUID комиссий через запятую.","title":"Commission Id"},"description":"UUID комиссий через запятую."},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Данные на момент выгрузки (например `download-1`). По умолчанию — последняя известная версия протокола.","title":"Download"},"description":"Данные на момент выгрузки (например `download-1`). По умолчанию — последняя известная версия протокола."},{"name":"voters_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Voters Min"}},{"name":"voters_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Voters Max"}},{"name":"ballots_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Ballots Min"}},{"name":"ballots_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Ballots Max"}},{"name":"invalid_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Invalid Min"}},{"name":"invalid_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Invalid Max"}},{"name":"turnout_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Явка от, %","title":"Turnout Min"},"description":"Явка от, %"},{"name":"turnout_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Явка до, %","title":"Turnout Max"},"description":"Явка до, %"},{"name":"changed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true — только УИК, где цифры протокола менялись; false — только неизменные","title":"Changed"},"description":"true — только УИК, где цифры протокола менялись; false — только неизменные"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Results"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/candidates":{"get":{"tags":["Кандидаты и партии"],"summary":"Кандидаты-одномандатники","description":"Кандидаты с итогами по своему округу (голоса, %, место).","operationId":"list_candidates_api_v1_candidates_get","parameters":[{"name":"okrug","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Округ(а): 1,2,10-20","title":"Okrug"},"description":"Округ(а): 1,2,10-20"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2},{"type":"null"}],"description":"Поиск по ФИО (часть строки)","title":"Q"},"description":"Поиск по ФИО (часть строки)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubjectList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/parties":{"get":{"tags":["Кандидаты и партии"],"summary":"Партии","description":"Партии с общими итогами по всем загруженным округам.","operationId":"list_parties_api_v1_parties_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubjectList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subjects/{subject_id}":{"get":{"tags":["Кандидаты и партии"],"summary":"Кандидат/партия: итоги по округам","description":"Итоги кандидата или партии. Для партии — дополнительно разбивка по всем округам.","operationId":"get_subject_api_v1_subjects__subject_id__get","parameters":[{"name":"subject_id","in":"path","required":true,"schema":{"type":"integer","title":"Subject Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/subjects/{subject_id}/uiks":{"get":{"tags":["Кандидаты и партии"],"summary":"Результаты кандидата/партии по каждому УИК","description":"Где кандидат/партия набрали больше/меньше всего. Поддерживает все фильтры `/uiks`.","operationId":"subject_uiks_api_v1_subjects__subject_id__uiks_get","parameters":[{"name":"subject_id","in":"path","required":true,"schema":{"type":"integer","title":"Subject Id"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"votes, percent, turnout, ballots, voters, okrug, uik; `-` — по убыванию","default":"-votes","title":"Sort"},"description":"votes, percent, turnout, ballots, voters, okrug, uik; `-` — по убыванию"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Per Page"}},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"type":"string","default":"json","title":"Format"}},{"name":"okrug","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Округ(а): `1`, `1,2,3`, `10-20`. Можно повторять параметр.","title":"Okrug"},"description":"Округ(а): `1`, `1,2,3`, `10-20`. Можно повторять параметр."},{"name":"uik","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Номер(а) УИК: `15`, `15,16`, `100-200`. Номер УИК уникален только внутри региона — без округа вернутся все УИК с таким номером.","title":"Uik"},"description":"Номер(а) УИК: `15`, `15,16`, `100-200`. Номер УИК уникален только внутри региона — без округа вернутся все УИК с таким номером."},{"name":"pair","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Точные пары округ:УИК — `1:15,1:16,171:74`.","title":"Pair"},"description":"Точные пары округ:УИК — `1:15,1:16,171:74`."},{"name":"commission_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"UUID комиссий через запятую.","title":"Commission Id"},"description":"UUID комиссий через запятую."},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Данные на момент выгрузки (например `download-1`). По умолчанию — последняя известная версия протокола.","title":"Download"},"description":"Данные на момент выгрузки (например `download-1`). По умолчанию — последняя известная версия протокола."},{"name":"voters_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Voters Min"}},{"name":"voters_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Voters Max"}},{"name":"ballots_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Ballots Min"}},{"name":"ballots_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Ballots Max"}},{"name":"invalid_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Invalid Min"}},{"name":"invalid_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Invalid Max"}},{"name":"turnout_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Явка от, %","title":"Turnout Min"},"description":"Явка от, %"},{"name":"turnout_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Явка до, %","title":"Turnout Max"},"description":"Явка до, %"},{"name":"changed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true — только УИК, где цифры протокола менялись; false — только неизменные","title":"Changed"},"description":"true — только УИК, где цифры протокола менялись; false — только неизменные"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubjectUiks"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/changes":{"get":{"tags":["Изменения протоколов"],"summary":"Протоколы, которые менялись","description":"Протоколы, у которых со временем появлялись новые версии (например, повторный протокол).\nДля каждого — первая и текущая версии и разница между ними.","operationId":"changes_api_v1_changes_get","parameters":[{"name":"okrug","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Округ(а): 1,2,10-20","title":"Okrug"},"description":"Округ(а): 1,2,10-20"},{"name":"type","in":"query","required":false,"schema":{"enum":["all","candidates","parties"],"type":"string","default":"all","title":"Type"}},{"name":"numbers_only","in":"query","required":false,"schema":{"type":"boolean","description":"true — только если менялись цифры; false — любые новые версии (включая только перевыпуск/SHA)","default":true,"title":"Numbers Only"},"description":"true — только если менялись цифры; false — любые новые версии (включая только перевыпуск/SHA)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/login":{"post":{"tags":["Админка"],"summary":"Login","operationId":"login_api_admin_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/logout":{"post":{"tags":["Админка"],"summary":"Logout","operationId":"logout_api_admin_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/me":{"get":{"tags":["Админка"],"summary":"Me","operationId":"me_api_admin_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/overview":{"get":{"tags":["Админка"],"summary":"Overview","operationId":"overview_api_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/imports":{"post":{"tags":["Админка"],"summary":"Загрузить CSV (можно несколько файлов)","operationId":"upload_api_admin_imports_post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_api_admin_imports_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Админка"],"summary":"List Imports","operationId":"list_imports_api_admin_imports_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/imports/{import_id}":{"get":{"tags":["Админка"],"summary":"Get Import","operationId":"get_import_api_admin_imports__import_id__get","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"integer","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/imports/{import_id}/cancel":{"post":{"tags":["Админка"],"summary":"Cancel Import","operationId":"cancel_import_api_admin_imports__import_id__cancel_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"integer","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/imports/{import_id}/retry":{"post":{"tags":["Админка"],"summary":"Retry Import","operationId":"retry_import_api_admin_imports__import_id__retry_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"integer","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/imports/{import_id}/rollback":{"post":{"tags":["Админка"],"summary":"Откатить данные импорта","description":"Удаляет все строки, добавленные этим импортом, и пересчитывает агрегаты.\nСтроки, которые уже были в базе раньше (дубли), не затрагиваются.","operationId":"rollback_api_admin_imports__import_id__rollback_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"integer","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/rebuild":{"post":{"tags":["Админка"],"summary":"Пересчитать агрегаты","operationId":"rebuild_api_admin_rebuild_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/reset":{"post":{"tags":["Админка"],"summary":"Удалить все данные","operationId":"reset_api_admin_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/cache/clear":{"post":{"tags":["Админка"],"summary":"Clear Cache","operationId":"clear_cache_api_admin_cache_clear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/okrugs":{"get":{"tags":["Админка"],"summary":"Admin Okrugs","operationId":"admin_okrugs_api_admin_okrugs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/okrugs/{okrug_id}":{"patch":{"tags":["Админка"],"summary":"Update Okrug","operationId":"update_okrug_api_admin_okrugs__okrug_id__patch","parameters":[{"name":"okrug_id","in":"path","required":true,"schema":{"type":"integer","title":"Okrug Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkrugIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/okrugs/bulk":{"post":{"tags":["Админка"],"summary":"Массово задать названия округов","operationId":"bulk_okrugs_api_admin_okrugs_bulk_post","requestBody":{"content":{"text/plain":{"schema":{"type":"string","title":"Csv Text","description":"Строки «номер;название;регион» (регион необязателен)"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/disk":{"get":{"tags":["Админка"],"summary":"Disk","operationId":"disk_api_admin_disk_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Body_upload_api_admin_imports_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files","description":".csv, .csv.gz или .zip"}},"type":"object","required":["files"],"title":"Body_upload_api_admin_imports_post"},"ChangeItem":{"properties":{"commission_id":{"type":"string","title":"Commission Id"},"okrug":{"type":"integer","title":"Okrug"},"uik":{"type":"integer","title":"Uik"},"type":{"type":"string","enum":["candidates","parties"],"title":"Type"},"versions":{"type":"integer","title":"Versions"},"content_versions":{"type":"integer","title":"Content Versions"},"current":{"$ref":"#/components/schemas/Protocol"},"first":{"$ref":"#/components/schemas/Protocol"},"diff":{"additionalProperties":true,"type":"object","title":"Diff","description":"Разница текущей и первой версий: поля и голоса"}},"type":"object","required":["commission_id","okrug","uik","type","versions","content_versions","current","first","diff"],"title":"ChangeItem"},"ChangeList":{"properties":{"meta":{"$ref":"#/components/schemas/PageMeta"},"items":{"items":{"$ref":"#/components/schemas/ChangeItem"},"type":"array","title":"Items"}},"type":"object","required":["meta","items"],"title":"ChangeList"},"Download":{"properties":{"code":{"type":"string","title":"Code"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"first_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Seen At"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At"},"observations":{"type":"integer","title":"Observations"},"protocols":{"type":"integer","title":"Protocols"}},"type":"object","required":["code","version","first_seen_at","last_seen_at","observations","protocols"],"title":"Download"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginIn":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginIn"},"OkrugBrief":{"properties":{"okrug":{"type":"integer","title":"Okrug"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"uik_count":{"type":"integer","title":"Uik Count"},"candidates":{"anyOf":[{"$ref":"#/components/schemas/Totals"},{"type":"null"}]},"parties":{"anyOf":[{"$ref":"#/components/schemas/Totals"},{"type":"null"}]},"candidates_leader":{"anyOf":[{"$ref":"#/components/schemas/ResultItem"},{"type":"null"}]},"parties_leader":{"anyOf":[{"$ref":"#/components/schemas/ResultItem"},{"type":"null"}]},"changed_protocols":{"type":"integer","title":"Changed Protocols"}},"type":"object","required":["okrug","name","region","uik_count","candidates","parties","changed_protocols"],"title":"OkrugBrief"},"OkrugDetail":{"properties":{"okrug":{"type":"integer","title":"Okrug"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"uik_count":{"type":"integer","title":"Uik Count"},"candidates":{"anyOf":[{"$ref":"#/components/schemas/Totals"},{"type":"null"}]},"parties":{"anyOf":[{"$ref":"#/components/schemas/Totals"},{"type":"null"}]},"candidates_leader":{"anyOf":[{"$ref":"#/components/schemas/ResultItem"},{"type":"null"}]},"parties_leader":{"anyOf":[{"$ref":"#/components/schemas/ResultItem"},{"type":"null"}]},"changed_protocols":{"type":"integer","title":"Changed Protocols"},"candidates_results":{"items":{"$ref":"#/components/schemas/ResultItem"},"type":"array","title":"Candidates Results"},"parties_results":{"items":{"$ref":"#/components/schemas/ResultItem"},"type":"array","title":"Parties Results"}},"type":"object","required":["okrug","name","region","uik_count","candidates","parties","changed_protocols","candidates_results","parties_results"],"title":"OkrugDetail"},"OkrugIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"region":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Region"}},"type":"object","title":"OkrugIn"},"PageMeta":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"pages":{"type":"integer","title":"Pages"},"download":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download","description":"Снимок выгрузки, если запрошен"}},"type":"object","required":["total","page","per_page","pages"],"title":"PageMeta"},"Protocol":{"properties":{"type":{"type":"string","enum":["candidates","parties"],"title":"Type","description":"candidates — одномандатный округ, parties — партийные списки"},"voters":{"type":"integer","title":"Voters","description":"Число избирателей в списке"},"ballots":{"type":"integer","title":"Ballots","description":"Число бюллетеней в ящиках"},"invalid":{"type":"integer","title":"Invalid","description":"Недействительных бюллетеней"},"valid":{"type":"integer","title":"Valid","description":"Действительных бюллетеней (ballots - invalid)"},"turnout":{"type":"number","title":"Turnout","description":"Явка, % (ballots / voters)"},"sha256":{"type":"string","title":"Sha256","description":"SHA256 протокола"},"cik_created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cik Created At","description":"Когда протокол создан в ЦИК (UTC)"},"first_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Seen At","description":"Когда эту версию впервые увидели (UTC)"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At","description":"Когда эту версию видели последний раз (UTC)"},"versions":{"type":"integer","title":"Versions","description":"Сколько разных версий (SHA) протокола было у УИК"},"content_versions":{"type":"integer","title":"Content Versions","description":"Сколько версий различались по цифрам"},"changed":{"type":"boolean","title":"Changed","description":"Цифры протокола менялись со временем"},"leader":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leader","description":"Лидер по голосам (если запрошены голоса)"},"votes":{"anyOf":[{"items":{"$ref":"#/components/schemas/VoteItem"},"type":"array"},{"type":"null"}],"title":"Votes"}},"type":"object","required":["type","voters","ballots","invalid","valid","turnout","sha256","versions","content_versions","changed"],"title":"Protocol"},"ProtocolVersion":{"properties":{"type":{"type":"string","enum":["candidates","parties"],"title":"Type","description":"candidates — одномандатный округ, parties — партийные списки"},"voters":{"type":"integer","title":"Voters","description":"Число избирателей в списке"},"ballots":{"type":"integer","title":"Ballots","description":"Число бюллетеней в ящиках"},"invalid":{"type":"integer","title":"Invalid","description":"Недействительных бюллетеней"},"valid":{"type":"integer","title":"Valid","description":"Действительных бюллетеней (ballots - invalid)"},"turnout":{"type":"number","title":"Turnout","description":"Явка, % (ballots / voters)"},"sha256":{"type":"string","title":"Sha256","description":"SHA256 протокола"},"cik_created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cik Created At","description":"Когда протокол создан в ЦИК (UTC)"},"first_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Seen At","description":"Когда эту версию впервые увидели (UTC)"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At","description":"Когда эту версию видели последний раз (UTC)"},"versions":{"type":"integer","title":"Versions","description":"Сколько разных версий (SHA) протокола было у УИК"},"content_versions":{"type":"integer","title":"Content Versions","description":"Сколько версий различались по цифрам"},"changed":{"type":"boolean","title":"Changed","description":"Цифры протокола менялись со временем"},"leader":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leader","description":"Лидер по голосам (если запрошены голоса)"},"votes":{"anyOf":[{"items":{"$ref":"#/components/schemas/VoteItem"},"type":"array"},{"type":"null"}],"title":"Votes"},"observations":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Observations","description":"Когда и в какой выгрузке видели версию"},"is_current":{"type":"boolean","title":"Is Current"},"diff":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Diff","description":"Отличия от предыдущей версии"}},"type":"object","required":["type","voters","ballots","invalid","valid","turnout","sha256","versions","content_versions","changed","is_current"],"title":"ProtocolVersion"},"ResetIn":{"properties":{"confirm":{"type":"string","title":"Confirm","description":"Для подтверждения передайте строку DELETE"}},"type":"object","required":["confirm"],"title":"ResetIn"},"ResultGroup":{"properties":{"okrug":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Okrug"},"okrug_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Okrug Name"},"totals":{"$ref":"#/components/schemas/Totals"},"results":{"items":{"$ref":"#/components/schemas/ResultItem"},"type":"array","title":"Results"}},"type":"object","required":["totals","results"],"title":"ResultGroup"},"ResultItem":{"properties":{"subject_id":{"type":"integer","title":"Subject Id"},"name":{"type":"string","title":"Name"},"okrug":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Okrug","description":"Округ кандидата (для партий — null)"},"votes":{"type":"integer","title":"Votes"},"percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Percent"},"place":{"type":"integer","title":"Place"}},"type":"object","required":["subject_id","name","votes","percent","place"],"title":"ResultItem"},"Results":{"properties":{"type":{"type":"string","enum":["candidates","parties"],"title":"Type"},"download":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"},"group_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group By"},"totals":{"$ref":"#/components/schemas/Totals"},"results":{"anyOf":[{"items":{"$ref":"#/components/schemas/ResultItem"},"type":"array"},{"type":"null"}],"title":"Results"},"groups":{"anyOf":[{"items":{"$ref":"#/components/schemas/ResultGroup"},"type":"array"},{"type":"null"}],"title":"Groups"}},"type":"object","required":["type","totals"],"title":"Results"},"Stats":{"properties":{"okrugs":{"type":"integer","title":"Okrugs"},"uiks":{"type":"integer","title":"Uiks"},"protocols_current":{"additionalProperties":{"type":"integer"},"type":"object","title":"Protocols Current"},"protocol_versions":{"type":"integer","title":"Protocol Versions"},"observations":{"type":"integer","title":"Observations"},"changed_protocols":{"additionalProperties":{"type":"integer"},"type":"object","title":"Changed Protocols"},"downloads":{"items":{"$ref":"#/components/schemas/Download"},"type":"array","title":"Downloads"},"totals":{"additionalProperties":{"$ref":"#/components/schemas/Totals"},"type":"object","title":"Totals"},"last_import_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Import At"}},"type":"object","required":["okrugs","uiks","protocols_current","protocol_versions","observations","changed_protocols","downloads","totals","last_import_at"],"title":"Stats"},"Subject":{"properties":{"subject_id":{"type":"integer","title":"Subject Id"},"type":{"type":"string","enum":["candidates","parties"],"title":"Type"},"name":{"type":"string","title":"Name"},"okrug":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Okrug"},"votes":{"type":"integer","title":"Votes"},"percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Percent"},"place":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Place","description":"Место в округе (для кандидатов) / по стране (для партий)"},"uik_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uik Count"}},"type":"object","required":["subject_id","type","name","okrug","votes","percent"],"title":"Subject"},"SubjectList":{"properties":{"total":{"type":"integer","title":"Total"},"items":{"items":{"$ref":"#/components/schemas/Subject"},"type":"array","title":"Items"}},"type":"object","required":["total","items"],"title":"SubjectList"},"SubjectUikItem":{"properties":{"commission_id":{"type":"string","title":"Commission Id"},"okrug":{"type":"integer","title":"Okrug"},"uik":{"type":"integer","title":"Uik"},"votes":{"type":"integer","title":"Votes"},"percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Percent"},"ballots":{"type":"integer","title":"Ballots"},"voters":{"type":"integer","title":"Voters"},"turnout":{"type":"number","title":"Turnout"},"place":{"type":"integer","title":"Place","description":"Место субъекта на этом УИК"}},"type":"object","required":["commission_id","okrug","uik","votes","percent","ballots","voters","turnout","place"],"title":"SubjectUikItem"},"SubjectUiks":{"properties":{"subject":{"$ref":"#/components/schemas/Subject"},"meta":{"$ref":"#/components/schemas/PageMeta"},"items":{"items":{"$ref":"#/components/schemas/SubjectUikItem"},"type":"array","title":"Items"}},"type":"object","required":["subject","meta","items"],"title":"SubjectUiks"},"Totals":{"properties":{"uik_count":{"type":"integer","title":"Uik Count"},"voters":{"type":"integer","title":"Voters"},"ballots":{"type":"integer","title":"Ballots"},"invalid":{"type":"integer","title":"Invalid"},"valid":{"type":"integer","title":"Valid"},"turnout":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Turnout"}},"type":"object","required":["uik_count","voters","ballots","invalid","valid","turnout"],"title":"Totals"},"Uik":{"properties":{"commission_id":{"type":"string","title":"Commission Id","description":"UUID комиссии в системе ЦИК — глобально уникален"},"okrug":{"type":"integer","title":"Okrug","description":"Номер одномандатного округа"},"okrug_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Okrug Name"},"uik":{"type":"integer","title":"Uik","description":"Номер УИК (уникален только внутри региона/округа!)"},"protocols":{"additionalProperties":{"$ref":"#/components/schemas/Protocol"},"type":"object","title":"Protocols","description":"Ключ — тип протокола: candidates / parties"},"history":{"anyOf":[{"additionalProperties":{"items":{"$ref":"#/components/schemas/ProtocolVersion"},"type":"array"},"type":"object"},{"type":"null"}],"title":"History"}},"type":"object","required":["commission_id","okrug","uik","protocols"],"title":"Uik"},"UikList":{"properties":{"meta":{"$ref":"#/components/schemas/PageMeta"},"items":{"items":{"$ref":"#/components/schemas/Uik"},"type":"array","title":"Items"},"not_found":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Not Found","description":"Запрошенные явно пары/ID, которых нет в базе"}},"type":"object","required":["meta","items"],"title":"UikList"},"UikQuery":{"properties":{"okrugs":{"items":{"anyOf":[{"type":"integer"},{"type":"string"}]},"type":"array","title":"Okrugs","description":"Номера или диапазоны: [1, 2, \"10-20\"]"},"uiks":{"items":{"anyOf":[{"type":"integer"},{"type":"string"}]},"type":"array","title":"Uiks","description":"Номера УИК или диапазоны"},"pairs":{"items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"}]},"type":"array","title":"Pairs","description":"Точные пары: [{\"okrug\": 1, \"uik\": 15}] или [\"1:15\"]"},"commission_ids":{"items":{"type":"string"},"type":"array","title":"Commission Ids","description":"UUID комиссий"},"type":{"type":"string","enum":["all","candidates","parties"],"title":"Type","default":"all"},"download":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"},"basis":{"anyOf":[{"type":"string","enum":["candidates","parties"]},{"type":"null"}],"title":"Basis"},"votes":{"type":"boolean","title":"Votes","default":true},"history":{"type":"boolean","title":"History","default":false},"voters_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Voters Min"},"voters_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Voters Max"},"ballots_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ballots Min"},"ballots_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ballots Max"},"invalid_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Invalid Min"},"invalid_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Invalid Max"},"turnout_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Turnout Min"},"turnout_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Turnout Max"},"changed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Changed"},"sort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"},"page":{"type":"integer","minimum":1.0,"title":"Page","default":1},"per_page":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Per Page","default":100}},"type":"object","title":"UikQuery","description":"Тело POST /uiks/query — те же фильтры, что в GET /uiks, но удобно для больших списков.","examples":[{"pairs":[{"okrug":1,"uik":15},"1:16","171:74"],"type":"all","votes":true}]},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VoteItem":{"properties":{"subject_id":{"type":"integer","title":"Subject Id","description":"ID кандидата/партии в этом API"},"name":{"type":"string","title":"Name"},"votes":{"type":"integer","title":"Votes"},"percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Percent","description":"% от числа бюллетеней в ящиках"}},"type":"object","required":["subject_id","name","votes"],"title":"VoteItem"}}},"tags":[{"name":"УИК","description":"Получение данных по одному или многим УИК"},{"name":"Результаты","description":"Суммарные итоги по произвольным выборкам"},{"name":"Округа"},{"name":"Кандидаты и партии"},{"name":"Изменения протоколов"},{"name":"Общее"},{"name":"Админка","description":"Требуется вход (cookie или Bearer-токен из /api/admin/login)"}]}