Search packages, repositories and app categories

Package detailsv1.0.4

youtube_data_api

A Flutter package for fetching complete data from YouTube. Supports Search, Trending, Channels, Playlists and Video Data.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
28
Likes
61
Pub points
140

Install package

flutter pub add youtube_data_api

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that enables seamless integration with the YouTube Data API, allowing developers to fetch comprehensive YouTube data such as videos, channels, playlists, trending content, and search results. Designed for cross-platform use, it supports Android, iOS, Web, macOS, Windows, and Linux. The package simplifies API interactions with clean, intuitive methods, making it ideal for apps requiring real-time YouTube content retrieval. It is maintained by exacode.xyz and hosted on GitHub for transparency and community contributions.

Use cases

  • Fetching trending videos
  • Searching YouTube content
  • Retrieving channel information
  • Loading playlist details
  • Displaying video metadata
  • Building YouTube discovery features

Key features

  • Supports multiple YouTube data types
  • Cross-platform compatibility
  • Clean, easy-to-use API
  • Real-time data fetching
  • Open-source and well-documented
  • Built for Flutter applications

Suitable for

  • YouTube-based apps
  • Content discovery tools
  • Video aggregation platforms
  • Educational apps with video content
  • Media-rich applications

Considerations

  • Requires a valid YouTube Data API key
  • Rate limits apply based on API usage
  • Network connectivity needed for data retrieval
  • May require handling of pagination
  • Dependent on external API stability

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

YouTube Data API

pub package

A Flutter package for fetching complete data from YouTube. Supports Search, Trending, Channels, Playlists and Video Data.

Features

  • Search Video, Playlist, Channel on YouTube with (Unlimited Videos With Loading More) feature.
  • Get Video Data, Id, Thumbnail, Channel Name, Views, Likes, Description
  • Get Related Videos with a video
  • Get Playlist Videos with (Loading More) feature
  • Get Channel complete data (Name, Id, Banner, Avatar, Videos Count, Subscribers Count, Videos with (Loading More) feature)
  • Search Suggestions
  • Get Trending Videos based on your ip country (Trending, Music, Gaming, Movies).

Usage

To use this plugin, add youtube_data_api as a dependency in your pubspec.yaml file.

Complete Example Code

Example

To search for videos or channels or playlists

String query = "Wegz";
YoutubeDataApi youtubeDataApi = YoutubeDataApi();
List videoResult = await youtubeDataApi.fetchSearchVideo(query);
videoResult.forEach((element){
    if(element is Video){
      Video video = element;
    } else if(element is Channel){
      Channel channel = element;
    } else if(element is PlayList){
      PlayList playList = element;
    }
});

To get trending videos

YoutubeDataApi youtubeDataApi = YoutubeDataApi();
List<Video> videos = await youtubeDataApi.fetchTrendingVideo();

To get gaming, music, movies videos on trend

List<Video> trendingMusicVideos = await youtubeDataApi.fetchTrendingMusic();
List<Video> trendingGamingVideos = await youtubeDataApi.fetchTrendingGaming();
List<Video> trendingMoviesVideos = await youtubeDataApi.fetchTrendingMovies();

To get suggestion search queries

String query = "El Joker";
List<String> suggestions = await youtubeDataApi.fetchSuggestions(query);

To get video data

VideoData? videoData = await youtubeDataApi.fetchVideoData(videoId);
String? videoTitle = videoData?.video?.title;
String? videoChannelName = videoData?.video?.username;
String? viewsCount = videoData?.video?.viewCount;
String? likeCount = videoData?.video?.likeCount;
String? channelThumbnail = videoData?.video?.channelThumb;
String? channelId = videoData?.video?.channelId;
String? subscribeCount = videoData?.video?.subscribeCount;
List<Video?>? relatedVideos = videoData?.videosList;

Categories

Dependencies

Dependency list 4 items

Source repository

Projects using this package

No data available yet.