๐บ youtube_integration
A Dart package that simplifies integration with the YouTube Data API.
Easily fetch videos, playlists, channel details, comments, and more โ all in a clean and developer-friendly way.
โจ Features
- ๐ Search for YouTube videos.
- ๐บ Fetch videos from a specific channel.
- ๐ Retrieve playlists of a channel.
- ๐๏ธ Get all videos from a playlist.
- ๐งพ Fetch video details (statistics, title, etc).
- ๐ฌ Fetch comments on a video.
- ๐ Get full channel details.
๐ Getting Started
1. Add dependency to pubspec.yaml:
dependencies:
youtube_integration: <LATEST_VERSION>
2. Enable the YouTube Data API:
Go to Google Cloud Console
โ Enable the YouTube Data API v3.
3. Create an API key:
Generate an API key from API Credentials Page.
๐งช Usage
import 'package:youtube_integration/youtube_integration.dart';
final youtube = YouTubeIntegration(apiKey: 'YOUR_API_KEY');
// Fetch videos from a channel
final videos = await youtube.fetchChannelVideosByID(channelId: 'CHANNEL_ID');
// Search videos
final results = await youtube.searchVideos(query: 'flutter tutorials');
You can also:
- Fetch channel details
- Get playlist videos
- Get video details
- Fetch video comments
๐ Documentation
Check the full documentation in the GitHub repo.
๐ก Tip
You can paginate results using nextPageToken available in the API responses.
๐ License
This package is open-source and licensed under the MIT License.
๐ Contributing
Pull requests and issues are welcome!
Feel free to open an issue or submit a PR on GitHub.
Libraries
- models/channel_details/channel_details
- models/channel_details/item
- models/channel_details/page_info
- models/channel_details/snippet
- models/channel_details/statistics
- models/channel_details/thumbnails
- models/playlist/item
- models/playlist/page_info
- models/playlist/playlist_model
- models/playlist/snippet
- models/playlist_video/playlist_video_item
- models/playlist_video/resource_id
- models/playlist_video/snippet
- models/playlist_video/thumbnails
- models/search_video/id
- models/search_video/item
- models/search_video/page_info
- models/search_video/search_videos
- models/video_comments/page_info
- models/video_comments/snippet
- models/video_comments/top_level_comment
- models/video_comments/video_comments_models
- models/video_details/default
- models/video_details/high
- models/video_details/localized
- models/video_details/maxres
- models/video_details/medium
- models/video_details/page_info
- models/video_details/snippet
- models/video_details/standard
- models/video_details/statistics
- models/video_details/thumbnails
- models/video_details/video_details_model
- youtube_integration