{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Election Candidates and Assets (TSE): candidatos e bens",
    "description": "Candidatos e bens declarados das eleições de 2018, 2020, 2022 e 2024 (dados abertos do TSE, CC-BY), por estado, cargo, partido ou nome. Sem CPF nem título de eleitor. JSON, CSV ou Excel.",
    "version": "0.0",
    "x-build-id": "jFWUMhgfRv6yBap5Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/soleene~brazil-election-candidates-and-assets-tse-candidatos-e-bens/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-soleene-brazil-election-candidates-and-assets-tse-candidatos-e-bens",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/soleene~brazil-election-candidates-and-assets-tse-candidatos-e-bens/runs": {
      "post": {
        "operationId": "runs-sync-soleene-brazil-election-candidates-and-assets-tse-candidatos-e-bens",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/soleene~brazil-election-candidates-and-assets-tse-candidatos-e-bens/run-sync": {
      "post": {
        "operationId": "run-sync-soleene-brazil-election-candidates-and-assets-tse-candidatos-e-bens",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "ano",
          "tipo",
          "uf"
        ],
        "properties": {
          "ano": {
            "title": "Ano da eleição",
            "enum": [
              "2018",
              "2020",
              "2022",
              "2024"
            ],
            "type": "string",
            "description": "2018 e 2022 são eleições gerais (presidente, governador, senador, deputados). 2020 e 2024 são municipais (prefeito, vice, vereador). Os arquivos de 2020 e 2024 são grandes (de 45 a 85 MB).",
            "default": "2022"
          },
          "tipo": {
            "title": "O que devolver",
            "enum": [
              "candidatos",
              "bens"
            ],
            "type": "string",
            "description": "candidatos: um registro por candidatura. bens: um registro por bem declarado, com o nome, cargo e partido de quem declarou.",
            "default": "candidatos"
          },
          "uf": {
            "title": "Estado",
            "enum": [
              "AC",
              "AL",
              "AP",
              "AM",
              "BA",
              "CE",
              "DF",
              "ES",
              "GO",
              "MA",
              "MT",
              "MS",
              "MG",
              "PA",
              "PB",
              "PR",
              "PE",
              "PI",
              "RJ",
              "RN",
              "RS",
              "RO",
              "RR",
              "SC",
              "SP",
              "SE",
              "TO",
              "BR"
            ],
            "type": "string",
            "description": "Sigla do estado. BR traz presidente e vice nas eleições gerais (2018 e 2022).",
            "default": "AP"
          },
          "cargo": {
            "title": "Cargo (opcional)",
            "type": "string",
            "description": "Parte do nome do cargo, sem diferenciar acento nem maiúscula. Exemplos: governador, deputado federal, prefeito, vereador."
          },
          "partido": {
            "title": "Partido (opcional)",
            "type": "string",
            "description": "Sigla do partido como o TSE publica. Exemplos: PT, PL, MDB."
          },
          "nome": {
            "title": "Nome (opcional)",
            "type": "string",
            "description": "Parte do nome de registro ou do nome de urna. Pelo menos 3 letras."
          },
          "municipio": {
            "title": "Município (opcional)",
            "type": "string",
            "description": "Parte do nome do município. Só faz sentido nas eleições municipais (2020 e 2024); nas gerais o campo do TSE é o estado."
          },
          "apenasEleitos": {
            "title": "Só eleitos",
            "type": "boolean",
            "description": "Mantém só quem o TSE marca como eleito (inclui eleito por QP e por média).",
            "default": false
          },
          "valorMinimo": {
            "title": "Valor mínimo do bem em reais (opcional, só para bens)",
            "minimum": 0,
            "type": "number",
            "description": "Descarta bens abaixo desse valor."
          },
          "mascararDadosPessoais": {
            "title": "Mascarar CPF, placa e RENAVAM no texto",
            "type": "boolean",
            "description": "Ligado por padrão. A descrição dos bens é texto livre e pode trazer placa e RENAVAM de veículos; esses números e qualquer CPF saem como *** ou ***.456.789-**. Desligue para manter o texto como a fonte publica.",
            "default": true
          },
          "limite": {
            "title": "Limite de registros",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Máximo de registros nesta execução. O padrão é pequeno para teste. O teto é 10.000.",
            "default": 20
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}