youtube_api 0.5.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 49

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.",
        "publishedAt":"2016-10-18T14:41:14.000Z",
        "channelId": "UC8kXgHG13XdgsigIPRmrIyA",
        "thumbnails": {
             "default": {
              "url": "https://i.ytimg.com/vi/9vzd289Eedk/default.jpg",
              "width": 120,
              "height": 90
             },
             "medium": {
              "url": "https://i.ytimg.com/vi/9vzd289Eedk/mqdefault.jpg",
              "width": 320,
              "height": 180
             },
             "high": {
              "url": "https://i.ytimg.com/vi/9vzd289Eedk/hqdefault.jpg",
              "width": 480,
              "height": 360
             }
        },
        "channelurl":"https://www.youtube.com/channel/UC8kXgHG13XdgsigIPRmrIyA",
        "url":"https://www.youtube.com/watch?v=9vzd289Eedk"
    },
    {
      "kind": "video"
       // Here will you next result
    },
    {
       // Here will you next result
    },
    {
       // Here will you next result
        "url":"https://www.youtube.com/watch?v=9vzd289Eedk"
    }
 ]

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/README.md

youtube_api_example

Demonstrates how to use the youtube_api plugin.

Getting Started

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  youtube_api: ^0.5.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.5.1 Jan 9, 2019 Go to the documentation of youtube_api 0.5.1 Download youtube_api 0.5.1 archive
0.2.1 May 9, 2018 Go to the documentation of youtube_api 0.2.1 Download youtube_api 0.2.1 archive
0.2.0 May 9, 2018 Go to the documentation of youtube_api 0.2.0 Download youtube_api 0.2.0 archive
0.1.1 May 9, 2018 Go to the documentation of youtube_api 0.1.1 Download youtube_api 0.1.1 archive
0.0.1 May 9, 2018 Go to the documentation of youtube_api 0.0.1 Download youtube_api 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
66
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms:

Error(s) prevent platform classification:

Make sure flutter format runs.

Analysis issues and suggestions

Make sure flutter format runs.

Running flutter format failed with the following output:

Exception: dartfmt on lib/ failed with exit code 65
Could not format because the source could not be parsed:

line 35, column 1 of lib/youtube_api.dart: The '===' operator is not supported.
=======
^
line 35, column 4 of lib/youtube_api.dart: The '===' operator is not supported.
=======
   ^
line 75, column 1 of lib/youtube_api.dart: The '===' operator is not supported.

Health issues and suggestions

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

Analysis of lib/youtube_api.dart failed with 66 errors, 21 hints, including:

line 33 col 1: Expected an identifier.

line 33 col 3: Expected an identifier.

line 33 col 5: Expected an identifier.

line 33 col 9: The name 'HEAD' isn't a type so it can't be used as a type argument.

line 33 col 9: Expected to find '>'.

Fix lib/_api.dart. (-2.96 points)

Analysis of lib/_api.dart reported 6 hints, including:

line 2 col 10: Name non-constant identifiers using lowerCamelCase.

line 6 col 10: Name non-constant identifiers using lowerCamelCase.

line 12 col 17: Name non-constant identifiers using lowerCamelCase.

line 14 col 13: Name non-constant identifiers using lowerCamelCase.

line 14 col 23: Name non-constant identifiers using lowerCamelCase.

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.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Make sure flutter format runs.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
http >=0.11.3+16 <0.12.0 0.11.3+17 0.12.0+1
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.2
sky_engine 0.0.99
source_span 1.5.1
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8