YouTube Widget Documentation
Complete guide to integrating and customizing the YouTube to Website widget
Quick Start Guide
Get your YouTube widget up and running in minutes!
Step 1: Create an Instance
- Navigate to YouTube Instances from your dashboard
- Click "Create New Instance"
- Enter a name for your widget (e.g., "Homepage Videos")
- Click "Create Instance"
Step 2: Add Video Sources
- Click "Manage Sources" on your instance
- Create a video group (e.g., "Latest Updates")
- Add video sources: YouTube channels, playlists, or individual videos
- Videos will be automatically fetched and updated
Step 3: Configure Settings
- Click "Widget Settings"
- Choose your layout: Grid, List, Featured, Playlist, or Carousel
- Customize colors, fonts, and display options
- Save your settings
Step 4: Get Embed Code
- Click "Embed Code"
- Choose between Script (recommended) or iFrame
- Copy the code and paste it into your website
- Your widget is now live!
Embedding Methods
Method 1: Script Embed (Recommended)
<script src="https://yoursite.com/widgets/youtube-to-website/embed/script/YOUR_IDENTIFIER"></script>
<div id="ytw-YOUR_IDENTIFIER"></div>Advantages: Better SEO, fully responsive, inherits page styling, faster loading
Method 2: iFrame Embed
<iframe src="https://yoursite.com/widgets/youtube-to-website/embed/iframe/YOUR_IDENTIFIER"
width="100%" height="600" frameborder="0"></iframe>Advantages: Complete style isolation, works everywhere, no JavaScript conflicts
Layout Types
Grid Layout
Classic grid display with customizable columns.
layout_type=gridList Layout
Horizontal cards with thumbnail on left.
layout_type=listFeatured Layout
Large featured video with grid below.
layout_type=featuredPlaylist Layout
YouTube-style with player and playlist.
layout_type=playlistCarousel Layout
Horizontal scrolling carousel.
layout_type=carouselURL Parameters
Override widget settings by adding URL parameters to your embed code.
Layout Parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
layout_type | grid, list, featured, playlist, carousel | grid | Widget layout style |
grid_columns_mobile | 1-4 | 1 | Columns on mobile devices |
grid_columns_tablet | 1-6 | 2 | Columns on tablets |
grid_columns_desktop | 1-8 | 3 | Columns on desktop |
videos_per_page | 1-100 | 12 | Videos shown per page |
Display Parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
show_title | 0 or 1 | 1 | Show video titles |
show_description | 0 or 1 | 1 | Show video descriptions |
show_channel | 0 or 1 | 1 | Show channel names |
show_date | 0 or 1 | 1 | Show publish dates |
show_duration | 0 or 1 | 1 | Show video duration |
show_views | 0 or 1 | 1 | Show view counts |
show_heading | 0 or 1 | 0 | Show widget heading |
Theme Parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
color_theme | light_mode, dark_mode, youtube_dark, custom | light_mode | Color scheme |
font_family | Any font name | Roboto | Typography |
border_radius | none, small, medium, large, rounded | medium | Corner roundness |
hover_effect | none, lift, glow, zoom, tilt | lift | Hover animation |
pagination_type | pagination, load_more, infinite_scroll | pagination | Page navigation |
Example Usage
https://yoursite.com/embed/iframe/YOUR_ID?layout_type=list&videos_per_page=10&color_theme=dark_modeColor Themes
Choose from professionally designed color themes or create your own custom palette.
Pre-Built Themes
Select from 8 carefully crafted themes that work beautifully across all layouts:
Custom Colors
Create your own unique theme by specifying individual color values:
| Parameter | Example | Description |
|---|---|---|
primary_color | #FF0000 | Primary accent color (buttons, highlights) |
secondary_color | #CC0000 | Secondary accent (hover states) |
background_color | #FFFFFF | Main background color |
card_bg_color | #F5F5F5 | Video card background |
text_color | #333333 | Text and title color |
border_color | #DDDDDD | Border and separator color |
accent_color | #FF3333 | Additional accent elements |
Example: Custom Brand Theme
?color_theme=custom&primary_color=%23FF5733&background_color=%23FFFFFF&text_color=%23333333Fonts & Typography
Enhance your widget's appearance with professional typography that matches your brand.
Font Categories
Popular Choices
- Roboto - Modern, clean (Default)
- Open Sans - Friendly, versatile
- Lato - Professional, elegant
- Inter - UI-optimized, crisp
Sans-Serif
- Montserrat - Bold, geometric
- Poppins - Rounded, modern
- Raleway - Elegant, thin
- Nunito - Friendly, rounded
Serif
- Merriweather - Classic, readable
- Playfair Display - Elegant, high-contrast
- Lora - Balanced, contemporary
- PT Serif - Traditional, universal
Display & Special
- Oswald - Condensed, bold
- Bebas Neue - Tall, impactful
- Anton - Heavy, attention-grabbing
- Pacifico - Script, casual
Implementation
Specify any Google Font using the font_family parameter:
?font_family=Open+SansFont Pairing Suggestions
| Heading Font | Body Font | Style |
|---|---|---|
| Montserrat | Open Sans | Modern & Professional |
| Playfair Display | Lato | Elegant & Sophisticated |
| Oswald | Roboto | Bold & Clean |
| Raleway | Lora | Classic & Refined |
| Poppins | Inter | Contemporary & Friendly |
Typography Best Practices
- Readability First: Sans-serif fonts work best for video titles and descriptions
- Size Matters: Ensure text is legible on mobile devices (minimum 14px)
- Consistency: Match your website's primary font family for cohesive design
- Loading Speed: Using web-safe fonts reduces load time
- Contrast: Ensure sufficient contrast between text and background
- Hierarchy: Use font weight variations to establish visual hierarchy
Advanced Font Customization
Google Fonts are automatically loaded by the widget. To use a custom font:
- Choose from Google Fonts
- Copy the font name (spaces encoded as +)
- Add to your embed URL:
font_family=Your+Font+Name
?layout_type=grid&font_family=Poppins&color_theme=ocean_breezeAPI Access
Access your videos programmatically with our RESTful API.
Authentication
Include your API key in the X-API-Key header or api_key parameter.
GET /api/instances/{identifier}/videos?api_key=YOUR_API_KEYAPI Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
limit | integer | Results per page (default: 20, max: 100) |
group | integer | Filter by group ID |
include_keywords | string | Filter videos containing keywords (comma-separated) |
exclude_keywords | string | Exclude videos with keywords (comma-separated) |
Example Response
{
"videos": [...],
"pagination": {
"current_page": 1,
"total_pages": 5,
"total_videos": 100
}
}Video Sources
Add videos from multiple sources to your widget.
Supported Source Types
- YouTube Channels: Automatically sync latest videos from any channel
- YouTube Playlists: Display videos from playlists in order
- Individual Videos: Manually curate specific videos
- Video Groups: Organize sources into tabs/categories
Analytics
Track widget performance with built-in analytics.
Metrics Tracked
- Widget Loads: Number of times the widget is displayed
- Video Plays: Number of video plays initiated
- Popular Videos: Most played videos
- Time-based Analytics: Performance over time periods
Examples
Grid Layout with Custom Colors
?layout_type=grid&grid_columns_desktop=4&color_theme=dark_modeList Layout with Limited Videos
?layout_type=list&videos_per_page=5&show_description=0Playlist Layout with Custom Font
?layout_type=playlist&font_family=Open+Sans&border_radius=largeTroubleshooting
Widget Not Displaying
Problem: Widget doesn't appear on the page
Solutions:
- Verify the instance is set to Active
- Check that the identifier in embed code is correct
- Ensure JavaScript is enabled in browser
- Check browser console for errors (F12)
- For iFrame: Verify iframe src URL is accessible
Videos Not Loading
Problem: Widget shows but videos are missing
Solutions:
- Verify video sources are added and active
- Check that video groups contain videos
- Ensure videos are public (not private/unlisted)
- Refresh video data from Manage Sources
- Check if YouTube API quota is exceeded
Styling Issues
Problem: Widget looks broken or unstyled
Solutions:
- For Script embed: Check for CSS conflicts
- For iFrame: Ensure proper width/height attributes
- Clear browser cache and reload page
- Try different color theme or layout
- Check if custom CSS is overriding widget styles
Pagination Not Working
Problem: Cannot navigate between pages
Solutions:
- Ensure
videos_per_pageis less than total videos - Check JavaScript console for errors
- For iFrame: Try the Script embed method instead
- Verify pagination_type setting is correct
Analytics Not Tracking
Problem: Analytics dashboard shows zero data
Solutions:
- Wait 24 hours for data to populate
- Verify widget is actually embedded and loading
- Check that tracking is not blocked by ad blockers
- Ensure cookies are enabled
- Test widget in different browser
API Not Working
Problem: API requests return errors
Solutions:
- Verify API key is correct and active
- Check API key is included in request header or parameter
- Ensure instance identifier is valid
- Check API endpoint URL is correct
- Review rate limits (max 100 requests/minute)