sclass YouTubeStats {
  long subs, views, videos;
}

static YouTubeStats youTubeStats(S channel) {
  channel = assertNempty(parseYouTubeChannel(channel));
  S url ="https://www.googleapis.com/youtube/v3/channels?part=statistics&id=\*channel*/&key=" + youTubeDataAPIKey();
  Map map = cast loadJSONPage(url);
  L items = cast map.get("items");
  Map item = cast first(items);
  Map statistics = cast item.get("statistics");
  ret nu(YouTubeStats,
    subs := toLong(statistics.get('subscriberCount)),
    views := toLong(statistics.get('viewCount)),
    videos := toLong(statistics.get('videoCount));
}