订单 - ViewCount在“ YouTube API V3”中显示错误的结果。

发布于 2025-02-01 12:43:31 字数 929 浏览 2 评论 0 原文

我正在尝试在最高视图顺序中获取特定频道(例如:-Luis Fonsi)的视频。我正在传递订单参数通过 viewcount 对响应进行排序

: -

order = ViewCount

URL: -

https://www.googleapis.com/youtube/youtube/v3/search?key= [my-api-key]& canneliD = ucxoq-paqeadk_zyg8ys0jqa&part ; order = viewCount& maxResults = 20000

当我尝试运行它时,它并没有按照我的预期进行排序。我期望第一首歌是 despacito ,但它肯定没有最高的观点。

youtube-api文档 in 搜索节 ViewCount - 资源从最高到最低的视图数量排序。

它无法正常工作。

我尝试过很多次,但仍然无法正常工作。

任何帮助都将不胜感激。

I am trying to get videos of a particular channel (like :- Luis Fonsi) in highest views order. And I am passing order parameter to sort the response by viewCount

like :-

order=viewCount

URL :-

https://www.googleapis.com/youtube/v3/search?key=[MY-API-KEY]&channelId=UCxoq-PAQeAdk_zyg8YS0JqA&part=snippet,id&order=viewCount&maxResults=20000

When I try to run it then It is not sorting as I expected. I was expecting first song would be Despacito But It got another one which definitely don't have the highest views.

As mentioned in Youtube-API Documentation in search section.
viewCount – Resources are sorted from highest to lowest number of views.

It is not working like this.

I have tried many times but it is still not working.

Any help would be much Appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余生共白头 2025-02-08 12:43:31

YouTube数据API V3在某些方面被打破,如果我是您,我只会从给定的YouTube频道中检索所有视频,然后对它们进行排序。

这样做:

  1. 通过使用上传播放列表ID >频道:列表带有 part = contentDetails
  2. 使用 playListItems:
    列表

    使用 playlistid = uploads_playlist_id (替换
    uploads_playlist_id 带有您刚获得的)。
  3. 得到每个
    视频的视图通过 part = statistics with

YouTube Data API v3 is broken on some aspects, if I were you, I would just retrieve all videos from the given YouTube channel and then sort them.

To do so:

  1. Get the channel's uploads playlist id by using Channels: list with part=contentDetails.
  2. Get the channel's videos by using PlaylistItems:
    list

    with playlistId=UPLOADS_PLAYLIST_ID (replacing
    UPLOADS_PLAYLIST_ID with the one you just obtained).
  3. Get each
    video's view count by using part=statistics with Videos:
    list
    .
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文