youtube_data_v3 0.0.1+1

Flutter Android iOS

A youtubeV3 package which contains functions to access Youtube Data API V3 via the API key.

example/main.dart

import 'package:youtube_data_v3/youtube_data_v3.dart';
import 'package:youtube_data_v3/youtube_channel.dart';
import 'package:youtube_data_v3/youtube_video.dart';

main(List<String> arguments) async {

  const String API_KEY = "";// API key from Google console
  const String CHANNEL_ID = "";// Channel Id of the youtube channel to fetch videos from

  final ytApi = YoutubeV3();
  ytApi.init(API_KEY);
  YtChannel channel = await ytApi.getChannelFromId(CHANNEL_ID);
  print(channel.title);
  print(channel.uploadsId);

  List<YtVideo> videoList = await channel.getPageOfVideos(numResults: 10, showDuration: true);
  print(videoList.length);

  //title of the video
  print(videoList[0].title);
  //position of the video in the list of videos from the page received
  print(videoList[0].position);
  //duration of the video (only present when show duration is set to true)
  print(videoList[0].duration);

  //Url of the thumbnail of the video
  print(videoList[0].thumbnailDetails.default_.url);
}
3
likes
70
pub points
51%
popularity

A youtubeV3 package which contains functions to access Youtube Data API V3 via the API key.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

cvadityagithub@gmail.com

License

BSD (LICENSE)

Dependencies

googleapis, googleapis_auth, http

More

Packages that depend on youtube_data_v3