YouTube Integration in Outerbase
Introduction
Outerbase Commands offer a flexible method for simplifying a variety of tasks within the Outerbase ecosystem. It will integrate any popular APIs to view the details of the desired functionality effortlessly. For more information about Outerbase commands, please refer to the official documentation here
This article discusses about the development of Outerbase command for YouTube integration.
Youtube
YouTube is a popular online video-sharing platform that allows users to upload, view, share, and interact with videos. YouTube has become an integral part of online culture, providing a platform for entertainment, education, information, and creativity for billions of users worldwide.
Youtube API Testing
Below is a quick python snippet that will test youtube video API endpoint
import requests
API_KEY = 'YOUTUBE_API_KEY'
VIDEO_ID = 'uH-ffKIgb38'
url = f'https://www.googleapis.com/youtube/v3/videos?id={VIDEO_ID}&key={API_KEY}&part=snippet,contentDetails,statistics'
response = requests.get(url)
if response.status_code == 200:
video_data = response.json()
else:
print(f'Error: {response.status_code}')
Outerbase Command
After testing the API, it is time to write your Outerbase Command function.
async function userCode() {
var videoid = {{request.query.videoid}}
if (!videoid) {
return {
status: 400,
error: "missing video id"
}
}
const apiUrl = "https://www.googleapis.com/youtube/v3/videos?id="+ videoid +"&key=AIzaSyDIPxAnxEoj_fbrV3d0FIvN0ictQ4n92Yo&part=snippet,contentDetails,statistics";
const response = await fetch(apiUrl, {
method: "GET"
});
return response.json()
}
YouTube Video Infoviewer Streamlit app
For the quick POC, I have developed a Streamlit App that does the functionality of fetching Youtube video descriptions, stats & other details.
Below are the screenshots that explain about the App and its functionality
https://youtube-video-info-viewer.streamlit.app
Demo Video & Github Repo Link
Please find the attached link to the demo video here & Github Repository link here
Conclusion
Integration of Youtube as Outerbase command will help you understand the stats and information of the particular youtube video. Please let me know if you have any questions.
A big thank you for taking the time to read my article and shoutout to the outerbase & hashnode team for hosting this amazing hackathon. Please support me by liking the article and sharing the article if you like it, and follow me for more related articles.
#outerbase #outerbasehackathon #hashnode
Subscribe to my newsletter
Read articles from Balaji Seetharaman directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Balaji Seetharaman
Balaji Seetharaman
Hey there ๐๐ผ I am Balaji Seetharaman. Currently working as a Senior Software Engineer at Extreme Networks and outgoing grad student from BITS Pilani with Masters in Data Analytics Specialization. Below are a few words about me. IBM-certified Quantum developer and Qiskit advocate. Azure-certified Cloud practitioner Selected as one of the Top 200 creators as part of the LinkedIn Creator Accelerator Program. Open Source Enthusiast, contributed to several Open Source Projects in Quantum Computing and Data Science. Passionate about teaching new technology and making things simple and fun for the learners. Volunteer Teacher at Evidhyaloka, a non-profit organization that teaches rural Indian kids online.