# Website YouTube Embed Health Gate (`bread-kim/website-youtube-embed-health-gate`) Actor

Audit YouTube embeds across website pages before release. Detect missing, malformed, or changed embed references and generate a clear health report for QA and regression checks.

- **URL**: https://apify.com/bread-kim/website-youtube-embed-health-gate.md
- **Developed by:** [bread kim](https://apify.com/bread-kim) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website YouTube Embed Inventory & Health Gate

Private Apify Actor source for bounded maintenance checks of customer-owned public websites. It parses static HTML `iframe[src]` and `a[href]` attributes, inventories exact supported YouTube video IDs, calls only YouTube's public oEmbed endpoint, compares a caller-owned baseline, and writes JSON, CSV, static HTML, a manifest, and a deterministic ZIP.

This is not a search, channel, comments, views, transcript, download, playback, engagement, or generic link-checking product. An oEmbed response does not prove browser playback, geographic/global availability, age access, monetization, or ownership. Instagram and Threads are not supported because no currently verified general-crawler robots-permitted route is used here; that is not a claim that those services are globally impossible to crawl.

### Local QA

Requires Node.js 22.23.3.

```sh
npm ci --ignore-scripts
npm run typecheck
npm test
npm run preflight
```

The no-network smoke path is selected only with `AUTOMATON_CONTAINER_SMOKE=1`. It runs the built-in fixture through the production parser, observation, baseline, reporting, schema, and package path. `canary_input.json` uses the same demo mode. Demo observations are deterministic QA data, not live availability evidence.

For local storage, set `APIFY_STORAGE_DIR` and place input at `key_value_stores/default/INPUT.json`. A valid success creates exactly one default dataset item plus fixed KVS records. Invalid input creates only safe `OUTPUT.json` failure data.

### Authorization and limits

Customers must be authorized to crawl each supplied site and comply with applicable terms and law. The Actor enforces public HTTPS, exact-origin navigation, robots.txt, DNS and connected-peer checks, redirects, response bytes, timeouts, page/video/occurrence limits, and a 120-second wall clock. Static HTML only; there is no browser or JavaScript rendering.

Host configuration before publication: Private lifecycle, LIMITED_PERMISSIONS, 256 MiB minimum and 512 MiB maximum memory, and `restartOnError: false`. This repository does not deploy or mutate those host settings.

Icon concept: one large browser-window board containing a single video play tile with a small check mark; no Instagram or Threads logos.

# Actor input Schema

## `demoMode` (type: `boolean`):

Run a deterministic fixture through production parsing and reporting without network access.

## `startUrls` (type: `array`):

One to ten owned, public, query-free HTTPS URLs; required outside demo mode.

## `videoUrls` (type: `array`):

Optional supported public YouTube URLs to include explicitly.

## `crawl` (type: `object`):

Strict page, depth, timeout, and response limits.

## `baseline` (type: `array`):

Optional prior inventory used for conservative change comparison.

## Actor input object example

```json
{
  "demoMode": true,
  "videoUrls": [],
  "baseline": []
}
```

# Actor output Schema

## `output` (type: `string`):

The safe authoritative record; successful runs also write it once to the default dataset.

## `dataset` (type: `string`):

Exactly one populated summary record for a successful valid-input run.

## `result` (type: `string`):

Full inventory JSON.

## `csv` (type: `string`):

Spreadsheet-formula-neutralized inventory.

## `report` (type: `string`):

Escaped report without scripts or remote assets.

## `manifest` (type: `string`):

SHA-256 and sizes for ZIP payload files except the manifest itself.

## `zip` (type: `string`):

Deterministic five-file report bundle.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "demoMode": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("bread-kim/website-youtube-embed-health-gate").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "demoMode": True }

# Run the Actor and wait for it to finish
run = client.actor("bread-kim/website-youtube-embed-health-gate").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "demoMode": true
}' |
apify call bread-kim/website-youtube-embed-health-gate --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bread-kim/website-youtube-embed-health-gate"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/sB8PBqzqa66p1axbm/builds/lOTbJYkpMiZh5ln7y/openapi.json
