{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC City Record Facility Bids - Trade Alerts",
    "description": "NYC City Record procurement notices from the official NYC Open Data API, classified by facility-services trade (janitorial, HVAC, elevator, snow, landscaping, pest, security...). Filter by trade, agency, notice type and date; alerts on new and changed notices and addenda.",
    "version": "0.1",
    "x-build-id": "M2J1HVZUOXufYl17Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bidsweep~nyc-facility-bids/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bidsweep-nyc-facility-bids",
        "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/bidsweep~nyc-facility-bids/runs": {
      "post": {
        "operationId": "runs-sync-bidsweep-nyc-facility-bids",
        "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/bidsweep~nyc-facility-bids/run-sync": {
      "post": {
        "operationId": "run-sync-bidsweep-nyc-facility-bids",
        "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": {
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Facility-services trades to include. Leave empty for all facility trades. A notice can match several trades. Values: janitorial, building, grounds, pest, hvac, roofing, plumbing, electrical, fire, snow, security, elevator, waste, window.",
            "items": {
              "type": "string",
              "enum": [
                "janitorial",
                "building",
                "grounds",
                "pest",
                "hvac",
                "roofing",
                "plumbing",
                "electrical",
                "fire",
                "snow",
                "security",
                "elevator",
                "waste",
                "window"
              ]
            },
            "default": []
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "City Record notice types to include, e.g. Solicitation, Intent to Award, Award, Vendor List. Default: Solicitation and Intent to Award. An empty list means all types.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Agency name filter (case-insensitive substring), e.g. 'Housing Authority', 'Parks', 'Environmental Protection'. Empty means all agencies.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Exact City Record categories, e.g. 'Services (other than human services)', 'Construction/Construction Services', 'Construction Related Services'. Empty means all. Pure 'Goods' notices are never trade-classified.",
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Published in the last N days",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Only notices whose City Record publication date is within this many days.",
            "default": 30
          },
          "dueAfter": {
            "title": "Due on or after",
            "type": "string",
            "description": "Only notices with a response due date on or after this date (YYYY-MM-DD). Overrides 'Open solicitations only'."
          },
          "dueBefore": {
            "title": "Due on or before",
            "type": "string",
            "description": "Only notices with a response due date on or before this date (YYYY-MM-DD)."
          },
          "openOnly": {
            "title": "Open solicitations only",
            "type": "boolean",
            "description": "When only Solicitation notices are selected, drop ones whose due date has already passed.",
            "default": true
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Optional extra keyword that must appear in the title or description (case-insensitive)."
          },
          "includeUnclassified": {
            "title": "Include unclassified notices",
            "type": "boolean",
            "description": "Also output notices that match no facility trade (charged as normal results). Usually off.",
            "default": false
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed notices (alert mode)",
            "type": "boolean",
            "description": "Output only notices that are new, changed (due date, title, amount, description...) or look like an addendum/correction/extension since the previous run with the same state store. The first run only records a baseline and outputs nothing in this mode.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that remembers notices between runs for change detection. Use a different name per saved search if you want separate alert streams.",
            "default": "nyc-facility-bids-state"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on dataset items (and therefore on charges) per run.",
            "default": 200
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free NYC Open Data app token for higher rate limits. Not needed for normal use."
          },
          "requestDelaySecs": {
            "title": "Delay between API pages (s)",
            "minimum": 1,
            "maximum": 30,
            "type": "number",
            "description": "Pause between paginated API calls. Default 1 s honors the portal's robots.txt Crawl-delay.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}