{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Tender Scraper",
    "description": "A powerful Apify Actor that scrapes government tender listings from multiple official portals across different countries into a single normalized dataset. Built with the Adapter/Plugin pattern for easy extensibility.",
    "version": "0.0",
    "x-build-id": "rich4zPSYSWc77Z5l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/happitap~government-tender-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-happitap-government-tender-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/happitap~government-tender-scraper/runs": {
      "post": {
        "operationId": "runs-sync-happitap-government-tender-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/happitap~government-tender-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-happitap-government-tender-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",
        "required": [
          "country"
        ],
        "properties": {
          "country": {
            "title": "Country/Region",
            "enum": [
              "US",
              "EU",
              "UK",
              "IN",
              "CA"
            ],
            "type": "string",
            "description": "Select the country or region to scrape tenders from",
            "default": "US"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keywords to search for in tender titles/descriptions (OR logic)",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude Keywords",
            "type": "array",
            "description": "Keywords to exclude from results",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Published Date From",
            "type": "string",
            "description": "Filter tenders published from this date (ISO format: YYYY-MM-DD)"
          },
          "dateTo": {
            "title": "Published Date To",
            "type": "string",
            "description": "Filter tenders published until this date (ISO format: YYYY-MM-DD)"
          },
          "publishedLastNDays": {
            "title": "Published in Last N Days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Filter tenders published in the last N days (overrides dateFrom/dateTo)"
          },
          "deadlineFrom": {
            "title": "Deadline Date From",
            "type": "string",
            "description": "Filter tenders with deadline from this date (ISO format: YYYY-MM-DD)"
          },
          "deadlineTo": {
            "title": "Deadline Date To",
            "type": "string",
            "description": "Filter tenders with deadline until this date (ISO format: YYYY-MM-DD)"
          },
          "buyerName": {
            "title": "Buyer Name",
            "type": "string",
            "description": "Filter by buyer/agency name (partial match)"
          },
          "region": {
            "title": "Region/State/City",
            "type": "string",
            "description": "Filter by geographic location (portal-specific mapping)"
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Filter by category (CPV/NAICS codes or keywords, portal-specific)"
          },
          "minValue": {
            "title": "Minimum Tender Value",
            "type": "number",
            "description": "Minimum estimated tender value (if available)"
          },
          "maxValue": {
            "title": "Maximum Tender Value",
            "type": "number",
            "description": "Maximum estimated tender value (if available)"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of tenders to scrape",
            "default": 500
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of list pages to scrape",
            "default": 50
          },
          "startUrls": {
            "title": "Start URLs (Advanced)",
            "type": "array",
            "description": "Override with custom start URLs for advanced users",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "includeDetails": {
            "title": "Include Detail Pages",
            "type": "boolean",
            "description": "Scrape full detail pages for each tender (recommended)",
            "default": true
          },
          "downloadAttachments": {
            "title": "Download Attachments",
            "type": "boolean",
            "description": "Download tender documents/attachments (experimental)",
            "default": false
          },
          "attachmentsMaxCount": {
            "title": "Max Attachments per Tender",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of attachments to download per tender",
            "default": 10
          },
          "useProxy": {
            "title": "Use Proxy",
            "type": "boolean",
            "description": "Use Apify proxy for requests (recommended)",
            "default": true
          },
          "proxyGroups": {
            "title": "Proxy Groups",
            "type": "array",
            "description": "Apify proxy groups to use (e.g., RESIDENTIAL, SHADER)",
            "default": [
              "RESIDENTIAL"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of concurrent requests",
            "default": 10
          },
          "requestRetries": {
            "title": "Request Retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Number of retries for failed requests",
            "default": 5
          },
          "minDelayMs": {
            "title": "Min Delay (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum delay between requests in milliseconds",
            "default": 1000
          },
          "maxDelayMs": {
            "title": "Max Delay (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum delay between requests in milliseconds",
            "default": 3000
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to send webhook notifications for new tenders"
          },
          "webhookSecret": {
            "title": "Webhook Secret",
            "type": "string",
            "description": "Secret key for webhook authentication"
          },
          "notifyOnlyNew": {
            "title": "Notify Only New Tenders",
            "type": "boolean",
            "description": "Send webhook only for new tenders (requires state persistence)",
            "default": true
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}