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

keyword-researcher-realtime

v1.0.0

Published

Get real-time optimized, ranked & grouped YouTube keywords using YouTube Data API + Google Trends

Readme

🎯 YouTube Keyword Optimizer

A Node.js package that takes your video title and returns the most optimized, ranked, and grouped keywords using real-time data from:

  • 📡 YouTube Data API v3 — Extracts keywords from top-ranked videos, titles, descriptions, and tags
  • 📈 Google Trends — Scores each keyword by real-time trend popularity (0–100)

✨ Features

| Feature | Description | |---|---| | 🔍 YouTube-powered | Pulls keyword signals from top 50 real YouTube results | | 📈 Real-time trends | Scores each keyword with Google Trends data (last 90 days) | | 🏆 Smart ranking | Composite score: 40% relevance + 60% trend popularity | | 📂 Auto-grouping | Groups keywords into: Tutorial, Comparison, Tips, Beginner, Advanced, Tools, Trending | | ⚡ Competition level | Flags each keyword as Low / Medium / High competition | | 🖥️ CLI included | Run directly from terminal with beautiful table output |


🚀 Installation

npm install youtube-keyword-optimizer

Or clone and use locally:

git clone <repo>
cd youtube-keyword-optimizer
npm install
cp .env.example .env
# Add your YOUTUBE_API_KEY to .env

🔑 Setup: Get YouTube API Key

  1. Go to Google Cloud Console
  2. Create a project → Enable YouTube Data API v3
  3. Go to Credentials → Create API Key
  4. Add to .env:
YOUTUBE_API_KEY=AIzaSy...your_key_here

📦 Usage (as a package)

const { optimizeKeywords } = require('youtube-keyword-optimizer');

const result = await optimizeKeywords(
  "How to Learn Python for Beginners 2024",  // Your video title
  process.env.YOUTUBE_API_KEY,
  {
    maxKeywords: 30,     // How many keywords to return
    includeTrends: true, // Fetch Google Trends scores
    grouped: true,       // Group into categories
  }
);

// Top keywords
console.log(result.keywords);
// [
//   { keyword: "python for beginners", score: 87, trendScore: 91, competition: "High" },
//   { keyword: "learn python", score: 82, trendScore: 85, competition: "High" },
//   ...
// ]

// Grouped keywords
console.log(result.groups);
// {
//   "🎯 Primary Keywords": [...],
//   "📚 Tutorial & How-To": [...],
//   "🚀 Beginner & Getting Started": [...],
//   ...
// }

// Meta info
console.log(result.meta);
// { title, totalKeywords, topKeyword, avgScore, generatedAt }

🖥️ CLI Usage

# Set your API key
export YOUTUBE_API_KEY=your_key_here

# Run for any video title
node cli.js "How to Make Money on YouTube in 2024"

Output:

🔍 Analyzing: "How to Make Money on YouTube in 2024"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 Primary Keywords
┌──────┬───────────────────────────────────┬───────┬───────┬──────────────┐
│ Rank │ Keyword                           │ Score │ Trend │ Competition  │
├──────┼───────────────────────────────────┼───────┼───────┼──────────────┤
│  #1  │ make money youtube                │  89   │  92   │ High         │
│  #2  │ youtube monetization              │  84   │  88   │ High         │
│  #3  │ youtube channel growth            │  76   │  79   │ Medium       │
└──────┴───────────────────────────────────┴───────┴───────┴──────────────┘

📈 Trending
   youtube shorts monetization, youtube ad revenue...

📚 Tutorial & How-To
   how to monetize, youtube tutorial, grow channel...

📊 Output Format

result.keywords[]

| Field | Type | Description | |---|---|---| | keyword | string | The keyword phrase | | score | number | Composite score 0–100 | | trendScore | number | null | Google Trends score (0–100), null if unavailable | | frequencyScore | number | How often it appeared in YouTube results | | competition | string | "Low" / "Medium" / "High" |

result.groups

Keywords organized into categories:

  • 🎯 Primary Keywords (top 10)
  • 📚 Tutorial & How-To
  • 🔍 Comparison & Review
  • 💡 Tips & Tricks
  • 🚀 Beginner & Getting Started
  • ⚡ Advanced & Pro
  • 🛠️ Tools & Resources
  • 📈 Trending (score ≥ 70)
  • 🏷️ General

🔧 Options

| Option | Type | Default | Description | |---|---|---|---| | maxKeywords | number | 50 | Maximum keywords to return | | includeTrends | boolean | true | Fetch Google Trends scores | | grouped | boolean | true | Return grouped keyword categories |


📜 License

MIT