> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/docs/sources/source-compliance-youtube.md).

# Source Compliance: YouTube

> Implementation-time review completed 2026-05-17. Trend Finder has a configured Apify source declaration for public YouTube creator-video metadata. Direct YouTube Data API notes below are implementation guidance for a future direct adapter, not a blocker for the Apify Actor/Dataset path.

***

## Source Overview

| Field               | Value                                                                       |
| ------------------- | --------------------------------------------------------------------------- |
| Source Name         | YouTube                                                                     |
| API Base URL        | `https://www.googleapis.com/youtube/v3/`                                    |
| API Documentation   | <https://developers.google.com/youtube/v3>                                  |
| API Terms           | <https://developers.google.com/youtube/terms/api-services-terms-of-service> |
| Developer Policies  | <https://developers.google.com/youtube/terms/developer-policies>            |
| Quota Documentation | <https://developers.google.com/youtube/v3/determine\\_quota\\_cost>         |
| Authentication      | API key for public data; OAuth for authorized user data                     |
| Data Format         | JSON                                                                        |
| Adapter Status      | Configured Apify source declaration; reviewed for Apify Actor adaptation    |

***

## Phase 06 Candidate Declaration

| Field                   | Value                                                                                         |
| ----------------------- | --------------------------------------------------------------------------------------------- |
| Source ID               | `youtube-ai-creator-videos`                                                                   |
| Primary Apify candidate | `api-ninja/youtube-search-scraper`                                                            |
| Fallback candidate      | `powerai/youtube-video-search-scraper`                                                        |
| Validation status       | Fixture-backed and live tiny-validated on 2026-05-17; rerun is credential-gated               |
| Direct adapter status   | Deferred; quota, privacy, and prohibited-data requirements must be enforced before direct use |

***

## Terms of Service

Direct YouTube Data API use is governed by the YouTube API Services Terms of Service, Developer Policies, YouTube Terms, quota rules, API credentials, and related Google policies. The current policy set is stricter than most planned Trend Finder sources and must be re-reviewed before a direct API adapter is implemented.

Trend Finder's hackathon source path uses configured Apify Actors and Apify Datasets. Those direct API notes should not be treated as a blanket disable gate for the Apify Actor integration.

**Key obligations for any YouTube source path**:

* Use only documented YouTube API Services.
* Protect API credentials and never expose them through `VITE_` variables.
* Provide and follow a privacy policy if the API client is distributed beyond local self-use.
* Do not download, back up, cache, or store audiovisual content.
* Do not request OAuth scopes for features that are not implemented.
* Do not collect authorized user data for this project unless a separate privacy and consent review is completed.
* Delete API data if API access is suspended or terminated.
* Avoid analytics that could be interpreted as measuring YouTube's business, usage, revenue, or platform performance.

***

## Quotas and Rate Limits

| Parameter               | Value                                                          |
| ----------------------- | -------------------------------------------------------------- |
| Default project quota   | 10,000 units per day                                           |
| Minimum request cost    | 1 quota unit, including invalid requests                       |
| `search.list` cost      | 100 units per request                                          |
| Common read list cost   | Usually 1 unit per request                                     |
| Daily reset             | Midnight Pacific Time                                          |
| Required implementation | Quota-budget configuration, stop-on-quota, and no retry storms |

A future adapter must budget quota before collection begins. Because `search.list` is expensive, the adapter should cap searches tightly and prefer specific list endpoints when a known channel or video ID is already available.

***

## Data Collection Boundary

Approved browser-safe evidence boundary for the Apify Actor path:

| Data Element             | API Field              | Stored As                 | PII Risk                 |
| ------------------------ | ---------------------- | ------------------------- | ------------------------ |
| Video title              | `snippet.title`        | Evidence title            | Low; public metadata     |
| Video URL or ID          | `id.videoId` or `id`   | Evidence URL/ID           | None                     |
| Channel title            | `snippet.channelTitle` | Source/context label      | Low                      |
| Published timestamp      | `snippet.publishedAt`  | `publishedAt`             | None                     |
| Description snippet      | `snippet.description`  | Optional evidence excerpt | Medium; avoid by default |
| View/like/comment counts | `statistics.*`         | Relevance input           | None                     |

Excluded from Trend Finder browser-safe artifacts: video files, audio, thumbnails cached as files, transcripts, comments, commenter names, private channel data, authorized account data, or write operations.

The safest first adapter should store video title, canonical URL, channel title, publish time, and public aggregate counts only.

***

## Data Retention

| Policy               | Value                                                                                         |
| -------------------- | --------------------------------------------------------------------------------------------- |
| Storage location     | `src/data/live-data.json` and private cache snapshots                                         |
| Retention period     | `live-data.json` overwritten on each collection run; snapshots retained locally until deleted |
| Historical retention | Local snapshots only; no reviewed YouTube historical source window support                    |
| Deletion path        | Delete generated Trend Finder data and snapshots                                              |
| Termination path     | Stop API access and delete YouTube-derived generated data                                     |
| Backup               | None                                                                                          |

Because YouTube API terms include deletion obligations on termination, no additional durable store should be added for YouTube-derived data without a separate ADR and policy review.

***

## Phase 14 Historical Window Stance

| Field                  | Value                                                                                                |
| ---------------------- | ---------------------------------------------------------------------------------------------------- |
| Historical support     | Current-only                                                                                         |
| Source ID              | `youtube-ai-creator-videos`                                                                          |
| Safe override fields   | None                                                                                                 |
| Unsupported reason     | The reviewed Actor input uses relative `uploadDate` values and has no bounded start/end date fields. |
| Compliance declaration | `historicalWindowSupport.supported = false`                                                          |

Do not map a requested historical window to YouTube relative upload-date filters. YouTube quota, deletion, and API policy requirements need a separate review before any historical source path is enabled. This stance does not approve persistent YouTube history.

***

## Privacy and GDPR Assessment

| Criterion                 | Status                     | Notes                                     |
| ------------------------- | -------------------------- | ----------------------------------------- |
| PII collected             | Planned no                 | Avoid comments and authorized data        |
| User consent needed       | No for public API key data | Required if OAuth scopes are ever used    |
| Data subject rights       | Deletion path required     | Delete generated Trend Finder data/cache  |
| Cross-border transfer     | N/A                        | Data remains local                        |
| Data processor agreements | N/A                        | No third-party processing by Trend Finder |
| Legitimate interest basis | Needs legal review         | YouTube policy restrictions are strict    |

***

## Attribution

When YouTube-sourced evidence is displayed, the UI must show:

* Source identifier: `youtube-ai-creator-videos`
* Source name: "YouTube AI creator videos"
* Link to the original YouTube watch page
* Channel name when stored
* No implication of YouTube sponsorship or endorsement

***

## Implementation Notes

* `youtube-ai-creator-videos` is a configured Apify source declaration with `reviewed` compliance status for the Apify Actor/Dataset path. Phase 06 Session 01 records the API Ninja primary candidate and PowerAI fallback.
* Phase 06 Session 02 adds fixture-backed normalizer coverage for canonical watch URLs, public video metadata, views, likes, comments, publish times, and transcript/comment/media exclusion. The 2026-05-17 live tiny validation returned 5 items and 5 public URLs for the configured source.
* Env config may enable the source when `APIFY_TOKEN` and a concrete Actor ID are configured, provided the Actor ID is not a known unresolved placeholder.
* Normalization should keep public video metadata and aggregate metrics, while dropping transcript/comment/media fields from browser-safe evidence.
* Any future direct API source path must decide whether a privacy policy is required for local or distributed use before collection is enabled.
* Future direct API work must add quota-budget tests for search/list calls and must not store audiovisual content, comments, transcripts, thumbnails, or authorized user data.

***

## Compliance Checklist

* [x] Terms, developer policies, and quota docs reviewed
* [x] Rate limits and quota costs documented
* [x] Data retention policy drafted
* [x] PII minimization boundary drafted
* [x] Attribution requirements documented
* [x] Implementation-time terms re-review completed on 2026-05-17
* [x] Apify Actor path separated from future direct API requirements
* [x] Normalizer tests prove transcript/comment exclusions
* [x] Phase 06 primary and fallback Apify candidates recorded
* [x] Phase 06 fixture-backed normalizer validation completed
* [x] Live tiny capped Phase 06 Actor/Dataset validation completed on 2026-05-17
* [x] Phase 14 historical-window stance recorded as current-only
* [ ] Future direct API adapter enforces quota limits if implemented

***

*This document must be reviewed again before adding a direct YouTube API adapter.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/docs/sources/source-compliance-youtube.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
