{
  "openapi": "3.0.1",
  "info": {
    "title": "Niche Directory Builder: SAM.gov Contracts + Google News",
    "description": "Build a deduplicated directory for any niche or keyword from SAM.gov federal contract opportunities and Google News. Each entry has a name, description, source link, date and category, ready for a website, spreadsheet or market research.",
    "version": "1.0",
    "x-build-id": "V1kULiUthw4WBcSHj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mosaicked_sponge~niche-directory-builder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mosaicked_sponge-niche-directory-builder",
        "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/mosaicked_sponge~niche-directory-builder/runs": {
      "post": {
        "operationId": "runs-sync-mosaicked_sponge-niche-directory-builder",
        "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/mosaicked_sponge~niche-directory-builder/run-sync": {
      "post": {
        "operationId": "run-sync-mosaicked_sponge-niche-directory-builder",
        "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": {
          "keywords": {
            "title": "Niche keywords",
            "type": "array",
            "description": "One niche, keyword or phrase per line, e.g. cybersecurity, drone, solar energy, janitorial. Each keyword is searched in SAM.gov notice titles (or titles + descriptions) and on Google News. SAM.gov understands AND, OR, NOT, \"exact phrases\" and prefix*.",
            "default": [
              "cybersecurity"
            ],
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Where to pull records from. Both by default.",
            "items": {
              "type": "string",
              "enum": [
                "sam.gov",
                "news"
              ],
              "enumTitles": [
                "SAM.gov federal contract notices",
                "Google News articles"
              ]
            },
            "default": [
              "sam.gov",
              "news"
            ]
          },
          "maxEntries": {
            "title": "Max directory entries",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Upper limit on entries saved (and charged) per run, after duplicates are merged. The newest entries are kept.",
            "default": 100
          },
          "categoryMode": {
            "title": "Group entries by",
            "enum": [
              "type",
              "topic"
            ],
            "type": "string",
            "description": "Entry type (Open Contract Opportunities, Contract Awards, Funding & Deals, Incidents & Risks...) works best for a single niche. Topic (Cybersecurity, IT & Software, Construction & Facilities...) works best for broad keywords. Both are always included as the entryType and topic fields.",
            "default": "type"
          },
          "customCategories": {
            "title": "Custom categories (optional)",
            "type": "object",
            "description": "Your own categories: category name -> keywords. They win whenever an entry's title or description matches, e.g. {\"Counter-drone\": [\"counter-uas\", \"anti-drone\"], \"Delivery\": [\"delivery\"]}. A trailing * matches a word prefix."
          },
          "sortBy": {
            "title": "Order",
            "enum": [
              "category",
              "date"
            ],
            "type": "string",
            "description": "Category (A-Z), newest first inside each category; or newest first overall.",
            "default": "category"
          },
          "directoryTitle": {
            "title": "Directory title",
            "type": "string",
            "description": "Heading of the HTML directory page. Defaults to the keywords."
          },
          "maxSamEntries": {
            "title": "Max SAM.gov entries",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Newest matching SAM.gov solicitations to include (0 = none).",
            "default": 25
          },
          "samKeywordScope": {
            "title": "Match keywords in",
            "enum": [
              "title",
              "titleAndDescription"
            ],
            "type": "string",
            "description": "Title only gives the most relevant entries; title and description finds many more.",
            "default": "title"
          },
          "samPostedWithinDays": {
            "title": "Posted within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only notices posted in the last N days (0 = any date in the extract).",
            "default": 90
          },
          "samActiveOnly": {
            "title": "Skip expired opportunities",
            "type": "boolean",
            "description": "Leave out notices whose response deadline has passed.",
            "default": true
          },
          "groupSolicitationNotices": {
            "title": "One entry per solicitation",
            "type": "boolean",
            "description": "Merge the presolicitation, solicitation, amendments and award of the same solicitation number into one entry (the newest notice; the others are listed in relatedNotices).",
            "default": true
          },
          "samNaicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Optional. Codes or prefixes, e.g. 541512 or 5415.",
            "items": {
              "type": "string"
            }
          },
          "samSetAsideCodes": {
            "title": "Set-aside codes",
            "type": "array",
            "description": "Optional, e.g. SBA, 8A, HZC, SDVOSBC, WOSB, NONE.",
            "items": {
              "type": "string"
            }
          },
          "samNoticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Optional, e.g. Solicitation, Combined Synopsis/Solicitation, Presolicitation, Sources Sought, Award Notice.",
            "items": {
              "type": "string"
            }
          },
          "samStates": {
            "title": "States",
            "type": "array",
            "description": "Optional 2-letter place-of-performance states (office state when none is given), e.g. TX, VA.",
            "items": {
              "type": "string"
            }
          },
          "samAgencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Optional. Any part of the agency path, e.g. veterans affairs, navy.",
            "items": {
              "type": "string"
            }
          },
          "newsTimeWindow": {
            "title": "News time window",
            "enum": [
              "24h",
              "2d",
              "3d",
              "7d",
              "14d",
              "30d",
              "90d",
              "1y",
              "any"
            ],
            "type": "string",
            "description": "How far back to look on Google News.",
            "default": "30d"
          },
          "maxNewsPerKeyword": {
            "title": "Max news articles per keyword",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Newest articles per keyword (Google returns up to about 100).",
            "default": 25
          },
          "newsLanguage": {
            "title": "News language",
            "type": "string",
            "description": "Language code, e.g. en, de, es-419.",
            "default": "en"
          },
          "newsCountry": {
            "title": "News country",
            "type": "string",
            "description": "2-letter country edition, e.g. US, GB, DE.",
            "default": "US"
          },
          "resolvePublisherUrls": {
            "title": "Real publisher links",
            "type": "boolean",
            "description": "Turn Google News links into the publisher's own article URL.",
            "default": true
          },
          "fetchArticleDetails": {
            "title": "Article descriptions",
            "type": "boolean",
            "description": "Read each article's summary, author and image from the publisher page.",
            "default": true
          },
          "excludeNewsSources": {
            "title": "Exclude publishers",
            "type": "array",
            "description": "Optional publisher names or domains to skip, e.g. example.com.",
            "items": {
              "type": "string"
            }
          },
          "fuzzyDedupe": {
            "title": "Merge near-duplicates",
            "type": "boolean",
            "description": "Besides identical links and titles, merge near-identical titles (syndicated stories, a news story about the same SAM.gov notice). Merged copies are listed in alsoFoundIn.",
            "default": true
          },
          "fuzzyThreshold": {
            "title": "Near-duplicate similarity",
            "minimum": 0.6,
            "maximum": 1,
            "type": "number",
            "description": "0.6 to 1.0. Higher merges only very close titles.",
            "default": 0.88
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}