{
  "openapi": "3.0.1",
  "info": {
    "title": "Apify Indonesian Cosmetics Inteligence",
    "version": "0.0",
    "x-build-id": "zUBi2MvHX47b7Fy2b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/endru_e~apify-indonesian-cosmetics-inteligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-endru_e-apify-indonesian-cosmetics-inteligence",
        "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/endru_e~apify-indonesian-cosmetics-inteligence/runs": {
      "post": {
        "operationId": "runs-sync-endru_e-apify-indonesian-cosmetics-inteligence",
        "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/endru_e~apify-indonesian-cosmetics-inteligence/run-sync": {
      "post": {
        "operationId": "run-sync-endru_e-apify-indonesian-cosmetics-inteligence",
        "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": {
          "brands": {
            "title": "Brands to monitor",
            "type": "array",
            "description": "Optional cosmetics brands to monitor in BPOM. Each brand is queried separately. Leave empty when monitoring by another criterion.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "registrants": {
            "title": "Registrants / companies",
            "type": "array",
            "description": "Optional BPOM registrant or company names to monitor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "productNames": {
            "title": "Product names",
            "type": "array",
            "description": "Optional product-name searches.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "registrationNumbers": {
            "title": "Registration numbers (NIE)",
            "type": "array",
            "description": "Optional BPOM registration numbers to monitor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "compositions": {
            "title": "Composition keywords",
            "type": "array",
            "description": "Optional composition or ingredient keywords supported by the BPOM filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxItemsPerQuery": {
            "title": "Maximum results per query",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "0 = no item limit. For production monitoring, keep this at 0 so the complete matching result set is checked.",
            "default": 0
          },
          "maxPagesPerQuery": {
            "title": "Maximum pages per query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap for BPOM pagination. Increase this if a monitored brand has more results than the current cap can cover.",
            "default": 100
          },
          "detailStrategy": {
            "title": "Product detail strategy",
            "enum": [
              "always",
              "changesOnly",
              "staleOnly",
              "never"
            ],
            "type": "string",
            "description": "Controls when the Actor opens BPOM product detail. changesOnly is recommended for routine monitoring; staleOnly is recommended for periodic detail refresh.",
            "default": "changesOnly"
          },
          "detailMaxAgeDays": {
            "title": "Detail maximum age (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Used by staleOnly. Product details are refreshed when their last successful detail fetch is at least this many days old. Recommended: 30.",
            "default": 30
          },
          "detailFetchLimitPerRun": {
            "title": "Detail fetch limit per run",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Used by staleOnly to cap successful detail attempts requested in one run. 0 = unlimited. Use this to spread stale-detail refresh cost across multiple runs.",
            "default": 0
          },
          "baselineWarmupRuns": {
            "title": "Trusted baseline warm-up runs",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of successful full-coverage runs used to build a trusted union baseline before NEW alerts are enabled. Recommended: 3.",
            "default": 3
          },
          "newProductWindowDays": {
            "title": "New product issued-date window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "After the trusted baseline is ready, a first-seen product is classified as NEW only when its BPOM issued date is within this many days. Older or unknown dates are classified as DISCOVERED.",
            "default": 30
          },
          "detectChanges": {
            "title": "Detect changes across runs",
            "type": "boolean",
            "description": "Compare current records with a persistent snapshot. When disabled, records are emitted as SNAPSHOT events.",
            "default": true
          },
          "emit": {
            "title": "Records to output",
            "enum": [
              "all",
              "changes",
              "new"
            ],
            "type": "string",
            "description": "all = every record; changes = trusted NEW or CHANGED records only; new = trusted NEW only. BASELINE and DISCOVERED records are visible with all but do not trigger changes output.",
            "default": "changes"
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named Apify Key-Value Store used to persist monitoring snapshots.",
            "default": "indonesian-cosmetics-intelligence-state"
          },
          "stateKey": {
            "title": "Watchlist state key",
            "type": "string",
            "description": "Unique key for this watchlist. Keep the same key across scheduled runs. Use a new key when starting a new independent trusted baseline.",
            "default": "default"
          },
          "requestDelayMs": {
            "title": "Delay between interactions (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Delay between BPOM interactions to reduce request pressure on the public source.",
            "default": 800
          },
          "allowPartialSnapshotUpdate": {
            "title": "Allow partial snapshot updates",
            "type": "boolean",
            "description": "Advanced. If enabled, the Actor may update stored observations even when full result coverage was not achieved. Partial runs never advance trusted-baseline readiness. Keep disabled for production monitoring.",
            "default": false
          },
          "debug": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable verbose diagnostics.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}