Node/youtube/README.md
This quickstart demonstrates how to query the YouTube Data API using Cloud Functions for Firebase (2nd Gen) with an HTTPS trigger.
The function getChannelInfo returns information about a Youtube channel. By
default it will return information about the
Firebase YouTube channel, but you can pass it a
channelId URL Query parameter to query any channel you'd like.
npm install --global firebase-tools
firebase login
Node/youtube directory.cd into the functions directory and install dependencies with pnpm installfirebase use --add with the
Firebase CLI, select your Project ID and follow the instructions.firebase functions:secrets:set YOUTUBE_API_KEY
firebase emulators:start --only functions
getChannelInfo function. It will looks something like http://localhost:5001/my-project-id/us-central1/getChannelInfo?channelId=SOME_CHANNEL_ID to the end of the URL.Deploy to Firebase using the following command:
firebase deploy
This deploys and activates the getChannelInfo function.
The first time you call
firebase deployon a new project with Functions will take longer than usual.
Now that you've got this sample working, modify it to work for your use case! Some ideas:
getChannelInfo function to a scheduled function, and write the new latest videos for a channel into Firestore or Realtime Database