问题
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?
回答1:
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);
This post and this post are relevant to your question about Oauth vs API key
来源:https://stackoverflow.com/questions/45063916/java-sample-code-examples-youtube-data-api-v3-and-authorization-method-as-api-ke