{
  "openapi": "3.0.1",
  "info": {
    "title": "Diário Oficial da União — Busca e Monitoramento (DOU)",
    "description": "Pesquise e monitore publicações do DOU por palavra-chave, órgão ou data. Licitações, portarias, nomeações, contratos. Seções 1, 2 e 3. Atualizado diariamente.",
    "version": "1.0",
    "x-build-id": "XBGrlmGqLVyhnIbfW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jenko_systems~diario-oficial-uniao-dou/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jenko_systems-diario-oficial-uniao-dou",
        "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/jenko_systems~diario-oficial-uniao-dou/runs": {
      "post": {
        "operationId": "runs-sync-jenko_systems-diario-oficial-uniao-dou",
        "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/jenko_systems~diario-oficial-uniao-dou/run-sync": {
      "post": {
        "operationId": "run-sync-jenko_systems-diario-oficial-uniao-dou",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Modo de consulta",
            "enum": [
              "hoje",
              "busca",
              "orgao",
              "monitorar"
            ],
            "type": "string",
            "description": "O que deseja consultar. Campos vazios recebem um exemplo (indicado em 'defaults_used' no resultado). Campos de cada modo:\n• Hoje: data (vazio = hoje), seção\n• Busca: termo (vazio = 'licitação'), data inicial/final\n• Órgão: órgão (vazio = Ministério da Saúde), últimos N dias\n• Monitorar: lista de termos (vazio = licitação, pregão eletrônico, nomeação), últimos N dias",
            "default": "busca"
          },
          "secao": {
            "title": "Seção do DOU",
            "enum": [
              "todos",
              "do1",
              "do2",
              "do3"
            ],
            "type": "string",
            "description": "Seção 1: atos normativos. Seção 2: atos pessoais. Seção 3: contratos e licitações.",
            "default": "todos"
          },
          "data": {
            "title": "Data (modo Hoje)",
            "type": "string",
            "description": "Data da edição no formato AAAA-MM-DD. Vazio = hoje (horário de Brasília)."
          },
          "termo": {
            "title": "Termo de busca",
            "type": "string",
            "description": "Palavra ou frase para buscar (sem diferenciar maiúsculas e acentos: 'licitacao' encontra 'licitação'). Busca no título, no trecho inicial do ato e no nome do órgão. Ex: licitacao, VALE S.A., ANVISA Vazio no modo Busca = 'licitação'."
          },
          "termos": {
            "title": "Lista de termos (modo Monitorar)",
            "type": "array",
            "description": "Lista de termos para monitorar. Cada termo gera uma busca separada. Vazio no modo Monitorar = licitação, pregão eletrônico, nomeação.",
            "items": {
              "type": "string"
            }
          },
          "orgao": {
            "title": "Órgão",
            "type": "string",
            "description": "Nome, parte do nome ou sigla do órgão. Comparado com a hierarquia oficial e o título do ato (não com o corpo do texto). Ex: ANVISA, Ministério da Fazenda, Vigilância Sanitária. Vazio no modo Órgão = Ministério da Saúde."
          },
          "data_inicio": {
            "title": "Data inicial",
            "type": "string",
            "description": "Início do período (AAAA-MM-DD). Padrão: 7 dias antes da data final. Períodos maiores que 92 dias são cortados."
          },
          "data_fim": {
            "title": "Data final",
            "type": "string",
            "description": "Fim do período no formato AAAA-MM-DD. Padrão: hoje."
          },
          "dias": {
            "title": "Últimos N dias",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Quantos dias atrás buscar (modos Órgão e Monitorar). Máximo efetivo de 92 dias por run.",
            "default": 7
          },
          "max_resultados": {
            "title": "Máximo de resultados",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Número máximo de publicações a retornar.",
            "default": 50
          },
          "texto_completo": {
            "title": "Incluir texto completo",
            "type": "boolean",
            "description": "Baixa o texto integral de cada ato (uma página extra por resultado — mais lento). Desligado, o campo 'ementa' traz só o trecho inicial (~400 caracteres).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}