{
  "openapi": "3.0.1",
  "info": {
    "title": "Youtube Trend Intelligence Workspace",
    "description": "📈 Your automated YouTube trend analyst. Discovers emerging trends, tracks view momentum & acceleration every hour, and auto-writes breakout alerts, rising creators & content opportunities straight to your Notion workspace. 🚀",
    "version": "0.0",
    "x-build-id": "sxzvCYKhCJRGCuTCS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apt_marble~youtube-trend-intelligence-workspace/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apt_marble-youtube-trend-intelligence-workspace",
        "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/apt_marble~youtube-trend-intelligence-workspace/runs": {
      "post": {
        "operationId": "runs-sync-apt_marble-youtube-trend-intelligence-workspace",
        "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/apt_marble~youtube-trend-intelligence-workspace/run-sync": {
      "post": {
        "operationId": "run-sync-apt_marble-youtube-trend-intelligence-workspace",
        "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",
        "required": [
          "seedKeywords"
        ],
        "properties": {
          "seedKeywords": {
            "title": "Seed keywords / niches",
            "minItems": 1,
            "type": "array",
            "description": "The topics to monitor. Each tick discovers fresh videos for every keyword and tracks their growth over time.",
            "default": [
              "World cup 2026",
              "video games",
              "air fryer"
            ],
            "items": {
              "type": "string"
            }
          },
          "notionConnector": {
            "title": "Notion connector",
            "type": "string",
            "description": "Connect your Notion workspace. Daily reports, breakout alerts, emerging trends, rising creators and content opportunities are written here automatically. Leave empty to run in dry-run mode (reports go to a dataset instead of Notion)."
          },
          "notionParentPage": {
            "title": "Notion parent page (ID or URL)",
            "type": "string",
            "description": "The page under which the Trend Intelligence workspace (Daily Reports, Breakout Videos, Emerging Trends, …) is built. Required when a Notion connector is set."
          },
          "breakoutViewsPerHour": {
            "title": "Breakout: min views/hour",
            "minimum": 0,
            "type": "integer",
            "description": "A video must exceed this view velocity to qualify as a breakout. Lower = more breakout alerts.",
            "default": 1500
          },
          "breakoutAccel": {
            "title": "Breakout: min acceleration",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum view acceleration (growth of growth, views/hour²) for a breakout.",
            "default": 300
          },
          "viralScoreMin": {
            "title": "Breakout: min viral score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum viral score (0–100) for a breakout alert.",
            "default": 60
          },
          "trendScoreMin": {
            "title": "Trend: min trend score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum trend score (0–100) for an emerging-trend event.",
            "default": 40
          },
          "trendMinVideos": {
            "title": "Trend: min videos",
            "minimum": 2,
            "type": "integer",
            "description": "How many related videos must cluster together to form a trend.",
            "default": 3
          },
          "opportunityScoreMin": {
            "title": "Opportunity: min score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum opportunity score (0–100) for a content-opportunity event.",
            "default": 40
          },
          "risingCreatorMomentumMin": {
            "title": "Rising creator: min momentum",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum momentum score (0–100) for a rising-creator event.",
            "default": 50
          },
          "breakoutCooldownHours": {
            "title": "Breakout cooldown (hours)",
            "minimum": 0,
            "type": "integer",
            "description": "How long before the same breakout video can bill again (unless it escalates).",
            "default": 24
          },
          "trendCooldownHours": {
            "title": "Trend cooldown (hours)",
            "minimum": 0,
            "type": "integer",
            "description": "How long before the same emerging trend can bill again (unless its trend score escalates).",
            "default": 48
          },
          "risingCreatorCooldownHours": {
            "title": "Rising-creator cooldown (hours)",
            "minimum": 0,
            "type": "integer",
            "description": "How long before the same rising creator can bill again (unless its momentum escalates).",
            "default": 48
          },
          "opportunityCooldownHours": {
            "title": "Opportunity cooldown (hours)",
            "minimum": 0,
            "type": "integer",
            "description": "How long before the same content opportunity can bill again (unless its score escalates).",
            "default": 72
          },
          "runMode": {
            "title": "Run mode",
            "enum": [
              "tick",
              "backfill",
              "dryRun",
              "reporterTest"
            ],
            "type": "string",
            "description": "tick = a normal hourly run. backfill = discover + snapshot only (seed history). dryRun = force local reporter. reporterTest = probe the Notion workspace.",
            "default": "tick"
          },
          "enablePremium": {
            "title": "Enable premium features",
            "type": "boolean",
            "description": "Rising-creator detection, niche heatmap and content-idea generation.",
            "default": true
          },
          "forceDaily": {
            "title": "Force a daily report now (operator)",
            "type": "boolean",
            "description": "Operator-only (hidden from the form; set via JSON input). Fires a daily report on this run regardless of the schedule. If left on it bills a daily report every run.",
            "default": false
          },
          "forceWeekly": {
            "title": "Force a weekly report now (operator)",
            "type": "boolean",
            "description": "Operator-only (hidden from the form; set via JSON input). Fires a weekly report on this run regardless of the schedule. If left on it bills a weekly report every run.",
            "default": false
          },
          "resetState": {
            "title": "Start fresh (reset stored data)",
            "type": "boolean",
            "description": "Turn ON for ONE run to wipe all stored data (tracked videos, history, and cached Notion pages) and rebuild from scratch — useful after you change your keywords or Notion page. ⚠️ Turn it OFF again after that run, or every run will reset and momentum (trends, breakouts, reports) will never accumulate.",
            "default": false
          },
          "discoverySort": {
            "title": "Discover by",
            "enum": [
              "viewCount",
              "relevance",
              "uploadDate",
              "rating"
            ],
            "type": "string",
            "description": "How to pick videos to track. 'View count' (recommended) tracks videos with real view momentum so velocity is measurable; 'Upload date' tracks the newest (often near-zero-view) uploads.",
            "default": "viewCount"
          },
          "discoveryDateFilter": {
            "title": "Discover within",
            "enum": [
              "today",
              "week",
              "month",
              "year",
              ""
            ],
            "type": "string",
            "description": "Only discover videos uploaded within this window.",
            "default": "week"
          },
          "maxVideosPerKeyword": {
            "title": "Max videos discovered per keyword",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many videos to add to the tracked set per keyword each tick.",
            "default": 20
          },
          "discoveryPagesPerKeyword": {
            "title": "Discovery pages per keyword",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Operator-only (hidden; set via JSON). How many search-result pages to page through per keyword during discovery.",
            "default": 2
          },
          "maxTrackedVideos": {
            "title": "Max tracked videos",
            "minimum": 10,
            "maximum": 100000,
            "type": "integer",
            "description": "Operator-only (hidden; set via JSON). The tracked set is capped here; lowest-value videos are evicted when exceeded.",
            "default": 5000
          },
          "snapshotConcurrency": {
            "title": "Snapshot concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Operator-only (hidden; set via JSON). How many tracked videos to snapshot in parallel each tick.",
            "default": 4
          },
          "snapshotProxyFallback": {
            "title": "Proxy fallback for view counts",
            "type": "boolean",
            "description": "Internal: retries zeroed view counts through the premium proxy for accuracy. Hidden from the input form; always on.",
            "default": true
          },
          "maxEventsPerTick": {
            "title": "Max billable events per tick",
            "minimum": 0,
            "type": "integer",
            "description": "Operator-only (hidden; set via JSON). Safety cap on how many billable events a single run can emit. The highest-value events are kept; the rest can re-emit on a later tick. Protects against runaway billing from a data anomaly. Set 0 for unlimited.",
            "default": 100
          },
          "reportHourUtc": {
            "title": "Daily/weekly report hour (UTC)",
            "minimum": 0,
            "maximum": 23,
            "type": "integer",
            "description": "The UTC hour at which daily and weekly reports are published.",
            "default": 8
          },
          "weeklyReportDow": {
            "title": "Weekly report day of week (0=Sun)",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Day of week the weekly report is published (0 = Sunday … 6 = Saturday).",
            "default": 1
          },
          "country": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter country code for region-specific results.",
            "default": "us"
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Two-letter language code for results.",
            "default": "en"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}