FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
pmapower
pmapowerTopTenVideos
Public
Like
TopTenVideos
Home
Code
5
backend
1
frontend
3
posts
2
README.md
H
index.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v9
View latest version
README.md

🎥 YouTube Video Discovery

A web application that displays the top 10 YouTube videos for any specified niche or sub-niche.

🚀 Features

  • Custom Page Headers: Set your own page title for different niches
  • Two-Column Layout: Video information on the left, descriptions on the right
  • Rich Video Data: Thumbnails, view counts, duration, publish dates
  • Responsive Design: Works great on desktop and mobile
  • Direct YouTube Links: Click to watch videos directly on YouTube

🛠️ Setup

Prerequisites

  1. YouTube Data API Key:
    • Go to Google Developers Console
    • Create a new project or select existing one
    • Enable "YouTube Data API v3"
    • Create credentials (API Key)
    • Add as environment variable: YOUTUBE_API_KEY

Environment Variables

YOUTUBE_API_KEY=your_youtube_api_key_here

📂 Project Structure

├── backend/
│   └── index.ts              # Main Hono server with YouTube API integration
├── frontend/
│   ├── index.html            # Main HTML template
│   ├── app.js               # Frontend JavaScript logic
│   └── style.css            # Custom CSS styles
├── index.tsx                # Entry point (HTTP trigger)
└── README.md               # This file

🎯 Usage

  1. Enter a Niche: Type any topic (e.g., "cooking tutorials", "javascript programming")
  2. Custom Header (Optional): Set a custom page title
  3. Search: Click "Find Top Videos" to discover content
  4. Browse Results: View video details and click to watch on YouTube

🔧 Technical Details

  • Backend: Hono framework with YouTube Data API v3 integration
  • Frontend: Vanilla JavaScript with TailwindCSS
  • API: RESTful endpoint at /api/videos
  • Responsive: Mobile-first design with CSS Grid

📊 API Endpoints

  • GET / - Main application page
  • GET /api/videos?niche={search_term} - Fetch top 10 videos for niche
  • GET /frontend/* - Static asset serving

🎨 Features

  • Video Rankings: Shows top 10 videos with numbered rankings
  • Rich Metadata: View counts, duration, publish dates, channel info
  • Hover Effects: Interactive video cards with smooth animations
  • Error Handling: Graceful error messages and loading states
  • Accessibility: Proper ARIA labels and keyboard navigation
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.