I try to download Youtube video comments based on video ID. I checked the API sample code that it uses OAuth 2.0. However I only need to download the comments but not modify them. Do I still need OAuth 2.0 or just API Key?
Thanks!
You don't need to go through OAuth if you're only retrieving comments. You can make the request with only your API key over HTTP and receive a JSON response in return.
https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId={yourVideoId}&key={YOUR_API_KEY}
More info can be found here
If you only need to get comments using https://developers.google.com/youtube/v3/docs/commentThreads/list then just the API key is needed.
Related
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?
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
The question is about inserting comments using the version 3 of the youtube api and via a crude http request (with fiddler or custom console app).
I'm able to retrieve videos sending a request to the search method with my api key, but inserting a comment is different. The response I get is 401 Unauthorized but I'm sending the correct api key.
I think this is due to the scope:
Also add don't forget to add following scope https://www.googleapis.com/auth/youtube.force-ssl
as it is said in Post comments to youtube videos using youtube api v3 Android but I don't know how to set it up in my app or via fiddler (yes with api explorer provided by google, but they have a popup implemented to select this scope).
Anybody knows how can I add the scope and set it to youtube.force-ssl?
Thanks
In my app i need to integrate it with TripAdvisor API.
i searched a lot about it, i found this in there website:
https://developer-tripadvisor.com/content-api/
it's actually un useful!.
I didn't find any example or demo for this integration!
Anyone knows how to integrate with TripAdvisor in IOS? Or have any example about it?
thanks
Well, just like most APIs, you first have to get your API key from TripAdvisor. So go to the Request API Access form and fill that out (You have to sign up for Trip Advisor first, or sign in with a Facebook or Google account). They will then contact you with your API key and info.
Now that you have the key, the more interesting part takes place. You can use the app in HTTP requests in your app (Example Here) with the URL of the request you want to make. For example, if I wanted to get results for hotels with my coordinates, I would use this URL:
http://api.tripadvisor.com/api/partner/2.0/map/42.33141,-71.099396/hotels?key=<YOUR KEY HERE>
The response would be some JSON code which you can parse with Swift's built-in JSON parser, NSJSONSerialization. With this data, you can now store and make use of what you needed from their API.
To see the full API documentation of all the requests you can do and their details, just visit the TripAdvisor API Documentation.
Hope this helps,
Gabriel
I'm still using old V2 api and now i get https://youtube.com/devicesupport.
My current request is:
https://gdata.youtube.com/feeds/api/users/{username}/uploads?alt=jsonc&max-results=15&v=2
There is no authentication required to make that call
Question:
Any idea how to achieve the same with new Google V3 API? I check documentation but didn't found answer for that.
I had the same problem with V3 api. I think you can't access videos informations without authentication anymore, but you don't need to use an OAuth to get a snippet from some video or search. I was searching a simple solution for my app, because I just want to request title, thumb and descriptions.
The new url will be:
https://www.googleapis.com/youtube/v3/videosid={VIDEO_ID}&part=snippet&key={YOU_API_KEY}
You need to access google developers console, enable youtube api and your public access key - on credentials (API KEY), so they can relate your app to all requests.
And I found this example in PHP if you need to parse JSON result:
http://www.leenooks.com/php/parsing-youtube-v3-json-with-php-examples.html
I'm still don't know all the limitations of V3, I was using V2 too, but maybe for uploads, or more control for youtube accounts you'll have to use OAuth.
I hope this will help you.
I've been looking through the documentation of Google Youtube API in v2 and v3 versions how to delete users comments to a video posted on youtube by API and I could not find information.
You can perform this operation?
Using V3 API, it's a simple DELETE HTTP request.
HTTP request
DELETE https://www.googleapis.com/youtube/v3/comments
With the comment to be delete passed in parameter:
id
The id parameter specifies the comment ID for the resource
that is being deleted.
On success, the method returns an HTTP 204 response code.
The request requires proper authorization.
Reference:
https://developers.google.com/youtube/v3/docs/comments/delete