yt
3.2.0, released 6 months ago by cdavis.ca
Native Dart interface to YouTube REST APIs including Data, Live Streaming, and Analytics.
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.
- googleapis
If you prefer the official Google APIs client library for Dart.
95Compare
Works with
Packages commonly used together with yt: ones it builds on, ones built on it, and its own family.
- yamlyt depends on itA Dart library for parsing YAML documents into Dart data structures.
- json_annotationyt depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- http_parseryt depends on itA platform-independent package for parsing and serializing HTTP formats.
- dioyt depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- universal_ioyt depends on itCross-platform dart:io implementation with browser support for HttpClient and other APIs
- csvyt depends on itParse and generate CSV strings with stream support and Excel compatibility.
- retrofityt depends on itDart Dio client generator using source_gen
- oauth2yt depends on itA client library for OAuth2 authentication and authorized HTTP requests.