{
  "openapi": "3.0.1",
  "info": {
    "title": "Latvia Public Procurement (IUB) Scraper",
    "description": "Daily Latvian public procurement notices from IUB open data (CC0): tenders, contracts, awards, CPV, values. GDPR-safe: personal data removed.",
    "version": "0.1",
    "x-build-id": "g24xKQ6nssSs1Lod8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ayuki~latvia-public-procurement-iub/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ayuki-latvia-public-procurement-iub",
        "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/ayuki~latvia-public-procurement-iub/runs": {
      "post": {
        "operationId": "runs-sync-ayuki-latvia-public-procurement-iub",
        "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/ayuki~latvia-public-procurement-iub/run-sync": {
      "post": {
        "operationId": "run-sync-ayuki-latvia-public-procurement-iub",
        "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": {
          "daysBack": {
            "title": "Publication window (days)",
            "minimum": 1,
            "maximum": 1200,
            "type": "integer",
            "description": "Default: 7 calendar days, including the end date. Used only when Date from is blank; the end date is Date to or today (UTC). Keep 7 for a quick first run, or use 30 for broader monitoring.",
            "default": 7
          },
          "maxItems": {
            "title": "Maximum output notices",
            "minimum": 0,
            "type": "integer",
            "description": "Default: 100 notices for a quick preview. Files are read newest-first and the run stops once the cap is reached; order within a daily file follows the source. Set 0 for all matching notices in the selected period. Narrow filters can require reading every day even with a small cap.",
            "default": 100
          },
          "dateFrom": {
            "title": "Date from (publication)",
            "type": "string",
            "description": "Optional inclusive publication start date, YYYY-MM-DD. Overrides Days back. IUB daily JSON is available from 2023-10-25; earlier start dates are clamped to that date. Leave blank for recent notices."
          },
          "dateTo": {
            "title": "Date to (publication)",
            "type": "string",
            "description": "Optional inclusive publication end date, YYYY-MM-DD. Leave blank for today (UTC). Use a date on or after Date from. Today’s file may not yet be published; the default seven-day window also checks earlier days."
          },
          "noticeCategories": {
            "title": "Notice categories",
            "type": "array",
            "description": "Leave empty to include all notice categories for the first run. Select contract_notice for tender announcements or award for results. Selected categories are alternatives; different filter fields are combined.",
            "items": {
              "type": "string",
              "enum": [
                "planning",
                "contract_notice",
                "award",
                "contract_execution",
                "contract_modification"
              ],
              "enumTitles": [
                "Planning / prior information",
                "Contract notice (open tender)",
                "Award / result",
                "Contract execution",
                "Contract modification"
              ]
            },
            "default": []
          },
          "cpvCodes": {
            "title": "CPV codes (prefix match)",
            "type": "array",
            "description": "Optional Common Procurement Vocabulary prefixes: 45000000 for construction, 72000000 for IT, or 7221 for a narrower group. Matches either main or additional CPV; trailing zeros and a check-digit suffix are ignored. Any supplied prefix may match. Leave empty for all sectors.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword in title/description",
            "type": "string",
            "description": "Optional case-insensitive substring in the title or description. Use source-language text, usually Latvian, e.g. būvdarbi. Text is not translated. Leave blank to avoid excluding notices."
          },
          "buyer": {
            "title": "Buyer name or registration no.",
            "type": "string",
            "description": "Optional case-insensitive part of a buyer’s name, e.g. Latvijas Universitāte, or an exact registration number, e.g. 90000076669. Leave blank for all contracting authorities."
          },
          "procedureTypes": {
            "title": "Procedure types",
            "type": "array",
            "description": "Optional procedure filter. Selected types are alternatives. Leave empty for all procedures, including notices with no procedure type; selecting a type excludes those notices.",
            "items": {
              "type": "string",
              "enum": [
                "open",
                "restricted",
                "neg-w-call",
                "neg-wo-call",
                "comp-dial",
                "innovation",
                "oth-single",
                "oth-mult"
              ],
              "enumTitles": [
                "Open procedure",
                "Restricted procedure",
                "Negotiated with a call for competition",
                "Negotiated without a call for competition",
                "Competitive dialogue",
                "Innovation partnership",
                "Other single-stage procedure",
                "Other multi-stage procedure"
              ]
            },
            "default": []
          },
          "minValueEur": {
            "title": "Minimum value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum value in EUR: uses contract value, falling back to estimated value, then maximum value. A positive threshold excludes notices with no usable value. Leave blank or set 0 to disable the filter."
          },
          "latestVersionOnly": {
            "title": "Latest notice version only",
            "type": "boolean",
            "description": "Default: enabled. Skips duplicate notice IDs and older notices replaced by a newer version encountered in the selected date window. It cannot detect replacements outside that window. Disable to retain older versions with different IDs.",
            "default": true
          },
          "requestDelaySecs": {
            "title": "Delay between requests (s)",
            "minimum": 0.5,
            "type": "number",
            "description": "Default: 1 second before each daily-file request, including retries; minimum 0.5 seconds. Downloads are sequential and need no proxy. Keep the default for polite access; lowering it does not guarantee faster source responses.",
            "default": 1
          },
          "excludeFreeText": {
            "title": "Exclude free-text fields",
            "type": "boolean",
            "description": "Default: disabled. Enable to set description and winners[].lotName to null for stronger data minimisation. The scrubbed title remains. Existing contact-data removal and winner-name redaction apply in both modes.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}