{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Public Tenders Monitor - PNCP (Licitacoes)",
    "description": "Monitor Brazilian government tenders from the official PNCP API. Keyword and region filters, deduplication across runs, and new-only alerts ready for webhooks.",
    "version": "0.1",
    "x-build-id": "yCAV8THg1b0LjVEQw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sadzinn~pncp-licitacoes-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sadzinn-pncp-licitacoes-monitor",
        "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/sadzinn~pncp-licitacoes-monitor/runs": {
      "post": {
        "operationId": "runs-sync-sadzinn-pncp-licitacoes-monitor",
        "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/sadzinn~pncp-licitacoes-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-sadzinn-pncp-licitacoes-monitor",
        "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": "Keywords (palavras-chave)",
            "type": "array",
            "description": "Only return tenders whose object contains at least one of these terms. Accent and case insensitive. Leave empty to get everything. Ex: software, licenca, computador",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords (excluir)",
            "type": "array",
            "description": "Discard tenders containing any of these terms. Useful to cut noise. Ex: merenda, combustivel",
            "items": {
              "type": "string"
            }
          },
          "modalidades": {
            "title": "Modalidades (contracting modes)",
            "type": "array",
            "description": "Which contracting modes to monitor. Default: Pregao Eletronico + Dispensa (the highest volume ones).",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12"
              ],
              "enumTitles": [
                "1 - Leilao Eletronico",
                "3 - Concurso",
                "4 - Concorrencia Eletronica",
                "5 - Concorrencia Presencial",
                "6 - Pregao Eletronico",
                "7 - Pregao Presencial",
                "8 - Dispensa",
                "9 - Inexigibilidade",
                "10 - Manifestacao de Interesse",
                "11 - Pre-qualificacao",
                "12 - Credenciamento"
              ]
            },
            "default": [
              "6",
              "8"
            ]
          },
          "uf": {
            "title": "State (UF)",
            "type": "string",
            "description": "Two-letter state code to filter, e.g. SP, RJ, MG. Leave empty for the whole country."
          },
          "municipioIbge": {
            "title": "City IBGE code",
            "type": "string",
            "description": "IBGE municipality code for city-level filtering, e.g. 3550308 for Sao Paulo."
          },
          "cnpjOrgao": {
            "title": "Government body CNPJ",
            "type": "string",
            "description": "Filter tenders from one specific government body by CNPJ (digits only)."
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "How many days of publications to scan. Use 1 for daily scheduled monitoring, 7-30 for a first backfill.",
            "default": 1
          },
          "minValue": {
            "title": "Minimum estimated value (BRL)",
            "type": "integer",
            "description": "Only tenders with estimated value at or above this. Tenders with no value are skipped when set."
          },
          "maxValue": {
            "title": "Maximum estimated value (BRL)",
            "type": "integer",
            "description": "Only tenders with estimated value at or below this."
          },
          "onlyNew": {
            "title": "Only new tenders (deduplicate across runs)",
            "type": "boolean",
            "description": "Remembers every tender already seen and returns only new ones on the next run. This is what makes scheduled runs alert-ready. Turn off to always return the full window.",
            "default": true
          },
          "monitorName": {
            "title": "Monitor name (separate dedup state)",
            "type": "string",
            "description": "Optional label to isolate the dedup memory of this monitor, e.g. 'client-acme' or 'software-sp'. Leave empty and the state is keyed automatically by your filters, so different filter sets never mix."
          },
          "maxPagesPerModalidade": {
            "title": "Max pages per modalidade",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Each page holds 50 tenders. Raise for wide nationwide scans, lower to cap usage.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}