{
  "openapi": "3.0.1",
  "info": {
    "title": "Atas para Carona — PNCP",
    "description": "Atas de Registro de Preço vigentes no PNCP abertas a adesão (carona), com itens, preços, fornecedores com privacidade, vigência e score de oportunidade. Busca por UF, município, objeto e fornecedor; acompanhamento semanal de mudanças.",
    "version": "0.1",
    "x-build-id": "4cpc6JYVq3hlG50Rv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kman-br~atas-carona-pncp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kman-br-atas-carona-pncp",
        "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/kman-br~atas-carona-pncp/runs": {
      "post": {
        "operationId": "runs-sync-kman-br-atas-carona-pncp",
        "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/kman-br~atas-carona-pncp/run-sync": {
      "post": {
        "operationId": "run-sync-kman-br-atas-carona-pncp",
        "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": {
          "modo": {
            "title": "Modo",
            "enum": [
              "busca",
              "diff_semanal"
            ],
            "type": "string",
            "description": "busca: atas vigentes que passam nos filtros, ordenadas pelo score. diff_semanal: compara com o run anterior com os mesmos filtros e devolve só atas novas, canceladas ou com até 30 dias de vigência.",
            "default": "busca"
          },
          "palavras_chave": {
            "title": "Palavras-chave",
            "type": "array",
            "description": "Qualquer uma no objeto da ata (sem diferença de acento ou maiúscula). Ex.: notebook, ambulância, medicamento.",
            "items": {
              "type": "string"
            }
          },
          "uf": {
            "title": "UF do órgão gerenciador",
            "type": "array",
            "description": "Siglas (ex.: SP, MG). Vazio = todas. A listagem do PNCP não filtra UF: o Actor lê o detalhe de cada ata (com cache por órgão).",
            "default": [
              "SP"
            ],
            "items": {
              "type": "string"
            }
          },
          "municipios_ibge": {
            "title": "Municípios (código IBGE)",
            "type": "array",
            "description": "Códigos IBGE de 7 dígitos do município da unidade gerenciadora (ex.: 3550308 = São Paulo).",
            "items": {
              "type": "string"
            }
          },
          "esferas": {
            "title": "Esferas",
            "type": "array",
            "description": "federal, estadual, municipal ou distrital. Vazio = todas.",
            "items": {
              "type": "string"
            }
          },
          "vigencia_minima_dias": {
            "title": "Vigência mínima restante (dias)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Só atas com pelo menos esse número de dias até o fim da vigência.",
            "default": 60
          },
          "valor_minimo": {
            "title": "Valor mínimo (R$)",
            "minimum": 0,
            "type": "number",
            "description": "Soma dos itens lidos da ata (homologado; estimado quando não há resultado)."
          },
          "cnpj_fornecedor": {
            "title": "CNPJ do fornecedor",
            "type": "string",
            "description": "Só atas em que esse CNPJ venceu algum item lido (ver as atas de um concorrente). CPF não é aceito (LGPD)."
          },
          "cnpj_orgao": {
            "title": "CNPJ do órgão gerenciador",
            "type": "string",
            "description": "Com CNPJ, lista todas as atas vigentes hoje desse órgão (ignora dias_atualizacao)."
          },
          "dias_atualizacao": {
            "title": "Atas atualizadas nos últimos N dias",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Sem cnpj_orgao, o Actor percorre as atas incluídas ou atualizadas no PNCP nesse período (o PNCP tem mais de 500 mil atas vigentes; não dá para varrer todas a cada run).",
            "default": 7
          },
          "agrupar_por_compra": {
            "title": "Agrupar atas da mesma compra",
            "type": "boolean",
            "description": "Ligado: uma compra com várias atas vira um item só (as outras atas ficam em atas_da_mesma_compra), porque a API não liga cada item a uma ata. Desligado: um item por ata, com os mesmos itens repetidos.",
            "default": true
          },
          "maxItems": {
            "title": "Máximo de atas",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Atas coletadas antes de ordenar pelo score e gravar.",
            "default": 10
          },
          "max_itens_por_ata": {
            "title": "Máximo de itens por ata",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Itens da compra lidos por ata (cada item com resultado custa 1 requisição).",
            "default": 5
          },
          "estadoStoreName": {
            "title": "Key-value store do diff",
            "type": "string",
            "description": "Store nomeado com o estado do modo diff_semanal.",
            "default": "atas-carona-pncp-estado"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}