是否可以通过一个查询搜索多个频道?

发布于 2025-01-09 21:56:27 字数 618 浏览 1 评论 0原文

我想通过 Channels.id 参数通过一个查询搜索视频的多个频道。 例如:

我的请求URL是: https://youtube.googleapis.com/youtube/v3/search?part=snippet&channelId=UCSzAsgKDpNkch1eRA9w5nww%20%2B%20UCyCBf6asf89aQJaSXuAuTsg&q=Bitcoin&type=video&key=[YOUR_API_KEY]

答案是:

{
  "kind": "youtube#searchListResponse",
  "etag": "DCv8u79rz_Z5yPVlSxf2awnPWTQ",
  "regionCode": "DE",
  "pageInfo": {.
    "totalResults": 0,
    "resultsPerPage": 0
  },
  }, "items": []
}

难道不是吗2022 年推出的 YouTube Search API V3 是否可以通过一个请求在多个 Channel.id 中搜索某个主题?

我已经尝试过几种组合运算符。 我做错了什么吗?

I want to search multiple channels via the Channels.id parameter for videos with one query.
For example:

My request URL is: https://youtube.googleapis.com/youtube/v3/search?part=snippet&channelId=UCSzAsgKDpNkch1eRA9w5nww%20%2B%20UCyCBf6asf89aQJaSXuAuTsg&q=Bitcoin&type=video&key=[YOUR_API_KEY]

The answer is:

{
  "kind": "youtube#searchListResponse",
  "etag": "DCv8u79rz_Z5yPVlSxf2awnPWTQ",
  "regionCode": "DE",
  "pageInfo": {.
    "totalResults": 0,
    "resultsPerPage": 0
  },
  }, "items": []
}

Is it not possible with YouTube Search API V3 in 2022 to search multiple Channel.id's for a topic with one request?

I have already tried several combining operators.
Am i doing something wrong?

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

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

发布评论

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

评论(1

花开半夏魅人心 2025-01-16 21:56:27

不,您尝试的方式是不可能的 - 当使用多个通道(或字段/参数中的多个值)时,值以逗号分隔,但是,即使进行此修复对于请求,API 不会带来任何结果。

<一href="https://developers.google.com/youtube/v3/docs/search/list?apix_params=%7B%22part%22%3A%5B%22id%2Csnippet%22%5D%2C%22chann elId%22%3A%22UCSzAsgKDpNkch1eRA9w5nww%2CUCyCBf6asf89aQJaSXuAuTsg%22%2C%22q%22%3A%22Bitcoin%22%2C%22regionCode%22%3A%22DE%22%7D" rel="nofollow noreferrer">查看演示

相反,您应该为每个频道发出一个请求。

使用channelId UCSzAsgKDpNkch1eRA9w5nww 进行搜索 - 请参阅demo # 1

使用channelId 搜索 UCyCBf6asf89aQJaSXuAuTsg - 参见 demo # 2


如果您想搜索符合您条件的渠道(德国地区的比特币),请参阅此 示例

结果(总结):

{
  "kind": "youtube#searchListResponse",
  "etag": "MF1reS3I3oQvjOtYP2oZ8FI9sJ8",
  "nextPageToken": "CAUQAA",
  "regionCode": "DE",
  "pageInfo": {
    "totalResults": 19344,
    "resultsPerPage": 5
  },
  "items": [
    {
      "kind": "youtube#searchResult",
      "etag": "pBsNFEU4k7Fc5rWvL9z8woS_0ew",
      "id": {
        "kind": "youtube#channel",
        "channelId": "UCwdYYyyX9V3u_b6URNpBh_w"
      },
      "snippet": {
        "publishedAt": "2020-05-24T15:48:35Z",
        "channelId": "UCwdYYyyX9V3u_b6URNpBh_w",
        "title": "Bitcoin verstehen",
        "description": "Was ist Bitcoin und wieso benötigen wir ihn? In diesem Podcast bringen wir neugierigen Einsteigern und auch Fortgeschrittenen ...",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/nz1XMTZCai2Op7clT386e3l9vFBb2eYKOexx8udRqDbmwDqkR10els3i-RYeH7ukSSoGWtSDp8A=s88-c-k-c0xffffffff-no-rj-mo"
          },
          "medium": {
            "url": "https://yt3.ggpht.com/nz1XMTZCai2Op7clT386e3l9vFBb2eYKOexx8udRqDbmwDqkR10els3i-RYeH7ukSSoGWtSDp8A=s240-c-k-c0xffffffff-no-rj-mo"
          },
          "high": {
            "url": "https://yt3.ggpht.com/nz1XMTZCai2Op7clT386e3l9vFBb2eYKOexx8udRqDbmwDqkR10els3i-RYeH7ukSSoGWtSDp8A=s800-c-k-c0xffffffff-no-rj-mo"
          }
        },
        "channelTitle": "Bitcoin verstehen",
        "liveBroadcastContent": "none",
        "publishTime": "2020-05-24T15:48:35Z"
      }
    },
    {
      "kind": "youtube#searchResult",
      "etag": "j2amjttw_gCECoVnlJEB4Y5g41E",
      "id": {
        "kind": "youtube#channel",
        "channelId": "UC61jC9ggxeGu8HJ9Q_TxOGg"
      },
      "snippet": {
        "publishedAt": "2013-09-06T02:12:33Z",
        "channelId": "UC61jC9ggxeGu8HJ9Q_TxOGg",
        "title": "BITCOIN",
        "description": "YouTube.com/c/BITC0IN https://Odysee.com/@BITCOIN:d77 https://Twitter.com/BITC0INALLCAPS https://zbd.gg/BITC0IN - Tip ...",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/WG8_95AszbGpSw8w2Qx1VWq_1Ko6-VIvfezMG_YRi330HpZMWQaroK1wMf--zBXKddg4TW2Wvg=s88-c-k-c0xffffffff-no-rj-mo"
          },
          "medium": {
            "url": "https://yt3.ggpht.com/WG8_95AszbGpSw8w2Qx1VWq_1Ko6-VIvfezMG_YRi330HpZMWQaroK1wMf--zBXKddg4TW2Wvg=s240-c-k-c0xffffffff-no-rj-mo"
          },
          "high": {
            "url": "https://yt3.ggpht.com/WG8_95AszbGpSw8w2Qx1VWq_1Ko6-VIvfezMG_YRi330HpZMWQaroK1wMf--zBXKddg4TW2Wvg=s800-c-k-c0xffffffff-no-rj-mo"
          }
        },
        "channelTitle": "BITCOIN",
        "liveBroadcastContent": "upcoming",
        "publishTime": "2013-09-06T02:12:33Z"
      }
    },
    [...]
  ]
}

No, it's not possible in the way you're trying - when using multiple channels (or multiple values in a field/parameter for that matter), values are comma-separated, but, even with this fix to the request, the API does not bring any results.

See demo

Instead, you should make one request per channel.

Search with channelId UCSzAsgKDpNkch1eRA9w5nww - see demo # 1

Search with channelId UCyCBf6asf89aQJaSXuAuTsg - see demo # 2


If instead, you want to search channels that matches your criteria (Bitcoin in region DE), then see this sample

Results (summarized):

{
  "kind": "youtube#searchListResponse",
  "etag": "MF1reS3I3oQvjOtYP2oZ8FI9sJ8",
  "nextPageToken": "CAUQAA",
  "regionCode": "DE",
  "pageInfo": {
    "totalResults": 19344,
    "resultsPerPage": 5
  },
  "items": [
    {
      "kind": "youtube#searchResult",
      "etag": "pBsNFEU4k7Fc5rWvL9z8woS_0ew",
      "id": {
        "kind": "youtube#channel",
        "channelId": "UCwdYYyyX9V3u_b6URNpBh_w"
      },
      "snippet": {
        "publishedAt": "2020-05-24T15:48:35Z",
        "channelId": "UCwdYYyyX9V3u_b6URNpBh_w",
        "title": "Bitcoin verstehen",
        "description": "Was ist Bitcoin und wieso benötigen wir ihn? In diesem Podcast bringen wir neugierigen Einsteigern und auch Fortgeschrittenen ...",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/nz1XMTZCai2Op7clT386e3l9vFBb2eYKOexx8udRqDbmwDqkR10els3i-RYeH7ukSSoGWtSDp8A=s88-c-k-c0xffffffff-no-rj-mo"
          },
          "medium": {
            "url": "https://yt3.ggpht.com/nz1XMTZCai2Op7clT386e3l9vFBb2eYKOexx8udRqDbmwDqkR10els3i-RYeH7ukSSoGWtSDp8A=s240-c-k-c0xffffffff-no-rj-mo"
          },
          "high": {
            "url": "https://yt3.ggpht.com/nz1XMTZCai2Op7clT386e3l9vFBb2eYKOexx8udRqDbmwDqkR10els3i-RYeH7ukSSoGWtSDp8A=s800-c-k-c0xffffffff-no-rj-mo"
          }
        },
        "channelTitle": "Bitcoin verstehen",
        "liveBroadcastContent": "none",
        "publishTime": "2020-05-24T15:48:35Z"
      }
    },
    {
      "kind": "youtube#searchResult",
      "etag": "j2amjttw_gCECoVnlJEB4Y5g41E",
      "id": {
        "kind": "youtube#channel",
        "channelId": "UC61jC9ggxeGu8HJ9Q_TxOGg"
      },
      "snippet": {
        "publishedAt": "2013-09-06T02:12:33Z",
        "channelId": "UC61jC9ggxeGu8HJ9Q_TxOGg",
        "title": "BITCOIN",
        "description": "YouTube.com/c/BITC0IN https://Odysee.com/@BITCOIN:d77 https://Twitter.com/BITC0INALLCAPS https://zbd.gg/BITC0IN - Tip ...",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/WG8_95AszbGpSw8w2Qx1VWq_1Ko6-VIvfezMG_YRi330HpZMWQaroK1wMf--zBXKddg4TW2Wvg=s88-c-k-c0xffffffff-no-rj-mo"
          },
          "medium": {
            "url": "https://yt3.ggpht.com/WG8_95AszbGpSw8w2Qx1VWq_1Ko6-VIvfezMG_YRi330HpZMWQaroK1wMf--zBXKddg4TW2Wvg=s240-c-k-c0xffffffff-no-rj-mo"
          },
          "high": {
            "url": "https://yt3.ggpht.com/WG8_95AszbGpSw8w2Qx1VWq_1Ko6-VIvfezMG_YRi330HpZMWQaroK1wMf--zBXKddg4TW2Wvg=s800-c-k-c0xffffffff-no-rj-mo"
          }
        },
        "channelTitle": "BITCOIN",
        "liveBroadcastContent": "upcoming",
        "publishTime": "2013-09-06T02:12:33Z"
      }
    },
    [...]
  ]
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文