XMLTubeInfoFetch is a lightweight Node.js app/function designed to effortlessly retrieve basic video and channel details from the legacy XML-based YouTube API, simplifying data access and integration.
- Simple, Light and Basic to use.
- No API Key needed.
- Parse YouTube XML API to JSON.
- Easy to implement everywhere.
- Two main libraries only: Axios and XML2JS
Some of you may be asking why this simple project is using an inappropriate YouTube API.
YouTube's current API sucks for me in these ways:
- First, the Youtube Oficial API need a
API Key
. - Secound, there's a lot of
Limits
to make requests to their API. - Third,
Rate Limits
are Crazy. - Fourth, I need a
very basic API Wrapper
, just forfetch basic information
, I already tryed the oficial wrappers on, but it's very stressful having to create an API Key for such a small project. - Fifth, I started these project for an Discord Youtube Notification's Bot. If i use current v3 of YouTube API, I will spam and get
Rated Limited
every time for checking if there's a new video from a YouTube Channel. I tryed these a long time ago and I just forfeit. I watch a lot of popular Discord Bots getting rated limited by youtube and yeah.....
Like i sayed before, it's pretty simple to use it.
-
Download the project be:
-
git clone https://github.com/GuikiPT/XMLTubeInfoFetcher.git
if you have git installed. -
Or clicking on
<> Code
and after inDownload Zip
.
If you download as zip, you need to uncompress the file!.
-
-
Open the folder of the project.
-
Make sure you have Node.JS installed, and if not, install it: NodeJS Download Website Page.
-
Inside the project folder, open a terminal (Bash for Linux and CMD or PowerShell for Windows, don't ask me for MacOs, because I not have one to test, but if you want to give me one I really appreciate 😊)
-
Install necessary modules be doing
npm install
. -
On the main.js edit the
const channel_id = '';
with the desired YouTube Channel Id. -
Simply execute the project be doing
npm start
ornpm main.js
; -
They will retrieve an console log with information about the channel and latest videos:
{
"author": {
"name": "Name of the YouTube Channel - String",
"url": "Url for YouTube Channel - String",
"id": "Id of the YouTube Channel - String",
"created_at": 1231313213 # Created Channel Timestammp - Number - Unix Time
},
"videos": [
{
"channel_id": "Id of the YouTube Channel - String",
"video_id": "Id of the YouTube Video - String",
"title": "The Title of the YouTube Video - String",
"url": "Url for YouTube Video - String",
"description": "The YouTube Video Description - String",
"thumbails": {
"default": "Default Thumbnail Image Url - String",
"hq_default": "High Quality Thumbnail Image Url - String",
"mq_default": "Medium Quality Thumbnail Image Url - String",
"sd_default": "Standard Quality Thumbnail Image Url - String",
"max_res_default": "Maximum Resolution Quality Thumbnail Image Url - String",
},
"community": {
"star_rating" {
"count": 123, # Number of Likes - Number
"average": 123, # Average number of likes - Number
"min": 123, # ?? - Number
"max": 123 # ?? - Number
}
},
"published_at": 12312321123, # Video Published Time - Number - Unix Time
"lastUpdate_at": 12312312312, # Last Video Update Status Time - Number - Time
},
{
...
}
]
}
See?
It's EZ PZ to get basic information about.