{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Tenders Scraper: PNCP Licitações & Editais",
    "description": "Brazil public tenders API: new licitações, pregões, dispensas and concorrências from the official PNCP API, federal, state and municipal. Filter by UF, city, modality, buyer CNPJ, keyword, value, deadline. Edital documents, only-new monitoring. JSON, CSV or Excel. Sem login.",
    "version": "0.1",
    "x-build-id": "dJs3H1hyaOJOPXTeR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sidehustler~brazil-tenders-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sidehustler-brazil-tenders-feed",
        "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/sidehustler~brazil-tenders-feed/runs": {
      "post": {
        "operationId": "runs-sync-sidehustler-brazil-tenders-feed",
        "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/sidehustler~brazil-tenders-feed/run-sync": {
      "post": {
        "operationId": "run-sync-sidehustler-brazil-tenders-feed",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "published",
              "open"
            ],
            "type": "string",
            "description": "\"Newly published\" returns processes published in the date window — ideal for daily feeds. \"Currently open\" returns everything still accepting proposals regardless of publication date.",
            "default": "published"
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Two-letter state codes, e.g. SP, RJ, MG. Leave empty for all of Brazil.",
            "items": {
              "type": "string"
            }
          },
          "modalities": {
            "title": "Modalities",
            "type": "array",
            "description": "Codes or names: 6 Pregão eletrônico, 8 Dispensa, 4 Concorrência eletrônica, 12 Credenciamento, 5 Concorrência presencial, 7 Pregão presencial, 3 Concurso, 2 Diálogo competitivo, 10 Manifestação de interesse, 11 Pré-qualificação, 1/13 Leilão, 9 Inexigibilidade. Default: all competitive modalities (everything except 9).",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Match any of these words or phrases in the object (objeto), buyer or description — accent-insensitive, so \"licitacao\" matches \"licitação\". OR logic.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop notices whose title or description contains any of these.",
            "items": {
              "type": "string"
            }
          },
          "municipalities": {
            "title": "Municipalities",
            "type": "array",
            "description": "City names (São Paulo) or IBGE codes (3550308).",
            "items": {
              "type": "string"
            }
          },
          "spheres": {
            "title": "Government level",
            "type": "array",
            "description": "Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "federal",
                "state",
                "municipal",
                "district"
              ],
              "enumTitles": [
                "Federal",
                "State (estadual)",
                "Municipal",
                "Federal District (distrital)"
              ]
            }
          },
          "buyerCnpjs": {
            "title": "Buyer CNPJs",
            "type": "array",
            "description": "Only these buying organisations (CNPJ, with or without punctuation).",
            "items": {
              "type": "string"
            }
          },
          "buyers": {
            "title": "Buyer name contains",
            "type": "array",
            "description": "e.g. prefeitura, secretaria de saúde, universidade.",
            "items": {
              "type": "string"
            }
          },
          "minValue": {
            "title": "Minimum estimated value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only notices with a known value at or above this (in the notice currency). Notices without a value are excluded when set."
          },
          "maxValue": {
            "title": "Maximum estimated value (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only notices with a known value at or below this."
          },
          "lastDays": {
            "title": "Published in the last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Newly published mode: publication date within the last N days (1 = yesterday and today). Used only when no date range is set below.",
            "default": 1
          },
          "publishedFrom": {
            "title": "Published from (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional start of the publication/update date range. Overrides \"last N days\"."
          },
          "publishedTo": {
            "title": "Published to (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional end of the date range (inclusive)."
          },
          "onlyOpen": {
            "title": "Only tenders still open",
            "type": "boolean",
            "description": "Keep only notices whose submission deadline is in the future.",
            "default": false
          },
          "deadlineWithinDays": {
            "title": "Deadline within N days",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Keep only open notices whose deadline falls within the next N days (e.g. 14). Leave empty to ignore."
          },
          "onlyPriceRegistration": {
            "title": "Only price registration (SRP / ata de registro de preços)",
            "type": "boolean",
            "description": "Keep only Sistema de Registro de Preços processes.",
            "default": false
          },
          "deadlineUntil": {
            "title": "Open mode: deadline up to (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only for \"Currently open\" mode: include processes whose proposal deadline is on or before this date (default: one year ahead)."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of notices to save. Newest first. You pay only for saved results.",
            "default": 50
          },
          "onlyNew": {
            "title": "Only new since last run (monitoring mode)",
            "type": "boolean",
            "description": "Remember what earlier runs delivered and save only notices that are new (or changed, see below). Ideal for daily schedules. State is kept per Monitor ID in a named key-value store in your account.",
            "default": false
          },
          "reportUpdates": {
            "title": "Also report updated notices",
            "type": "boolean",
            "description": "In monitoring mode, re-deliver a notice when its title, status, deadline or value changes (changeType = updated).",
            "default": true
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name for this monitoring feed, so different schedules/tasks keep separate memories (e.g. it-london). Letters, digits, dashes."
          },
          "descriptionMaxLength": {
            "title": "Max description length",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate descriptions to this many characters (0 = no limit).",
            "default": 1000
          },
          "includeDocuments": {
            "title": "Include edital documents",
            "type": "boolean",
            "description": "Adds the list of published files (edital, termo de referência, anexos) with download links. One extra API call per tender.",
            "default": false
          },
          "maxPagesPerQuery": {
            "title": "Max pages per query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap on API pages (50 processes each) per day/modality/state query.",
            "default": 20
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "PNCP is slow at times; a few parallel queries keep runs fast while staying polite.",
            "default": 3
          },
          "maxRunSeconds": {
            "title": "Max fetch time (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop fetching new pages after this time and save what was found. Prevents runaway runs.",
            "default": 300
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}