Node.js Express Youtube Video Tag Finder Web App Using Youtube-Tags Library Full Example 2020

Node.js Express Youtube Video Tag Finder Web App Using Youtube-Tags Library Full Example 2020




Get Started


In order to get started with this application you need to install these dependencies for your web app


npm i express


npm i nodemon


npm i get-youtube-id


npm i youtube-tags



These are the four packages which are required in this project. Install this packages after executing the command


npm init -y


to make the package.json file


Now build the index.js file and copy paste the following code shown below






const express = require('express')

const youtubeTags = require('youtube-tags')

const fs = require('fs')

const bodyParser = require('body-parser')

var getYouTubeID = require('get-youtube-id');

const app = express()



const PORT = 4000

app.get('/',(req,res) => {
    res.sendFile(__dirname + "/index.html")
})'/tagfinder',async (req,res) => {
    // extract the video id

    var url = req.body.url

    var id = getYouTubeID(url);


    // get the tags of the youtube video

    var tags = await youtubeTags.getYoutubeTags(id)
    var content
    tags.forEach(tag => {
        content += tag

    fs.writeFileSync("file.txt",content,(err) => {
        if(err) throw err

app.listen(PORT,() => {
    console.log(`App is listening on Port ${PORT}`)


See also  Build a CSS to Javascript Inline Styles Objects Converter in Browser Using Vanilla Javascript Full Project For Beginners



Now make the html file so that user can see the interface where he can interact with the application.







<!DOCTYPE html>
    <title>Youtube Video Tag Finder</title>
      <div class="container">
          <h1 class="text-center">
              Youtube Tag Finder
          <form action="/tagfinder" method="post">
            <div class="form-group">
                <label for="url">Youtube URL</label>
                <input type="text" name="url" required placeholder="Youtube URL" class="form-control">
            <div class="form-group">
                <button class="btn btn-danger btn-block">
                    Get Tags
  <script src=""></script>








Leave a Reply