Java 示例代码示例 youtube 数据 api v3 和授权方法作为 api 密钥 [英] Java Sample Code examples youtube data api v3 and authorization method as api key

查看:46
本文介绍了Java 示例代码示例 youtube 数据 api v3 和授权方法作为 api 密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 google api 的新手.为 youtube 频道创建项目.我已经为项目创建了 api 并生成了 api 密钥.在项目上启用 Youtube api.我到处都在获取 OAUTH 授权的代码示例,但找不到任何用于使用 api 密钥授权的视频或 Java 代码示例.你能帮我重定向到适当的链接吗?

I am new to google apis. Creating project for youtube channel. I have created api and generated api key for the project. Enabled Youtube apis on the project. Everywhere I am getting code samples of OAUTH authorization, but not able to find any video or Java code samples for working with api Key authorization. Can you please help in redirecting me to appropriate link.

还想知道这两种方法之间是否有任何功能差异?

Also want to find out is there any feature difference between both methods?

推荐答案

如果你看看 Github 上的 Youtube Java 示例代码,可以看到 search 示例 正在使用 api 密钥 :

If you look at Youtube Java sample code on Github, you can see that the search example is using api key :

YouTube.Search.List search = youtube.search().list("id,snippet");

String apiKey = properties.getProperty("youtube.apikey");
search.setKey(apiKey);
search.setQ(queryTerm);

这篇文章这篇文章 与您关于 Oauth 与 API 密钥的问题相关

This post and this post are relevant to your question about Oauth vs API key

这篇关于Java 示例代码示例 youtube 数据 api v3 和授权方法作为 api 密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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