Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Sample Code examples youtube data api v3 and authorization method as api key

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?

like image 765
Rank Bazaar Avatar asked Jul 12 '17 17:07

Rank Bazaar


People also ask

What is YouTube API key used for?

The API provides the ability to retrieve feeds related to videos, users, and playlists. It also provides the ability to manipulate these feeds, such as creating new playlists, adding videos as favorites, and sending messsages. The API is also able to upload videos.

Is YouTube data API v3 free?

Yes, using the YouTube API does not incur any monetary cost for the entity calling the API. If you go over your quota an 403 Error will be returned by the API.


1 Answers

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

like image 187
Bertrand Martel Avatar answered Sep 28 '22 07:09

Bertrand Martel