{
  "openapi": "3.0.1",
  "info": {
    "title": "Open Data Feed Watcher – Socrata, ArcGIS, CKAN",
    "description": "Watch open data datasets and whole portals (Socrata, ArcGIS, CKAN) using metadata only: stale data, column changes, row-count jumps, licence and title changes, endpoint errors, possible personal-info columns. Snapshot kept between runs. JSON/CSV. $0.005 per check.",
    "version": "0.1",
    "x-build-id": "TLyLTYRewXHkWaBmi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/loudtzu~open-data-feed-watcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-loudtzu-open-data-feed-watcher",
        "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/loudtzu~open-data-feed-watcher/runs": {
      "post": {
        "operationId": "runs-sync-loudtzu-open-data-feed-watcher",
        "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/loudtzu~open-data-feed-watcher/run-sync": {
      "post": {
        "operationId": "run-sync-loudtzu-open-data-feed-watcher",
        "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": {
          "datasets": {
            "title": "Datasets to watch",
            "type": "array",
            "description": "Each item: {\"portal\": \"socrata\"|\"arcgis\"|\"ckan\", \"domain\": \"data.novascotia.ca\", \"id\": \"m6ps-8j6u\"}. ArcGIS uses \"url\" = full layer URL (…/FeatureServer/0). CKAN under a path can give \"url\" (e.g. https://open.canada.ca/data). Optional \"maxAgeDays\" overrides the stated frequency.",
            "default": [
              {
                "portal": "socrata",
                "domain": "data.novascotia.ca",
                "id": "m6ps-8j6u"
              },
              {
                "portal": "arcgis",
                "url": "https://services2.arcgis.com/11XBiaBYA9Ep0yNJ/arcgis/rest/services/PPLC_Issued_Building_Permits/FeatureServer/0",
                "maxAgeDays": 14
              }
            ]
          },
          "portals": {
            "title": "Whole portals to scan (catalogue diff)",
            "type": "array",
            "description": "Each item: {\"portal\": \"socrata\"|\"ckan\"|\"arcgis\", \"domain\" or \"url\", \"maxDatasets\": 5000}. Reports datasets added, removed or retitled since the last run. ArcGIS url must end in /rest/services. Note: open.canada.ca asks for a 20 s crawl delay, so large CKAN scans are slow.",
            "default": []
          },
          "rowCountThresholdPct": {
            "title": "Row count change threshold (%)",
            "minimum": 0,
            "type": "integer",
            "description": "Flag when the row count moves more than this percent since the last run.",
            "default": 10
          },
          "staleGraceFactor": {
            "title": "Stale grace factor",
            "minimum": 1,
            "type": "number",
            "description": "A dataset is stale when its age exceeds stated frequency × this factor (>= 1).",
            "default": 1.5
          },
          "ckanDatastoreFields": {
            "title": "Read CKAN DataStore field lists",
            "type": "boolean",
            "description": "For CKAN resources in the DataStore, read column definitions and totals (datastore_search limit=0, no rows). Up to 5 resources per dataset.",
            "default": true
          },
          "onlyChanges": {
            "title": "Only output datasets with changes",
            "type": "boolean",
            "description": "Skip unchanged datasets in the output (first sightings are always output).",
            "default": false
          },
          "snapshotStore": {
            "title": "Snapshot key-value store name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "type": "string",
            "description": "Named store that keeps the previous snapshot between runs.",
            "default": "open-data-feed-watcher"
          },
          "snapshotKey": {
            "title": "Snapshot key",
            "pattern": "^[a-zA-Z0-9!\\-_.'()]{1,256}$",
            "type": "string",
            "description": "Use different keys to keep separate watch lists.",
            "default": "SNAPSHOT"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}