{
  "openapi": "3.0.1",
  "info": {
    "title": "Diários Oficiais Brasil — DOU + Municipais, Alertas",
    "description": "Monitore o Diário Oficial da União e diários de centenas de prefeituras por palavra-chave, cidade e UF. Modo só-novidades para alertas diários.",
    "version": "1.0",
    "x-build-id": "IOhalvkETxvvpq6IC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kodama-data~diarios-oficiais-monitor-brasil/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kodama-data-diarios-oficiais-monitor-brasil",
        "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/kodama-data~diarios-oficiais-monitor-brasil/runs": {
      "post": {
        "operationId": "runs-sync-kodama-data-diarios-oficiais-monitor-brasil",
        "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/kodama-data~diarios-oficiais-monitor-brasil/run-sync": {
      "post": {
        "operationId": "run-sync-kodama-data-diarios-oficiais-monitor-brasil",
        "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",
        "properties": {
          "keywords": {
            "title": "Palavras-chave / Keywords",
            "type": "array",
            "description": "Termos a procurar. Expressões com espaço viram busca por frase exata. Sem acento também funciona. Ex.: [\"vending\", \"máquinas de café\", \"nome da sua empresa\"].",
            "items": {
              "type": "string"
            }
          },
          "preset": {
            "title": "Pacote pronto de termos (opcional)",
            "enum": [
              "nenhum",
              "vending-alimentacao",
              "concursos",
              "licitacoes-ti",
              "saude-hospitalar"
            ],
            "type": "string",
            "description": "Soma um conjunto de termos prontos às suas palavras-chave.",
            "default": "nenhum"
          },
          "sources": {
            "title": "Fontes",
            "type": "array",
            "description": "\"dou\" = Diário Oficial da União; \"municipais\" = diários oficiais municipais via Querido Diário.",
            "default": [
              "dou",
              "municipais"
            ]
          },
          "dateFrom": {
            "title": "Data inicial",
            "type": "string",
            "description": "AAAA-MM-DD ou relativo, ex.: -7d. Padrão: 1 dia antes da data final. Máximo de 92 dias por execução."
          },
          "dateTo": {
            "title": "Data final",
            "type": "string",
            "description": "AAAA-MM-DD. Padrão: hoje."
          },
          "cities": {
            "title": "Cidades (diários municipais)",
            "type": "array",
            "description": "Ex.: [\"Campinas-SP\", \"Jundiaí-SP\"] ou códigos IBGE de 7 dígitos. Vazio = todos os municípios cobertos pelo Querido Diário.",
            "items": {
              "type": "string"
            }
          },
          "ufs": {
            "title": "UFs",
            "type": "array",
            "description": "Filtra por estado, ex.: [\"SP\", \"MG\"]. No DOU, o estado é deduzido do órgão/município quando possível.",
            "items": {
              "type": "string"
            }
          },
          "keepFederalWhenUfFilter": {
            "title": "Manter atos federais sem UF ao filtrar por estado",
            "type": "boolean",
            "description": "Atos do DOU sem estado identificável (ex.: ministérios) continuam no resultado.",
            "default": true
          },
          "douSections": {
            "title": "Seções do DOU",
            "type": "array",
            "description": "do1 (atos normativos), do2 (atos de pessoal — contém nomes de servidores, desligado por padrão), do3 (contratos, licitações, editais), extra.",
            "default": [
              "do1",
              "do3",
              "extra"
            ]
          },
          "douActTypes": {
            "title": "Tipos de ato do DOU (opcional)",
            "type": "array",
            "description": "Filtra pelo tipo, sem acento e por trecho. Ex.: [\"aviso de licitacao\", \"extrato de contrato\", \"portaria\"].",
            "items": {
              "type": "string"
            }
          },
          "orgaoContains": {
            "title": "Órgão / município contém (opcional)",
            "type": "array",
            "description": "Ex.: [\"universidade\", \"saude\", \"campinas\"].",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Excluir quando contiver",
            "type": "array",
            "description": "Remove publicações que contenham estes termos. Ex.: [\"café da manhã\"].",
            "items": {
              "type": "string"
            }
          },
          "wholeWord": {
            "title": "Palavra inteira",
            "type": "boolean",
            "description": "Confere a palavra inteira (sem acento) no trecho, para cortar falsos positivos tipo 'CAF' para 'café'.",
            "default": true
          },
          "onlyNew": {
            "title": "Só novidades (modo alerta)",
            "type": "boolean",
            "description": "Entrega só o que não foi entregue em execuções anteriores com a mesma chave. Agende diariamente e receba só o que é novo.",
            "default": false
          },
          "stateKey": {
            "title": "Chave do monitor",
            "type": "string",
            "description": "Nome do monitor para o modo só-novidades (um por cliente/tema).",
            "default": "padrao"
          },
          "maxResults": {
            "title": "Máximo de resultados",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Limite de publicações entregues no dataset.",
            "default": 500
          },
          "douMaxPagesPerKeyword": {
            "title": "Páginas do DOU por termo (50 por página)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Quantas páginas de resultados do DOU buscar por termo (50 publicações por página).",
            "default": 4
          },
          "municipalMaxPagesPerKeyword": {
            "title": "Páginas municipais por termo (100 por página)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Quantas páginas do Querido Diário buscar por termo (100 diários por página).",
            "default": 3
          },
          "excerptsPerGazette": {
            "title": "Trechos por diário municipal",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Quantos trechos com o termo extrair de cada diário municipal.",
            "default": 3
          },
          "delaySeconds": {
            "title": "Intervalo entre chamadas (s)",
            "type": "number",
            "description": "Coleta educada nas fontes públicas.",
            "default": 1.2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}