An app to see latest YouTube videos and Search using keywords.
This app lets you watch latest YouTube video for any topic. It's search capability is so amazing that you just need to type in the videos you want to watch, we will ensure you get the videos you had in mind.
What it offers:
- See all data related to each YouTube video : Title, Description, Channel, Publish Date etc.
- Search across all the videos to find and we provide you the best video you need.
- Ensures the video library is upto date so that you don't feel outdated!
Here are some of the frameworks I have used
Setting up the project is very simple. You need to run few commands.
Here are some of the softwares you need to run this project
- Latest npm from NodeJS website. If you have it installed, make sure you are on latest:
npm install npm@latest -g
- Mongo DB Community Edition [Windows Download]
-
Get yourself a free YouTube API Key Getting Started with YouTube Data APIs
-
Clone the repo
git clone https://github.com/your_username_/Project-Name.git
-
Install NPM packages
npm install
-
Follow
config.js.example
and createconfig.js
from it. Replace the following items:ApiKey
: This is the key you created in Step 1SecondaryApiKey
(optional): You can have a backup key in case primary one gets exhausted.SearchString
: Topic you want to run the app in. Example: COVID, Cricket, Football.
{ ApiKey: "AIzaSy...", SecondaryApiKey: "SyAU2PP7...", SearchString: "COVID", }
Note that the
SeachString
can contain multiple fields separated by|
likeCOVID | Coronavirus | Pandemic
-
Run the application by using the following command:
npm start
-
Application will start to run and will listen on port
8080
or whatever is configured inconfig.js
Here are the two methods that the application offers
-
List Videos
: All the videos that are available are listed as a part ofsearch
apihttp://localhost:8080/videos/search?q=[searchstring]
searchstring
needs to be replaced with the string you want to search for. You can use space to separate the words.http://localhost:8080/videos/search?q=covid cases india
-
Search API
: This does search across all videos based on your search inputhttp://localhost:8080/videos/show
The output is paginated and hence the caller should make sure they pass the cnsequent page numbers to retrieve the next data.
http://localhost:8080/videos/show?currentPage=2&pageSize=50
This retrieves the next page's results with a total of 50 records max in this page. Response contains the following metadata in order to show if there are more results available.
{"currentPage":1,"pageCount":4,"pageSize":50,"count":178}
Distributed under the GNU License. See LICENSE
for more information.
Ajay B L - linkedin - be.el.ajay@gmail.com
Project Link: https://github.com/ajayaradhya/youtubesearch