justwatch_unofficial 1.0.0 copy "justwatch_unofficial: ^1.0.0" to clipboard
justwatch_unofficial: ^1.0.0 copied to clipboard

Unofficial JustWatch API for Dart and Flutter.

example/justwatch_unofficial_example.dart

// Search for titles
import 'package:justwatch_unofficial/justwatch_unofficial.dart';

Future<List<MediaEntry>> search(title) async {
  final results = await JustWatchClient.search(
    title: title,
    country: 'IN',
    language: 'en',
    count: 5,
    bestOnly: false,
  );
  return results;
}

Future<MediaEntry?> movieDetails(movieNodeID) async {
  final details = await JustWatchClient.details(
    nodeId: movieNodeID,
    country: "IN",
    bestOnly: false,
    language: "en",
  );
  return details;
}

Future<Map<String, List<Offer>>> offersForCountries(movieNodeID) {
  final offers = JustWatchClient.offersForCountries(
    nodeId: movieNodeID,
    countries: {'IN', 'US', 'GB', 'DE'},
    language: 'en',
    bestOnly: false,
  );
  return offers;
}

void main() async {
  final results = await search('Avatar The Last Airbender');
  for (var media in results) {
    print('Title: ${media.genres}');
  }

  // final details = await movieDetails('ts83993');
  // for (var genre in details!.genres) {
  //   print('Genre: ${genre.toString()}');
  // }

  // final offers = await offersForCountries('ts83993');
  // print(offers);
}
1
likes
140
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

Unofficial JustWatch API for Dart and Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on justwatch_unofficial