youtube_api 0.7.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

Youtube API (youtube_api) #

pub package

A Flutter plugin for fetching interacting with Youtube Server to fetch data using API. Supports iOS and Android.

Features: #

  • Search Video, Playlist, Channel on youtube.
  • Play Youtube Video [Coming Soon]

Usage #

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

Complete Example Code

Example #

alt text

static String key = 'YOUR_API_KEY';
YoutubeAPI ytApi = new YoutubeAPI(key);
List<YT_API> ytResult = [];

String query = "Flutter";
ytResult = await ytApi.Search(query);
// data which are available in ytResult are shown below 

These data are stored in ytResult

        "kind": "video",
        "id": "9vzd289Eedk",
        "channelTitle": "Java",
        "title": "WEBINAR - Programmatic Trading in Indian Markets using Python with Kite Connect API",
         "description": "For traders today, Python is the most preferred programming language for trading, as it provides great flexibility in terms of building and executing strategies.",
        "channelId": "UC8kXgHG13XdgsigIPRmrIyA",
        "thumbnails": {
             "default": {
              "url": "",
              "width": 120,
              "height": 90
             "medium": {
              "url": "",
              "width": 320,
              "height": 180
             "high": {
              "url": "",
              "width": 480,
              "height": 360
      "kind": "video"
       // Here will you next result
       // Here will you next result
       // Here will you next result

Default per-page result is 10 .

If you want search any specif out i.e video or playlist or channel. For Channel only specify > Type : "channel"

For Video only specify > Type : "video"

For Playlist only specify > Type : "playlist"

maxResults(int) can be 1 - 50

int max = 25;

String type = "channel";

YoutubeAPI ytApi = new YoutubeAPI(key,
                                  maxResults: max,
                                  Type: type);

Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!

[0.1.1] - May 09th 2018

  • Readme Updated

[0.1.0] - May 09th 2018

  • Initial Open Source release.


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  youtube_api: ^0.7.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:youtube_api/youtube_api.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Fix lib/youtube_api.dart. (-1 points)

Analysis of lib/youtube_api.dart reported 2 hints:

line 9 col 30: The value of the field '_channel' isn't used.

line 153 col 7: Name types using UpperCamelCase.

Fix lib/generated/i18n.dart. (-0.50 points)

Analysis of lib/generated/i18n.dart reported 1 hint:

line 29 col 7: Name types using UpperCamelCase.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
http ^0.12.0+1 0.12.0+4
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.11 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8