{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov & UK Contracts Finder Tenders Scraper",
    "description": "Search US federal contract opportunities on SAM.gov and UK public tenders on Contracts Finder via official APIs. Keywords, dates, only-new mode. ~$2.50/1k notices; failed free.",
    "version": "0.1",
    "x-build-id": "851Zt1UAIPZX2MoxB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tinyrex~us-uk-tenders-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tinyrex-us-uk-tenders-scraper",
        "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/tinyrex~us-uk-tenders-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tinyrex-us-uk-tenders-scraper",
        "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/tinyrex~us-uk-tenders-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tinyrex-us-uk-tenders-scraper",
        "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": "Which official portals to query. Default: both. SAM.gov requires a free public API key (samApiKey).",
            "items": {
              "type": "string",
              "enum": [
                "sam.gov",
                "contracts-finder"
              ],
              "enumTitles": [
                "US SAM.gov (federal opportunities)",
                "UK Contracts Finder"
              ]
            },
            "default": [
              "contracts-finder"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Match notices whose title (and UK description) contains any of these words. Case-insensitive. Leave empty for all notices in the date window.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "publishedWithinDays": {
            "title": "Published in the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Notices published in the last N days. Ignored when Published from/to are set. 0 with no date range still defaults to 7 days for API safety.",
            "default": 7
          },
          "publishedFrom": {
            "title": "Published from",
            "type": "string",
            "description": "Start of publication date range (YYYY-MM-DD). SAM.gov ranges must be ≤ 1 year."
          },
          "publishedTo": {
            "title": "Published to",
            "type": "string",
            "description": "End of publication date range (YYYY-MM-DD), inclusive."
          },
          "maxResults": {
            "title": "Max notices",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum notices to save in this run (across selected sources). Default 50 finishes quickly for Store tests.",
            "default": 50
          },
          "onlyOpen": {
            "title": "Only open tenders (deadline not passed)",
            "type": "boolean",
            "description": "Keep notices whose response/tender deadline is today or later when a deadline is present.",
            "default": false
          },
          "includeDescription": {
            "title": "Include description text",
            "type": "boolean",
            "description": "Include truncated description text when the API returns it (UK). SAM.gov often returns a description URL instead of text.",
            "default": true
          },
          "onlyNew": {
            "title": "Only new notices",
            "type": "boolean",
            "description": "Skip notices already returned in a previous run with the same State key. First run is a baseline.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Named memory for Only new notices. Use different keys for different saved searches.",
            "default": "default"
          },
          "samApiKey": {
            "title": "SAM.gov public API key",
            "type": "string",
            "description": "Required for SAM.gov. Free key from your SAM.gov Account Details page (https://sam.gov). Never shared; used only for official public API calls. Leave empty to skip SAM.gov."
          },
          "samNaicsCode": {
            "title": "NAICS code (SAM.gov)",
            "type": "string",
            "description": "Optional 2–6 digit NAICS filter for SAM.gov, e.g. 541511."
          },
          "samState": {
            "title": "Place of performance state (SAM.gov)",
            "type": "string",
            "description": "Optional US state code for SAM.gov place of performance, e.g. CA, TX, NY."
          },
          "samPtype": {
            "title": "Procurement type (SAM.gov)",
            "enum": [
              "",
              "o",
              "k",
              "p",
              "r",
              "s",
              "a",
              "u",
              "g",
              "i"
            ],
            "type": "string",
            "description": "Optional SAM.gov procurement type code.",
            "default": ""
          },
          "cfStages": {
            "title": "Contracts Finder stages",
            "type": "array",
            "description": "UK OCDS procurement stages to include. Default: tender.",
            "items": {
              "type": "string",
              "enum": [
                "planning",
                "tender",
                "award",
                "implementation"
              ],
              "enumTitles": [
                "Planning",
                "Tender (open opportunities)",
                "Award",
                "Implementation"
              ]
            },
            "default": [
              "tender"
            ]
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}