{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Bids + RFP Documents as RAG Chunks",
    "description": "US public bids, RFPs and grant notices (E-Rate Form 470, Delaware, Grants.gov) with their attached PDF, DOCX and XLSX documents converted to Markdown and RAG chunks. Each chunk links to its notice, agency, deadline and page. OCR for scans.",
    "version": "0.2",
    "x-build-id": "2gQEEwBNR6XUaMgEx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opendatafrontierlab~bids-with-documents-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opendatafrontierlab-bids-with-documents-rag",
        "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/opendatafrontierlab~bids-with-documents-rag/runs": {
      "post": {
        "operationId": "runs-sync-opendatafrontierlab-bids-with-documents-rag",
        "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/opendatafrontierlab~bids-with-documents-rag/run-sync": {
      "post": {
        "operationId": "run-sync-opendatafrontierlab-bids-with-documents-rag",
        "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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Official sources that publish downloadable solicitation documents. Notices without documents are skipped and never charged.",
            "items": {
              "type": "string",
              "enum": [
                "erate-form-470",
                "delaware-state",
                "grants-gov",
                "all"
              ],
              "enumTitles": [
                "E-Rate Form 470 (school & library tech RFPs, nationwide)",
                "State of Delaware open bids",
                "Grants.gov NOFOs",
                "All sources"
              ]
            },
            "default": [
              "erate-form-470",
              "delaware-state",
              "grants-gov"
            ]
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Optional full-text filter on the notice (e.g. 'firewall', 'roofing', 'broadband')."
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Optional two-letter state codes, e.g. TX, CA. Filters E-Rate applicants by state; Delaware is included only if DE is listed. Grants.gov opportunities are national and are not filtered by state.",
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Posted in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only notices posted within this many days.",
            "default": 14
          },
          "postedSince": {
            "title": "Posted since (overrides daysBack)",
            "type": "string",
            "description": "YYYY-MM-DD."
          },
          "maxNotices": {
            "title": "Max notices (total)",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum notices with converted documents per run, across all sources.",
            "default": 20
          },
          "maxNoticesPerSource": {
            "title": "Max notices per source",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum notices with converted documents per source.",
            "default": 10
          },
          "maxCandidatesPerSource": {
            "title": "Max notices scanned per source",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many notices to look at per source while searching for ones with documents (not charged).",
            "default": 150
          },
          "maxDocumentsPerNotice": {
            "title": "Max documents per notice",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Documents converted per notice (addenda, specs, pricing sheets).",
            "default": 10
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Longer documents are truncated to this many pages and marked truncated: true (only delivered pages are charged). For DOCX/XLSX/HTML a page is 3,000 characters of content.",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are skipped and not charged.",
            "default": 50
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "chunks",
              "documents"
            ],
            "type": "string",
            "description": "Full Markdown of every document is also saved to the run's key-value store (markdownUrl).",
            "default": "chunks"
          },
          "chunkSizeChars": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Target maximum characters per chunk (~4 characters = 1 token).",
            "default": 2000
          },
          "chunkOverlapChars": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters repeated between consecutive chunks when a long section is split.",
            "default": 200
          },
          "ocrMode": {
            "title": "OCR",
            "enum": [
              "auto",
              "off"
            ],
            "type": "string",
            "description": "OCR is used only for PDF pages without a text layer and charged only when it returns text.",
            "default": "auto"
          },
          "onlyNewSinceLastRun": {
            "title": "Only new documents since last run",
            "type": "boolean",
            "description": "For scheduled runs: skip documents whose exact content (SHA-256) was already delivered by an earlier run with the same state key. A changed file at the same URL and an addendum on a known notice are delivered (and the addendum's notice fee is charged again).",
            "default": false
          },
          "continueTruncatedDocuments": {
            "title": "Continue truncated documents",
            "type": "boolean",
            "description": "With 'Only new documents', a document that was truncated by Max pages in an earlier run is continued from the next page (pages only; no notice or document fee).",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the 'already delivered' memory used by Only new documents. Default: derived from sources, keyword and states, so different saved tasks don't hide each other's documents."
          },
          "contactRedaction": {
            "title": "Contact data in documents",
            "enum": [
              "keep-official",
              "redact-all"
            ],
            "type": "string",
            "description": "Personal contact data is redacted from notice text and document Markdown.",
            "default": "keep-official"
          },
          "documentTimeoutSecs": {
            "title": "Per-document time limit (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Conversion time budget per document. Pages finished within it are delivered and charged; the rest is marked truncated (continue it in a later run with Continue truncated documents). Measured at 2 GB: a 131-page bid with many scanned pages delivered 70 pages (23 OCR) in 600 s.",
            "default": 600
          },
          "downloadDelaySecs": {
            "title": "Delay between downloads from one site (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Politeness delay per host. robots.txt rules are always respected.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}