npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

youtube-downloader-cc-api

v1.0.4

Published

A simple wrapper for the Youtube Downloader CC API for downloading YouTube videos as MP3 or MP4.

Readme

🎬 YouTube Downloader CC API

A simple and easy-to-use Node.js package that allows you to download YouTube videos as MP3 or MP4 and updated in March 21 2025. Built and maintained by Jonell Magallanes.

🔗 Admin: Jonell Magallanes


📥 Installation

First, install the package using npm:

npm install youtube-downloader-cc-api

This will automatically install all required dependencies.


✨ Features

✅ Download YouTube videos as MP3 (audio) or MP4 (video)
✅ Choose between two response types:

  • "stream" → Returns a JSON response with a download link
  • "direct" → Automatically downloads the file locally
    Fast and simple API for developers

🚀 How to Use

1️⃣ Import the Library

Before using the downloader, you need to import the function:

const { getDownloadDetails } = require("youtube-downloader-cc-api");

2️⃣ Fetch Download Details

Now, call the function with three parameters:

  • YouTube URL → The video you want to download
  • Type → Choose "mp3" for audio or "mp4" for video
  • Response Type"stream" for JSON output or "direct" to auto-download

🎧 Example: Get Download Link (Stream Response)

If you only need the download link, use the "stream" response type:

const { getDownloadDetails } = require("youtube-downloader-cc-api");

(async () => {
  try {
    const url = "https://youtu.be/Rb1HSnuR8WE"; // Replace with your YouTube link
    const type = "mp3"; // Choose "mp3" or "mp4"
    const responseType = "stream"; // Get the JSON response (link only)

    const response = await getDownloadDetails(url, type, responseType);
    console.log("Download Details:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
})();

📝 Output (Stream Response)

If responseType is "stream", the function returns a JSON object like this:

{
  "url": "https://youtu.be/Rb1HSnuR8WE",
  "download": "https://yt-downloader-ccprojects-production.up.railway.app/download/1737550613.mp3",
  "title": "Family Guy Funny Spelling",
  "response": "Time Response: Wed Jan 22 12:56:57 2025",
  "author": "Jonell Hutchin Magallanes"
}

🔹 Best for: Developers who want to display the download link to users instead of downloading the file directly.


🎥 Example: Auto-Download (Direct Response)

If you want to automatically download the video or audio file, use the "direct" response type:

const { getDownloadDetails } = require("youtube-downloader-cc-api");

(async () => {
  try {
    const url = "https://youtu.be/Rb1HSnuR8WE"; // Replace with your YouTube link
    const type = "mp4"; // Choose "mp3" or "mp4"
    const responseType = "direct"; // Auto-download the file

    const response = await getDownloadDetails(url, type, responseType);
    console.log(`✅ File saved at: ${response.path}`);
  } catch (error) {
    console.error("Error:", error.message);
  }
})();

📂 Output (Direct Download)

If responseType is "direct", the function will automatically download the file to your local machine:

Downloading [####################] 100% | 8.6MB/8.6MB bytes
✅ Download complete!
File saved at: /your/path/downloaded_file.mp4

🔹 Best for: Users who want to instantly download the video/audio without extra steps.


📜 API Reference

getDownloadDetails(url, type, responseType)

This function fetches the download details for a given YouTube video.

| Parameter | Type | Required | Description | |---------------|--------|----------|----------------------------------------------------------| | url | String | Yes | The YouTube video URL. | | type | String | Yes | Choose "mp3" for audio or "mp4" for video. | | responseType| String | Yes | "stream" (get link as JSON) or "direct" (auto-download). |


🛠️ Install Dependencies (Optional)

The required dependencies are automatically installed, but if needed, you can manually install them:

npm install axios cli-progress fs path

🎯 Example Output in Node.js

When you run the example code, you will see output like this:

For stream response type:

{
  "url": "https://youtu.be/Rb1HSnuR8WE",
  "download": "https://yt-downloader-ccprojects-production.up.railway.app/download/1737550613.mp3",
  "title": "Family Guy Funny Spelling",
  "response": "Time Response: Wed Jan 22 12:56:57 2025",
  "author": "Jonell Hutchin Magallanes"
}

For direct response type:

Downloading [####################] 100% | 8.6MB/8.6MB bytes
✅ Download complete!
File saved at: /your/path/downloaded_file.mp4

🌐 Main Server of Youtube DL

This Main Server of Youtube DL CC visit https://jonell01-youtube-dl-ccapi-hutchin.hf.space/ for more info


🎉 Conclusion

The YouTube Downloader CC API makes it easy and efficient to download YouTube videos in MP3 or MP4 format. Whether you want to get a download link or automatically save the file, this library is built to be simple and developer-friendly.

🚀 Start using it today and integrate YouTube downloads into your projects!


💬 Join Our Community

Join the Chatbot Community Group on Facebook to connect with other developers:
🔗 Chatbot Community


🎖️ Special Thanks:
💡 Salamat sa CCPRAKJIK 19 na commands ko 🤑