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
Related
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
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.
We did have this playlist. It is great because using this info we can show a latest video on YouTube.
https://gdata.youtube.com/feeds/base/users/africawoodgrow/uploads?alt=rss&v=2&orderby=published
How do we receive the same information from the new 3.0 API?
The first thing you'll need to do is register for an API key -- you can do this by creating a project at console.developers.google.com, setting the YouTube data API to "on," and creating a public access key.
Once you have your API key, you'll need to get the channel ID you're interested in (rather than the username). If you don't know the channel ID, you can get it this way:
https://www.googleapis.com/youtube/v3/channels?part=snippet&forUsername={username}&key={YOUR_API_KEY}
Once you have the channel ID, you can get those videos with the search endpoint, like this:
https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&channelId={channel id here}&maxResults=25&key={YOUR_API_KEY}
There are also a lot of other parameters you can use to retrieve videos; see https://developers.google.com/youtube/v3/docs/search/list for more details.
Previously we are using GData V2 api to get list of channels subscribed by user using userid as follows,
https://gdata.youtube.com/feeds/api/users/userid/subscriptions?v=2&alt=json&max-results=50
But in V3 api, to get list of channels subscribed by user, authorization is compulsory, anyone know any other approach for this. Thanks.
In V3 Api you can get list of subscriptions by using channel id of that user.
GET https://www.googleapis.com/youtube/v3/subscriptions?part=snippet&channelId=*channelid*&maxResults=20&key={YOUR_API_KEY}
In V3 API, if you have the access token, and the channel id. Make a GET request like
https://www.googleapis.com/youtube/v3/subscriptions?part=snippet&channelId=**channel_id**&access_token=**access_token**&maxResults=**max_results_between_0_to_50_default_5**
I'm not an expert or anything, but I'm getting the result correctly now for what I'm working on.
Edit:
#prasad's answer is correct though, but the request will not work with api_key. Just replaced his api_key with access_token.
How to retrieve Russian videos by specific category (YouTube API v3). For example, request that needed “videos category ‘Comedy’ on Russian language“:
https://www.googleapis.com/youtube/v3/search?part=snippet&order=date®ionCode=RU&type=video&videoCategoryId=23&lr=ru_RU&key={KEY}
I'ts not work.
I do not get a response: https://code.google.com/p/gdata-issues/issues/detail?id=4803
I've read through this part of the YouTube API v3 Documentation:
https://developers.google.com/youtube/v3/docs/videoCategories/list?hl=ru
and created this request url from the information I got there:
https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&id=23®ionCode=RU&hl=ru_RU&key={KEY}
Give it a try.