{
  "openapi": "3.0.1",
  "info": {
    "title": "Preços do Governo — Pesquisa de Preços CATMAT (Brasil)",
    "description": "Quanto o governo paga por item: preços homologados do Compras.gov.br com mediana, média saneada e fornecedores. Pesquisa de preços Lei 14.133.",
    "version": "1.0",
    "x-build-id": "1Mg69vjwPF5DEUhV0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kodama-data~precos-governo-pesquisa-precos/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kodama-data-precos-governo-pesquisa-precos",
        "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~precos-governo-pesquisa-precos/runs": {
      "post": {
        "operationId": "runs-sync-kodama-data-precos-governo-pesquisa-precos",
        "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~precos-governo-pesquisa-precos/run-sync": {
      "post": {
        "operationId": "run-sync-kodama-data-precos-governo-pesquisa-precos",
        "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": {
          "searchTerms": {
            "title": "Itens a pesquisar (termos)",
            "type": "array",
            "description": "Nome do material como no catálogo CATMAT (sem acento também funciona). Cada termo vira os PDMs (famílias de itens) mais próximos. Ex.: [\"café\", \"açúcar\", \"papel a4\"].",
            "items": {
              "type": "string"
            }
          },
          "preset": {
            "title": "Pacote pronto de itens (opcional)",
            "enum": [
              "nenhum",
              "copa-cozinha-vending",
              "limpeza",
              "escritorio",
              "alimentacao-escolar"
            ],
            "type": "string",
            "description": "Soma uma lista pronta de itens aos seus termos.",
            "default": "nenhum"
          },
          "catalogCodes": {
            "title": "Códigos CATMAT (opcional)",
            "type": "array",
            "description": "Códigos exatos: pdm:19766 (família) ou item:463594 (item). Números só com até 5 dígitos são tratados como PDM; com 6+ como item.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Data inicial da compra",
            "type": "string",
            "description": "AAAA-MM-DD ou relativo (ex.: -90d). Padrão: 180 dias antes da data final. A IN 65/2021 aceita preços de até 1 ano."
          },
          "dateTo": {
            "title": "Data final da compra",
            "type": "string",
            "description": "AAAA-MM-DD. Padrão: hoje."
          },
          "ufs": {
            "title": "UFs (opcional)",
            "type": "array",
            "description": "Siglas, ex.: [\"SP\", \"MG\"]. Vazio = Brasil todo.",
            "items": {
              "type": "string"
            }
          },
          "codigoMunicipio": {
            "title": "Código IBGE do município (opcional)",
            "type": "integer",
            "description": "Ex.: 3556701 (Vinhedo/SP)."
          },
          "esferas": {
            "title": "Esferas (opcional)",
            "type": "array",
            "description": "F = federal, E = estadual, M = municipal. Vazio = todas.",
            "items": {
              "type": "string"
            }
          },
          "descriptionContains": {
            "title": "Descrição do item deve conter (opcional)",
            "type": "array",
            "description": "Mantém só itens cuja descrição tenha um destes termos. Ex.: [\"torrado moído\", \"500 g\"].",
            "items": {
              "type": "string"
            }
          },
          "excludeDescription": {
            "title": "Excluir se descrição/objeto contiver",
            "type": "array",
            "description": "Ex.: [\"solúvel\", \"cápsula\"].",
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Saída",
            "enum": [
              "ambos",
              "resumo",
              "precos"
            ],
            "type": "string",
            "description": "\"ambos\" = linhas de resumo estatístico por item + cada preço; \"resumo\" = só estatística (barato); \"precos\" = só preços.",
            "default": "ambos"
          },
          "minSamplesForSummary": {
            "title": "Mínimo de preços para gerar resumo",
            "minimum": 1,
            "type": "integer",
            "description": "A IN 65/2021 pede no mínimo 3 preços.",
            "default": 3
          },
          "maxPdmsPerTerm": {
            "title": "Máx. de PDMs por termo",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Quantas famílias de itens (PDMs) do CATMAT usar por termo pesquisado.",
            "default": 2
          },
          "catalogGroups": {
            "title": "Restringir a grupos CATMAT (opcional)",
            "type": "array",
            "description": "Ex.: [\"89\"] = alimentos (subsistência); [\"75\"] = escritório; [\"79\"] = limpeza.",
            "items": {
              "type": "string"
            }
          },
          "maxPagesPerCode": {
            "title": "Máx. de páginas (500 preços) por código e UF",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Limite de páginas (500 preços cada) por código CATMAT e UF.",
            "default": 6
          },
          "maxResults": {
            "title": "Máx. de linhas de preço entregues",
            "minimum": 1,
            "type": "integer",
            "description": "Limite de linhas de preço entregues no dataset.",
            "default": 5000
          },
          "onlyNew": {
            "title": "Só novidades (modo alerta)",
            "type": "boolean",
            "description": "Entrega só preços ainda não entregues em execuções anteriores com o mesmo stateKey. Agende diário/semanal.",
            "default": false
          },
          "stateKey": {
            "title": "Nome do monitor (onlyNew)",
            "type": "string",
            "description": "Nome do monitor para o modo só-novidades (um por cliente/tema).",
            "default": "padrao"
          },
          "delaySeconds": {
            "title": "Pausa entre chamadas (s)",
            "type": "number",
            "description": "Pausa em segundos entre chamadas à API pública (rate limit educado).",
            "default": 0.8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}