arazzo: 1.0.1
info:
title: YouTube Trending Videos to Playlist
summary: Pull the most popular videos for a region, create a playlist, and add the top trending video to it.
description: >-
Curates trending content into a saved collection. It requests the most
popular videos chart for a region, creates a new playlist, and inserts the
top trending video into that playlist. Every step spells out its request
inline so the flow can be read and executed without opening the underlying
OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-3710
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-3710
capability_name: Media Asset Management
spec: youtube-videos-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: playlistitemsApi
url: ../openapi/youtube-playlistitems-api-openapi.yml
type: openapi
- name: playlistsApi
url: ../openapi/youtube-playlists-api-openapi.yml
type: openapi
- name: videosApi
url: ../openapi/youtube-videos-api-openapi.yml
type: openapi
workflows:
- workflowId: trending-to-playlist
summary: Capture the top trending video and save it into a new playlist.
description: >-
Lists the most popular videos chart, creates a new playlist, and adds the
first trending video to that playlist.
inputs:
type: object
required:
- apiKey
- playlistTitle
properties:
apiKey:
type: string
description: The Google API key used to authorize each YouTube Data API request.
playlistTitle:
type: string
description: The title for the new playlist of trending videos.
privacyStatus:
type: string
description: The privacy status of the new playlist.
default: private
steps:
- stepId: getTrending
description: Request the most popular videos chart and capture the top video id.
operationId: youtube.videos.list
parameters:
- name: part
in: query
value: snippet,statistics
- name: chart
in: query
value: mostPopular
- name: maxResults
in: query
value: 10
- name: key
in: query
value: $inputs.apiKey
successCriteria:
- condition: $statusCode == 200
outputs:
topVideoId: $response.body#/items/0/id
topVideoTitle: $response.body#/items/0/snippet/title
- stepId: createPlaylist
description: Create a new playlist to hold the trending video.
operationId: youtube.playlists.insert
parameters:
- name: part
in: query
value: snippet,status
- name: key
in: query
value: $inputs.apiKey
requestBody:
contentType: application/json
payload:
snippet:
title: $inputs.playlistTitle
status:
privacyStatus: $inputs.privacyStatus
successCriteria:
- condition: $statusCode == 200
outputs:
playlistId: $response.body#/id
- stepId: addTrendingVideo
description: Insert the top trending video into the new playlist.
operationId: youtube.playlistItems.insert
parameters:
- name: part
in: query
value: snippet
- name: key
in: query
value: $inputs.apiKey
requestBody:
contentType: application/json
payload:
snippet:
playlistId: $steps.createPlaylist.outputs.playlistId
resourceId:
kind: youtube#video
videoId: $steps.getTrending.outputs.topVideoId
successCriteria:
- condition: $statusCode == 200
outputs:
playlistItemId: $response.body#/id
outputs:
topVideoId: $steps.getTrending.outputs.topVideoId
playlistId: $steps.createPlaylist.outputs.playlistId
playlistItemId: $steps.addTrendingVideo.outputs.playlistItemId
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.