{
  "openapi": "3.0.1",
  "info": {
    "title": "Apify Tender Attachment Parser",
    "description": "Parse SAM.gov and TED tender attachments (PDF, DOCX, XLSX, ZIP) into structured JSON with page-level citations and OCR for scanned files.",
    "version": "0.0",
    "x-build-id": "T5xU5m8HyorzEGJnK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leonyu~apify-tender-attachment-parser/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leonyu-apify-tender-attachment-parser",
        "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/leonyu~apify-tender-attachment-parser/runs": {
      "post": {
        "operationId": "runs-sync-leonyu-apify-tender-attachment-parser",
        "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/leonyu~apify-tender-attachment-parser/run-sync": {
      "post": {
        "operationId": "run-sync-leonyu-apify-tender-attachment-parser",
        "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": {
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Your own public API key from SAM.gov Account Details. Required only for SAM.gov notice IDs or filters. The key is sent to api.sam.gov and is not written to the dataset or logs. Example: paste the key from your SAM.gov account."
          },
          "samNoticeIds": {
            "title": "SAM.gov notice IDs",
            "type": "array",
            "description": "Opportunity notice IDs to fetch. Example: 5b345bbb7127b91a3ad577b203fc6f68. The API searches only a one-year posted-date window. If you omit dates, the Actor uses the last 364 days.",
            "items": {
              "type": "string"
            }
          },
          "samSolicitationNumbers": {
            "title": "SAM.gov solicitation numbers",
            "type": "array",
            "description": "Solicitation numbers passed to the solnum parameter. Example: W912QR-26-R-0042.",
            "items": {
              "type": "string"
            }
          },
          "samPostedFrom": {
            "title": "SAM.gov posted from",
            "type": "string",
            "description": "Start of the posted-date window, MM/DD/YYYY or YYYY-MM-DD. Required together with Posted to. The window cannot exceed one year. Example: 01/01/2026."
          },
          "samPostedTo": {
            "title": "SAM.gov posted to",
            "type": "string",
            "description": "End of the posted-date window, MM/DD/YYYY or YYYY-MM-DD. Example: 10/29/2026."
          },
          "samNaics": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS codes for the SAM.gov ncode filter. One code is queried at a time. Example: 541512.",
            "items": {
              "type": "string"
            }
          },
          "samKeywords": {
            "title": "SAM.gov title keywords",
            "type": "string",
            "description": "Passed to the SAM.gov title parameter, which matches the notice title rather than the full attachment text. Example: cloud hosting."
          },
          "samSetAside": {
            "title": "SAM.gov set-aside",
            "type": "string",
            "description": "Set-aside code or description. Codes include SBA, SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB, EDWOSBSS, LAS, IEE, ISBEE, BICiv, VSA, and VSS. Example: SBA."
          },
          "samNoticeTypes": {
            "title": "SAM.gov notice types",
            "type": "array",
            "description": "Procurement type codes (ptype). Example: o for solicitation, k for combined synopsis/solicitation.",
            "items": {
              "type": "string",
              "enum": [
                "o",
                "k",
                "p",
                "r",
                "s",
                "a",
                "u",
                "i",
                "g"
              ],
              "enumTitles": [
                "Solicitation",
                "Combined synopsis/solicitation",
                "Presolicitation",
                "Sources sought",
                "Special notice",
                "Award notice",
                "Justification (J&A)",
                "Intent to bundle",
                "Sale of surplus property"
              ]
            }
          },
          "samState": {
            "title": "SAM.gov place-of-performance state",
            "type": "string",
            "description": "Two-letter state code for the SAM.gov state filter. Example: VA."
          },
          "tedNoticeNumbers": {
            "title": "TED publication numbers",
            "type": "array",
            "description": "TED publication numbers. No API key is required. Example: 722717-2026.",
            "items": {
              "type": "string"
            }
          },
          "tedQuery": {
            "title": "TED expert query",
            "type": "string",
            "description": "Expert-search query combined with any publication numbers. Example: buyer-country=IRL AND publication-date>=20261001."
          },
          "tedPdfLanguage": {
            "title": "TED PDF language",
            "type": "string",
            "description": "Three-letter TED language code for the notice PDF. The Actor falls back to English, then to the first available language. Example: ENG.",
            "default": "ENG"
          },
          "attachmentUrls": {
            "title": "Direct attachment URLs",
            "type": "array",
            "description": "Public http(s) URLs of PDF, DOCX, XLSX, DOC, or ZIP files. Can be combined with SAM.gov and TED. The prefilled URL is a public W3C test PDF (not a live tender) so a run can be tried without an API key.",
            "items": {
              "type": "string"
            }
          },
          "maxNotices": {
            "title": "Max notices",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum notices to return across SAM.gov, TED, and direct URLs, in that order. Example: 10.",
            "default": 10
          },
          "maxAttachmentsPerNotice": {
            "title": "Max attachments per notice",
            "minimum": 0,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum downloaded files per notice. Files inside a ZIP count against the ZIP limits, not this number. Example: 5.",
            "default": 5
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Skip a download or ZIP member larger than this. Example: 25.",
            "default": 25
          },
          "maxPages": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Stop reading a PDF after this many pages. Example: 40.",
            "default": 40
          },
          "ocrEnabled": {
            "title": "OCR scanned pages",
            "type": "boolean",
            "description": "Run Tesseract on pages that have no text layer. Leave this off to save time and memory when you know the files are digital PDFs.",
            "default": true
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Tesseract language codes installed in the Actor image. Example: eng. Add deu for German TED scans.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "outputSections": {
            "title": "Output sections",
            "type": "array",
            "description": "Which extracted sections to include. Key fields, page text, and clause lists are omitted when unchecked. Status and errors are always included.",
            "items": {
              "type": "string",
              "enum": [
                "keyFields",
                "pageText",
                "outline",
                "requirements",
                "evaluationCriteria",
                "submissionInstructions",
                "complianceMatrix",
                "farClauses",
                "dates"
              ],
              "enumTitles": [
                "Key fields",
                "Page text",
                "Outline",
                "Requirements",
                "Evaluation criteria",
                "Submission instructions",
                "Compliance matrix",
                "FAR / DFARS clauses",
                "Dates"
              ]
            },
            "default": [
              "keyFields",
              "pageText",
              "outline",
              "requirements",
              "evaluationCriteria",
              "submissionInstructions",
              "complianceMatrix",
              "farClauses",
              "dates"
            ]
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout for one HTTP request, including SAM.gov, TED, and attachment downloads. Example: 60.",
            "default": 60
          },
          "parseTimeoutSecs": {
            "title": "Parse timeout (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Timeout for parsing one downloaded file, including OCR of its pages. Example: 120.",
            "default": 120
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}