Skip to content
pubscout

yt

3.2.0, released 6 months ago by cdavis.ca

Native Dart interface to YouTube REST APIs including Data, Live Streaming, and Analytics.

$ flutter pub add yt
Source repository

What it does

Provides a Dart and Flutter interface for interacting with multiple YouTube REST APIs, including the YouTube Data, Live Streaming, and Analytics APIs. It supports multiple authentication methods like API keys and OAuth 2.0 with automatic token refresh.

AI-written summary of version 3.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to build Dart or Flutter applications that read or write YouTube data.
  • You need to manage YouTube live broadcasts, streams, or live chat histories.
  • You require YouTube analytics reporting or channel management capabilities.

Skip it when

  • You only need general HTTP requests and do not use YouTube APIs.
  • You require auto-generated bindings, as this package is manually crafted.

Strengths

  • Comprehensive coverage of YouTube Data, Live Streaming, and Analytics APIs.
  • Cross-platform support across Dart and Flutter platforms.
  • Supports multiple authentication methods including API keys and OAuth 2.0 with PKCE.

Weaknesses

  • Requires manual file setup and configuration for OAuth credentials.
  • Manually crafted API surface rather than auto-generated from discovery documents.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
11

Requires obtaining an API key or setting up OAuth 2.0 credentials via the Google Cloud Console and placing the secrets file in the expected path.

import 'package:yt/yt.dart';

void main() async {
  final yt = Yt.withApiKey(apiKey: '[your youtube api key]');
  final results = await yt.search.list(q: 'flutter tutorial', maxResults: 5);
  for (final item in results.items) {
    print('${item.snippet?.title}');
  }
}

Alternatives

Packages that do the same job and could replace yt.

Works with

Packages commonly used together with yt: ones it builds on, ones built on it, and its own family.