FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
pmapower
pmapowerTopTenVideos
Public
Like
TopTenVideos
Home
Code
6
backend
1
frontend
3
posts
README.md
H
index.html
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: v39
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.