{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Sponsorship & Brand-Safety Monitor",
    "description": "Monitor YouTube videos, channels, and searches for sponsorship disclosures, brand and competitor mentions, and evidence-backed brand-safety risks.",
    "version": "0.1",
    "x-build-id": "cWHpenoTouNKJJhbe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchfinch~youtube-sponsorship-brand-safety-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchfinch-youtube-sponsorship-brand-safety-monitor",
        "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/fetchfinch~youtube-sponsorship-brand-safety-monitor/runs": {
      "post": {
        "operationId": "runs-sync-fetchfinch-youtube-sponsorship-brand-safety-monitor",
        "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/fetchfinch~youtube-sponsorship-brand-safety-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-fetchfinch-youtube-sponsorship-brand-safety-monitor",
        "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": {
          "videoUrls": {
            "title": "Video URLs or IDs",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Analyze specific YouTube videos. Direct videos are analyzed regardless of the lookback window.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "channelUrls": {
            "title": "Channel URLs or handles",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Discover recent uploads from channel URLs, channel IDs, @handles, or plain handles.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchQueries": {
            "title": "YouTube search queries",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Discover recent videos matching each query.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxVideosPerSource": {
            "title": "Videos per channel or search",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum videos discovered from each channel or search query.",
            "default": 10
          },
          "maxTotalVideos": {
            "title": "Maximum videos per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Global safety limit after duplicate video IDs are merged.",
            "default": 50
          },
          "lookbackDays": {
            "title": "Lookback window in days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Ignore older channel and search results. Direct video URLs bypass this filter.",
            "default": 30
          },
          "regionCode": {
            "title": "YouTube region",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Two-letter country code used for search localization.",
            "default": "US"
          },
          "monitorId": {
            "title": "Monitor ID",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$",
            "maxLength": 80,
            "type": "string",
            "description": "Persistent state key. Leave empty for a stateless run that analyzes every discovered video."
          },
          "firstRunMode": {
            "title": "First monitored run",
            "enum": [
              "analyze_all",
              "establish_baseline"
            ],
            "type": "string",
            "description": "Analyze existing videos immediately, or store them as a baseline and wait for future uploads.",
            "default": "analyze_all"
          },
          "forceReprocess": {
            "title": "Reprocess known videos",
            "type": "boolean",
            "description": "Analyze video IDs already recorded under this monitor ID. Useful after changing risk rules.",
            "default": false
          },
          "analyzeTranscripts": {
            "title": "Analyze captions and transcripts",
            "type": "boolean",
            "description": "Use the preferred caption track when one is publicly available. Metadata is still analyzed without captions.",
            "default": true
          },
          "preferredTranscriptLanguages": {
            "title": "Preferred transcript languages",
            "maxItems": 10,
            "uniqueItems": true,
            "type": "array",
            "description": "Language codes in priority order. The first available track is used as fallback.",
            "items": {
              "type": "string"
            },
            "default": [
              "en"
            ]
          },
          "includeTranscript": {
            "title": "Include full transcript text",
            "type": "boolean",
            "description": "Store full transcript text in each dataset row. Disabled by default to keep results compact.",
            "default": false
          },
          "maxTranscriptCharacters": {
            "title": "Maximum transcript characters",
            "minimum": 10000,
            "maximum": 250000,
            "type": "integer",
            "description": "Maximum caption text analyzed per video.",
            "default": 100000
          },
          "brandTerms": {
            "title": "Your brand terms",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Brand, product, campaign, or spokesperson names to find. Matching is case-insensitive and term-bounded.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "competitorTerms": {
            "title": "Competitor terms",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Competitor brands or products that should trigger evidence and optional alerts.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "enabledRiskCategories": {
            "title": "Brand-safety categories",
            "uniqueItems": true,
            "type": "array",
            "description": "Evidence-based term categories to evaluate. Findings are signals for review, not automated compliance decisions.",
            "items": {
              "type": "string",
              "enum": [
                "adult",
                "violence",
                "drugs",
                "gambling",
                "profanity",
                "harassment"
              ],
              "enumTitles": [
                "Adult content",
                "Violence",
                "Drugs",
                "Gambling",
                "Profanity",
                "Harassment"
              ]
            },
            "default": [
              "adult",
              "violence",
              "drugs",
              "gambling",
              "profanity",
              "harassment"
            ]
          },
          "customRiskTerms": {
            "title": "Custom risk terms",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Organization-specific terms that should create a medium-risk finding.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "minimumAlertRiskLevel": {
            "title": "Minimum alert risk",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "Lowest brand-safety level that triggers an alert.",
            "default": "medium"
          },
          "alertOnSponsorship": {
            "title": "Alert on sponsorship disclosure",
            "type": "boolean",
            "description": "Trigger an alert when sponsorship, paid-promotion, affiliate, or promo-code evidence is found.",
            "default": true
          },
          "alertOnBrandMentions": {
            "title": "Alert on your brand terms",
            "type": "boolean",
            "description": "Trigger an alert when any configured brand term is found.",
            "default": false
          },
          "alertOnCompetitorMentions": {
            "title": "Alert on competitor terms",
            "type": "boolean",
            "description": "Trigger an alert when any configured competitor term is found.",
            "default": true
          },
          "outputMode": {
            "title": "Dataset output",
            "enum": [
              "all",
              "findings_only",
              "alerts_only"
            ],
            "type": "string",
            "description": "Store all analyzed videos, only videos with findings, or only alerting videos.",
            "default": "all"
          },
          "webhookUrl": {
            "title": "Alert webhook URL",
            "type": "string",
            "description": "Optional HTTP(S) endpoint. Each alerting video is sent as one JSON POST request."
          },
          "webhookSecret": {
            "title": "Webhook bearer token",
            "type": "string",
            "description": "Optional encrypted token sent in the Authorization: Bearer header."
          },
          "maxConcurrency": {
            "title": "Request concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Concurrent video metadata requests. Lower this if YouTube starts throttling requests.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}