带有 API v3 的 Youtube 视频标题没有 API 密钥? [英] Youtube Video title with API v3 without API key?

查看:20
本文介绍了带有 API v3 的 Youtube 视频标题没有 API 密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用带有 API v3 没有 API 密钥的视频 ID 获取视频标题?我在 API 文档中找不到任何获取标题的信息或示例.

Is it possible to get the video title using the video ID with API v3 without the API key? I could not find any information or example of getting the title in the API documentation.

推荐答案

要获得视频标题,您需要一个 API 密钥,并且您需要向以下各项发出请求:

To get the video title, you will need an API key, and you'll need to make a request to:

https://www.googleapis.com/youtube/v3/videos?part=snippet&id={COMMA_DELIMITED_LIST_OF_IDS}&key={YOUR_API_KEY}

在返回的数据包中,标题将在 items.snippet.title

In the returned packet, the title will be at items.snippet.title

如果没有 API 密钥,您将无法检索 任何 API 数据;所有 API 请求都在配额系统上,密钥用于确定对应用的每日限额收取多少费用.然而,像上面这样的电话是相当便宜的.它总共有 3 个单元(2 个用于片段,1 个用于请求本身).由于您每天获得 50,000,000 个单位,并且可以为同样的 3 个单位检索多达 50 个片段,因此使用 API 密钥并没有太大的负担.

You can't retrieve any API data without an API key; all API requests are on a quota system, and the key is used to determine how much to charge your app's daily limit. A call like the above, however, is quite inexpensive; it's a total of 3 units (2 for the snippet and 1 for the request itself). Since you get 50,000,000 units a day and can retrieve up to 50 snippets for that same 3 units, it's not much of a burden to use the API key.

这篇关于带有 API v3 的 Youtube 视频标题没有 API 密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆