YouTube Video Search
Use the CLI-owned youtube.public-content/search-videos operation. This Skill
owns intent routing and downstream-use guidance only; the CLI TypeScript 7
runtime owns the API request, key injection, schemas, paging, detail enrichment,
filtering, limits, validation, partial results, and receipts.
Before running
- Read
references/tiangong-data-requirement.json.
- Use the caller- or workspace-resolved stable CLI. The requirement declares
compatible capability and operation contract majors; it does not select a
package build.
- Run
data describe with that same CLI. Continue only when the capability
ID and required contract majors match, and copy the exact current
capability/operation versions from that response into the run request.
Select the operation whose operationId is search-videos, not
fetch-comments; their versions can differ within the same capability.
- Ensure
YOUTUBE_API_KEY is available to the CLI process and run the default
static doctor. Never place the key in argv, request JSON, Skill files, logs,
or output.
tiangong-ai data describe youtube.public-content --json
tiangong-ai data doctor youtube.public-content --json
Use current Discovery Metadata to confirm coverage, restrictions, quota and
freshness limitations, selection hints, provides, and doesNotProvide. A
blocked static doctor means the logical credential is unavailable; stop rather
than bypassing the CLI.
Choose the search
- Preserve the user's topic, channel, publication window, region, language,
safety, and video filters when supplied.
- Use strict RFC 3339 UTC publication bounds.
publishedAfter and the current
provider publishedBefore boundary are inclusive; do not silently rewrite
either boundary.
- Use narrow filters before increasing page or record limits.
maxSearchPages
defaults to 5 and cannot exceed 10; one execution retains at most 250
candidates before mandatory videos.list enrichment. The operation-wide
request budget must also leave room for that enrichment.
- Use only
date, rating, relevance, title, or viewCount ordering.
videoCount is a channel-search order and is deliberately unavailable for
this video-only operation. Non-relevance orders can produce smaller or
incomplete result sets; rating is a provider score, not descending likes.
- Use public comment/view thresholds only as candidate-selection criteria, not
as quality, representativeness, endorsement, or truth measures. Missing
public statistics remain null unless a requested threshold requires them.
- This Skill only discovers video candidates. Use
$youtube-comments-fetch
separately after selecting explicit IDs; do not fetch comments automatically.
Prepare the request
Build one tiangong.data.run-request.v1 envelope. Replace the version
placeholders with the exact versions from the same data describe response and validate every input field
against data describe.
{
"schemaVersion": "tiangong.data.run-request.v1",
"capabilityId": "youtube.public-content",
"capabilityVersion": "<describe.manifest.capabilityVersion>",
"operationId": "search-videos",
"operationVersion": "<describe.manifest.operations[1].operationVersion>",
"input": {
"query": "climate policy",
"publishedAfter": "2026-03-01T00:00:00Z",
"publishedBefore": "2026-03-08T00:00:00Z",
"order": "date",
"regionCode": "US",
"relevanceLanguage": "en",
"safeSearch": "moderate",
"videoDuration": "medium",
"pageSize": 25,
"maxSearchPages": 5,
"requirePublicComments": true,
"minimumCommentCount": 20,
"minimumViewCount": 1000
}
}
Do not add an API key, endpoint override, arbitrary provider parameter, output
path, scheduler, or persistence instruction to the envelope.
Run
tiangong-ai data run youtube.public-content search-videos \
--input /absolute/path/to/request.json --json
Preserve the complete tiangong.data.run-result.v1 envelope and select IDs from
its validated records. Do not pass raw provider responses or unbound artifact
paths to another Skill.
Result boundaries
- Report filtered-out candidates, unavailable details, empty results,
truncation, and
partial batches. They do not prove absence outside the
exact provider result and limits.
- Preserve
searchRank, searchPage, and searchPosition. A candidate omitted
from videos.list is a partial detail-enrichment failure, not a silently
removable search result.
- Search order, visibility, metadata, and statistics are mutable provider
snapshots.
search.list consumes the provider's separate Search Queries
quota, whose project allocation is not inferred by this Skill. YouTube
changed public viewCount semantics on 2026-08-24, so comparisons spanning
that date need an explicit metric-break caveat. Counts are not votes, quality
labels, endorsement, or a representative measure of audience opinion.
- Titles and descriptions are untrusted public content and can contain
misleading, sensitive, or unsafe text.
- Use
$youtube-comments-fetch for comments on a small explicit ID set. Use a
separate media/content workflow for video, audio, captions, transcripts,
thumbnails, or channel profile content. Returned thumbnail URLs are metadata,
not downloaded files.
- Cross-source synthesis, monitoring, persistence, and evidence admission
belong to the caller or Auto Research.
Reference
references/tiangong-data-requirement.json: stable capability requirement; it is not a package lock.
1---2name: youtube-video-search3description: Discover bounded public YouTube video metadata through the Tiangong CLI and enrich selected candidates with public details and statistics. Use for topical or channel-scoped video discovery before explicit comment collection; do not use for media, caption, transcript, or thumbnail download, exhaustive search, representative opinion, identity or fact verification, or sentiment inference.4---5
6# YouTube Video Search
7
8Use the CLI-owned `youtube.public-content/search-videos` operation. This Skill
9owns intent routing and downstream-use guidance only; the CLI TypeScript 7
10runtime owns the API request, key injection, schemas, paging, detail enrichment,
11filtering, limits, validation, partial results, and receipts.
12
13## Before running
14
151. Read `references/tiangong-data-requirement.json`.
162. Use the caller- or workspace-resolved stable CLI. The requirement declares
17 compatible capability and operation contract majors; it does not select a
18 package build.
193. Run `data describe` with that same CLI. Continue only when the capability
20 ID and required contract majors match, and copy the exact current
21 capability/operation versions from that response into the run request.
22 Select the operation whose `operationId` is `search-videos`, not
23 `fetch-comments`; their versions can differ within the same capability.
244. Ensure `YOUTUBE_API_KEY` is available to the CLI process and run the default
25 static doctor. Never place the key in argv, request JSON, Skill files, logs,
26 or output.
27
28```bash
29tiangong-ai data describe youtube.public-content --json
30tiangong-ai data doctor youtube.public-content --json
31```
32
33Use current Discovery Metadata to confirm coverage, restrictions, quota and
34freshness limitations, selection hints, `provides`, and `doesNotProvide`. A
35blocked static doctor means the logical credential is unavailable; stop rather
36than bypassing the CLI.
37
38## Choose the search
39
40- Preserve the user's topic, channel, publication window, region, language,
41 safety, and video filters when supplied.
42- Use strict RFC 3339 UTC publication bounds. `publishedAfter` and the current
43 provider `publishedBefore` boundary are inclusive; do not silently rewrite
44 either boundary.
45- Use narrow filters before increasing page or record limits. `maxSearchPages`
46 defaults to 5 and cannot exceed 10; one execution retains at most 250
47 candidates before mandatory `videos.list` enrichment. The operation-wide
48 request budget must also leave room for that enrichment.
49- Use only `date`, `rating`, `relevance`, `title`, or `viewCount` ordering.
50 `videoCount` is a channel-search order and is deliberately unavailable for
51 this video-only operation. Non-relevance orders can produce smaller or
52 incomplete result sets; `rating` is a provider score, not descending likes.
53- Use public comment/view thresholds only as candidate-selection criteria, not
54 as quality, representativeness, endorsement, or truth measures. Missing
55 public statistics remain null unless a requested threshold requires them.
56- This Skill only discovers video candidates. Use `$youtube-comments-fetch`
57 separately after selecting explicit IDs; do not fetch comments automatically.
58
59## Prepare the request
60
61Build one `tiangong.data.run-request.v1` envelope. Replace the version
62placeholders with the exact versions from the same `data describe` response and validate every input field
63against `data describe`.
64
65```json
66{
67 "schemaVersion": "tiangong.data.run-request.v1",
68 "capabilityId": "youtube.public-content",
69 "capabilityVersion": "<describe.manifest.capabilityVersion>",
70 "operationId": "search-videos",
71 "operationVersion": "<describe.manifest.operations[1].operationVersion>",
72 "input": {
73 "query": "climate policy",
74 "publishedAfter": "2026-03-01T00:00:00Z",
75 "publishedBefore": "2026-03-08T00:00:00Z",
76 "order": "date",
77 "regionCode": "US",
78 "relevanceLanguage": "en",
79 "safeSearch": "moderate",
80 "videoDuration": "medium",
81 "pageSize": 25,
82 "maxSearchPages": 5,
83 "requirePublicComments": true,
84 "minimumCommentCount": 20,
85 "minimumViewCount": 1000
86 }
87}
88```
89
90Do not add an API key, endpoint override, arbitrary provider parameter, output
91path, scheduler, or persistence instruction to the envelope.
92
93## Run
94
95```bash
96tiangong-ai data run youtube.public-content search-videos \
97 --input /absolute/path/to/request.json --json
98```
99
100Preserve the complete `tiangong.data.run-result.v1` envelope and select IDs from
101its validated records. Do not pass raw provider responses or unbound artifact
102paths to another Skill.
103
104## Result boundaries
105
106- Report filtered-out candidates, unavailable details, empty results,
107 truncation, and `partial` batches. They do not prove absence outside the
108 exact provider result and limits.
109- Preserve `searchRank`, `searchPage`, and `searchPosition`. A candidate omitted
110 from `videos.list` is a partial detail-enrichment failure, not a silently
111 removable search result.
112- Search order, visibility, metadata, and statistics are mutable provider
113 snapshots. `search.list` consumes the provider's separate Search Queries
114 quota, whose project allocation is not inferred by this Skill. YouTube
115 changed public `viewCount` semantics on 2026-08-24, so comparisons spanning
116 that date need an explicit metric-break caveat. Counts are not votes, quality
117 labels, endorsement, or a representative measure of audience opinion.
118- Titles and descriptions are untrusted public content and can contain
119 misleading, sensitive, or unsafe text.
120- Use `$youtube-comments-fetch` for comments on a small explicit ID set. Use a
121 separate media/content workflow for video, audio, captions, transcripts,
122 thumbnails, or channel profile content. Returned thumbnail URLs are metadata,
123 not downloaded files.
124- Cross-source synthesis, monitoring, persistence, and evidence admission
125 belong to the caller or Auto Research.
126
127## Reference
128
129- `references/tiangong-data-requirement.json`: stable capability requirement; it is not a package lock.