{
  "openapi": "3.0.1",
  "info": {
    "title": "Petrobras Contratos Scraper Actor",
    "description": "Este Actor consulta contratos disponíveis no Portal da Transparência da Petrobras e transforma os dados retornados pelo portal em uma estrutura JSON padronizada, pronta para integração com agentes de IA, sistemas internos, APIs, automações e ferramentas de análise.",
    "version": "0.0",
    "x-build-id": "zJ9cG3CuB2uWct7PN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/persistent_backpack~petrobras-contratos-scraper-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-persistent_backpack-petrobras-contratos-scraper-actor",
        "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/persistent_backpack~petrobras-contratos-scraper-actor/runs": {
      "post": {
        "operationId": "runs-sync-persistent_backpack-petrobras-contratos-scraper-actor",
        "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/persistent_backpack~petrobras-contratos-scraper-actor/run-sync": {
      "post": {
        "operationId": "run-sync-persistent_backpack-petrobras-contratos-scraper-actor",
        "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": {
          "numeroContrato": {
            "title": "Número do contrato",
            "type": "string",
            "description": "Número completo ou parcial do contrato."
          },
          "numeroProcesso": {
            "title": "Número do processo",
            "type": "string",
            "description": "Número completo ou parcial do processo administrativo associado ao contrato."
          },
          "numeroIcj": {
            "title": "Número do ICJ",
            "type": "string",
            "description": "Número completo ou parcial do ICJ associado ao contrato."
          },
          "fornecedor": {
            "title": "Fornecedor",
            "type": "string",
            "description": "Nome completo ou parcial do fornecedor."
          },
          "cnpjCpf": {
            "title": "CNPJ ou CPF",
            "type": "string",
            "description": "Apenas números ou com máscara; deve conter 11 (CPF) ou 14 (CNPJ) dígitos."
          },
          "objeto": {
            "title": "Objeto da contratação",
            "type": "string",
            "description": "Palavra ou trecho do objeto contratual."
          },
          "unidadeAdministrativa": {
            "title": "Unidade(s) administrativa(s)",
            "type": "array",
            "description": "Uma ou mais unidades administrativas a filtrar.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "situacaoCodigo": {
            "title": "Código da situação",
            "type": "string",
            "description": "Código da situação do contrato conforme opções do portal. Use \"0\" para não filtrar.",
            "default": "0"
          },
          "enquadramentoCodigo": {
            "title": "Código do enquadramento",
            "type": "integer",
            "description": "Código do enquadramento do processo. Use 0 para não filtrar.",
            "default": 0
          },
          "inicioVigenciaDe": {
            "title": "Início da vigência - de",
            "type": "string",
            "description": "Formato AAAA-MM-DD."
          },
          "inicioVigenciaAte": {
            "title": "Início da vigência - até",
            "type": "string",
            "description": "Formato AAAA-MM-DD."
          },
          "fimVigenciaDe": {
            "title": "Fim da vigência - de",
            "type": "string",
            "description": "Formato AAAA-MM-DD."
          },
          "fimVigenciaAte": {
            "title": "Fim da vigência - até",
            "type": "string",
            "description": "Formato AAAA-MM-DD."
          },
          "valorContratoDe": {
            "title": "Valor do contrato - mínimo",
            "type": "string",
            "description": "Aceita 10000, 10000.50 ou 10.000,50."
          },
          "valorContratoAte": {
            "title": "Valor do contrato - máximo",
            "type": "string",
            "description": "Aceita 10000, 10000.50 ou 10.000,50."
          },
          "pageSize": {
            "title": "Tamanho da página",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Quantidade solicitada por página ao portal. Normalizado internamente para o intervalo 10-100.",
            "default": 10
          },
          "limite": {
            "title": "Limite total de registros",
            "type": "integer",
            "description": "Máximo total de registros a retornar. Deixe em branco para buscar todos os registros informados pelo portal."
          },
          "formato": {
            "title": "Formato da saída",
            "enum": [
              "json"
            ],
            "type": "string",
            "description": "Formato principal da saída (atualmente apenas JSON).",
            "default": "json"
          },
          "incluirBruto": {
            "title": "Incluir registros brutos",
            "type": "boolean",
            "description": "Também grava os registros sem a normalização final, para auditoria/depuração.",
            "default": false
          },
          "proxyConfig": {
            "title": "Configuração de proxy",
            "type": "object",
            "description": "Proxy da Apify a ser usado no contexto do Playwright. Recomendado para execuções recorrentes ou de maior volume.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}