{
  "openapi": "3.0.1",
  "info": {
    "title": "California Prop 65 Notice Watchlist Processor",
    "description": "Normalize and compare California Prop 65 notice snapshots, then flag new or changed records that match your watchlist. Preserves source links and uncertainty; informational only.",
    "version": "0.1",
    "x-build-id": "vgR44fZTYpjjsDE9L"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mehdi_badawi~proposition-65-watchlist/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mehdi_badawi-proposition-65-watchlist",
        "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/mehdi_badawi~proposition-65-watchlist/runs": {
      "post": {
        "operationId": "runs-sync-mehdi_badawi-proposition-65-watchlist",
        "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/mehdi_badawi~proposition-65-watchlist/run-sync": {
      "post": {
        "operationId": "run-sync-mehdi_badawi-proposition-65-watchlist",
        "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": {
          "contractVersion": {
            "title": "Contract version",
            "maxLength": 16,
            "type": "string",
            "description": "Must equal 1.0.0 when provided. The Actor stamps the current contract version when omitted.",
            "default": "1.0.0"
          },
          "evaluationTime": {
            "title": "Evaluation time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$",
            "type": "string",
            "description": "ISO-8601 instant treated as 'now' for comparisons (e.g. 2026-09-21T12:00:00Z)."
          },
          "snapshot": {
            "title": "Current notice snapshot",
            "type": "array",
            "description": "Array of notice records from the California AG register snapshot.",
            "items": {
              "type": "object",
              "properties": {
                "noticeNumber": {
                  "type": "string",
                  "title": "Notice Number",
                  "description": "Notice Number value."
                },
                "noticeDate": {
                  "type": "string",
                  "title": "Notice Date",
                  "description": "Notice Date value."
                },
                "allegedViolators": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Alleged Violators",
                  "description": "Alleged Violators value."
                },
                "noticingParties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Noticing Parties",
                  "description": "Noticing Parties value."
                },
                "chemicals": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Chemicals",
                  "description": "Chemicals value."
                },
                "category": {
                  "type": "string",
                  "title": "Category",
                  "description": "Category value."
                },
                "productDetails": {
                  "type": "string",
                  "title": "Product Details",
                  "description": "Product Details value."
                },
                "sourceUrl": {
                  "type": "string",
                  "title": "Source Url",
                  "description": "Source Url value."
                },
                "documentUri": {
                  "type": "string",
                  "title": "Document Uri",
                  "description": "Document Uri value."
                }
              }
            }
          },
          "priorSnapshot": {
            "title": "Prior notice snapshot or state",
            "type": "array",
            "description": "Optional prior notice records to diff against. If omitted or empty and state persistence is enabled, the prior state is loaded from the named state store. Set stateStoreName to null to force a run without persisted history.",
            "items": {
              "type": "object"
            }
          },
          "watchlist": {
            "title": "Watchlist criteria",
            "type": "object",
            "description": "Watchlist rules specifying company names, chemical names, or product categories to monitor.",
            "properties": {
              "companies": {
                "type": "array",
                "description": "Company names (alleged violators) to watch.",
                "items": {
                  "type": "string"
                },
                "title": "Companies"
              },
              "chemicals": {
                "type": "array",
                "description": "Chemical names (e.g. Lead, BPA, Phthalates, Cadmium) to watch.",
                "items": {
                  "type": "string"
                },
                "title": "Chemicals"
              },
              "categories": {
                "type": "array",
                "description": "Product categories (e.g. Dietary Supplements, Food, Cosmetics) to watch.",
                "items": {
                  "type": "string"
                },
                "title": "Categories"
              }
            },
            "default": {}
          },
          "source": {
            "title": "Source attestation",
            "type": "object",
            "description": "Attestation of source register status and provenance.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "ok",
                  "failed",
                  "rate_limited",
                  "timeout",
                  "unavailable",
                  "malformed",
                  "unauthorized"
                ],
                "default": "ok",
                "title": "Status",
                "description": "Status value."
              },
              "registerUrl": {
                "type": "string",
                "default": "https://oag.ca.gov/prop65",
                "title": "Register Url",
                "description": "Register Url value."
              },
              "fetchedAt": {
                "type": "string",
                "title": "Fetched At",
                "description": "Fetched At value."
              },
              "detail": {
                "type": "string",
                "title": "Detail",
                "description": "Detail value."
              },
              "mechanism": {
                "type": "string",
                "enum": [
                  "public-register",
                  "fixture",
                  "manual"
                ],
                "default": "fixture",
                "title": "Mechanism",
                "description": "Mechanism value."
              },
              "completeCoverage": {
                "type": "boolean",
                "default": false,
                "title": "Complete Coverage",
                "description": "Complete Coverage value."
              }
            },
            "default": {
              "status": "ok",
              "registerUrl": "https://oag.ca.gov/prop65",
              "mechanism": "fixture",
              "completeCoverage": false
            }
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Name of the Apify Key-Value Store used to persist prior notice snapshots across runs. Set to null to disable persistence.",
            "default": "prop65-watchlist-state"
          },
          "emitOnlyWatchlistMatches": {
            "title": "Emit only watchlist matches",
            "type": "boolean",
            "description": "When true and watchlist criteria are provided, only notices matching the watchlist are pushed to the dataset. When false, all new/changed notices are pushed with matched tags.",
            "default": false
          },
          "emitUnchanged": {
            "title": "Emit unchanged notices",
            "type": "boolean",
            "description": "When true, notices that have not changed since the prior snapshot are also emitted with status 'unchanged'.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}