{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Tenders Scraper: SAM.gov & TED Europe",
    "description": "Scrapes US federal contract opportunities (SAM.gov) and EU public procurement notices (TED) into one unified schema. Search by keyword, NAICS or CPV code, or paste portal URLs. Full statements of work as clean Markdown for LLM use, ISO 8601 UTC deadlines, and buyer contact details.",
    "version": "0.1",
    "x-build-id": "mdWOOX14wzMOt0ysN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~government-tenders-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-government-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/scrapyx~government-tenders-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-government-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/scrapyx~government-tenders-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-government-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": "Portals to search",
            "type": "array",
            "description": "Which government procurement portals to query when you use the keyword/code filters below. SAM.gov covers US federal contract opportunities; TED covers EU public procurement. Pasted URLs always go to the portal they name, whatever is selected here.",
            "items": {
              "type": "string",
              "enum": [
                "sam",
                "ted"
              ],
              "enumTitles": [
                "SAM.gov (United States)",
                "TED (European Union)"
              ]
            },
            "default": [
              "sam",
              "ted"
            ]
          },
          "startUrls": {
            "title": "Search or notice URLs",
            "type": "array",
            "description": "Paste SAM.gov or TED URLs and each is routed automatically: a search URL (sam.gov/search/?index=opp&...) becomes a query, an opportunity URL (sam.gov/opp/<id>/view) or TED notice URL fetches that one notice. Bare ids also work: a 32-hex SAM id, or a TED publication number like 547033-2026.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text terms, for example \"Software Development\" or \"Construction\". Terms are combined with OR, so one run can cover a whole capability list. Searched full-text on both portals.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "industryCodes": {
            "title": "Industry codes (NAICS or CPV, mixed)",
            "type": "array",
            "description": "One list for both taxonomies. Codes are split by shape and sent only to the portal that understands them: 8 digits is a CPV code (TED), 2-6 digits is a NAICS code (SAM.gov). Use the two dedicated fields below if you want to be explicit.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes (SAM.gov only)",
            "type": "array",
            "description": "US industry codes, for example 541511 (Custom Computer Programming Services). Only sent to SAM.gov. Overrides anything matched from the mixed list above.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes (TED only)",
            "type": "array",
            "description": "EU Common Procurement Vocabulary codes, for example 72000000 (IT services) or 45000000 (Construction work). Only sent to TED. Overrides anything matched from the mixed list above.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "One unified vocabulary, translated into each portal's own codes. Concepts a portal does not have (there is no EU equivalent of Sources Sought) are simply not sent to it rather than faked. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "solicitation",
                "presolicitation",
                "sources-sought",
                "award",
                "special-notice",
                "justification",
                "modification",
                "surplus-sale"
              ],
              "enumTitles": [
                "Solicitation / Contract notice",
                "Presolicitation / Prior information notice",
                "Sources Sought (SAM.gov only)",
                "Award notice",
                "Special notice / Ex ante transparency",
                "Justification (SAM.gov only)",
                "Modification / Amendment",
                "Sale of surplus property (SAM.gov only)"
              ]
            },
            "default": []
          },
          "activeOnly": {
            "title": "Active notices only",
            "type": "boolean",
            "description": "Restrict SAM.gov to notices that are still open. Cuts SAM's corpus from roughly 5.6 million to about 51,000, so leaving this on is usually what you want.",
            "default": true
          },
          "publishedWithinDays": {
            "title": "Published within the last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only notices published in this window. 0 disables the filter. Also the single most effective way to stay under SAM.gov's hard 10,000-record result window on a broad query.",
            "default": 0
          },
          "deadlineWithinDays": {
            "title": "Deadline within the next N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only notices whose response deadline falls between today and N days from now. 0 disables the filter. Useful for a bid-desk queue of what is actually closing soon.",
            "default": 0
          },
          "setAsides": {
            "title": "Set-aside codes (SAM.gov only)",
            "type": "array",
            "description": "US small-business set-aside filters, for example SBA (Total Small Business), 8A, HZC (HUBZone), SDVOSBC, WOSB. An unrecognised code is refused rather than silently ignored.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC / classification codes (SAM.gov only)",
            "type": "array",
            "description": "US Product Service Codes, for example 7G21 or D302. Complements NAICS with a what-is-being-bought view.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "organizationIds": {
            "title": "Agency organization IDs (SAM.gov only)",
            "type": "array",
            "description": "SAM.gov internal organization ids to restrict the buying agency, for example 100000000 for the Department of Defense. Found in the organizationHierarchy of any result row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place-of-performance states (SAM.gov only)",
            "type": "array",
            "description": "Two-letter US state codes, for example VA or CA. Filters on where the work happens, not where the agency sits.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceCountries": {
            "title": "Place-of-performance countries (SAM.gov only)",
            "type": "array",
            "description": "Three-letter country codes, for example USA or DEU. Useful for finding overseas US federal work.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "buyerCountries": {
            "title": "Buyer countries (TED only)",
            "type": "array",
            "description": "Three-letter ISO country codes of the EU buying authority, for example DEU, FRA, POL. Only sent to TED.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tedExpertQuery": {
            "title": "TED expert query (advanced)",
            "type": "string",
            "description": "A raw TED expert-search expression, passed straight through and replacing every other TED filter. Build and test one at ted.europa.eu/en/search/expert-search. Example: classification-cpv IN (72000000) AND publication-date>=today(-30)",
            "default": ""
          },
          "includeDescription": {
            "title": "Fetch full descriptions (deep scrape)",
            "type": "boolean",
            "description": "Strongly recommended. SAM.gov's search rows carry only the FIRST 250 CHARACTERS of the statement of work, so the full scope, contacts and dates need one extra request per notice. On TED this costs no extra requests at all -- it widens the field set instead.",
            "default": true
          },
          "includeAttachments": {
            "title": "Fetch attachment metadata (SAM.gov only)",
            "type": "boolean",
            "description": "Adds one more request per notice to list solicitation attachments (name, type, size, download URL). File contents are not downloaded.",
            "default": false
          },
          "includeRawUpstream": {
            "title": "Include the raw upstream payload",
            "type": "boolean",
            "description": "Attach each portal's original JSON under rawUpstream, for fields the unified schema does not carry. Off by default because it roughly triples row size.",
            "default": false
          },
          "maxItemsPerQuery": {
            "title": "Max tenders per query",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on notices returned per portal per query. 0 means no cap. Note that SAM.gov cannot return more than 10,000 for any single query no matter what you set here -- narrow the query and run it in slices instead.",
            "default": 200
          },
          "tedScope": {
            "title": "TED search scope",
            "enum": [
              "ALL",
              "ACTIVE",
              "LATEST"
            ],
            "type": "string",
            "description": "ALL searches every notice ever published, ACTIVE only currently open ones, LATEST only the newest OJ S release.",
            "default": "ALL"
          },
          "tedLanguage": {
            "title": "TED preferred language",
            "enum": [
              "eng",
              "deu",
              "fra",
              "spa",
              "ita",
              "nld",
              "pol",
              "por",
              "swe"
            ],
            "type": "string",
            "description": "TED publishes titles and descriptions in up to 24 languages at once. One is resolved per field before output, falling back to English and then to whatever the notice actually has, so a national-only notice still keeps its title.",
            "default": "eng"
          },
          "tedOnlyLatestVersions": {
            "title": "TED: only the latest version of each notice",
            "type": "boolean",
            "description": "TED republishes corrected notices under the same identifier. On, you get one row per notice; off, you also get its superseded versions.",
            "default": true
          },
          "samSort": {
            "title": "SAM.gov sort order",
            "enum": [
              "-modifiedDate",
              "-publishDate",
              "-responseDate",
              "responseDate",
              "-relevance"
            ],
            "type": "string",
            "description": "Ordering for SAM.gov results. Validated in code because SAM silently ignores an unknown sort key and answers 200 with its default ordering.",
            "default": "-modifiedDate"
          },
          "samPageSize": {
            "title": "SAM.gov page size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Notices fetched per SAM.gov search request. Larger pages mean fewer search calls but a bigger burst of detail requests behind them.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Upper bound on total in-flight requests across every query, including SAM.gov's per-notice detail fetches.",
            "default": 6
          },
          "minRequestInterval": {
            "title": "Min seconds between request starts",
            "type": "string",
            "description": "Paces request starts without holding a worker. TED rate-limits at roughly 10 requests/second, so this -- not concurrency -- is the honest speed control. Lower it only if you are hitting SAM.gov alone.",
            "default": "0.15"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxy by default. Neither API blocks by fingerprint, but a cloud run shares datacenter egress with every other Apify actor and TED rate-limits by IP, so a shared exit address would spend the run retrying.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}