Youtube Data API fetching wrong channel when requested using forUsername parameter - youtube-api

Basically, I am tring to fetch a youtube account using search list function and it's giving me incorrect channel details in responce. I am using Youtube API V3 and the issue is with API only, I have tested the same with official documentation aslo and it doesn't return any responce either. Responce of API when tried with forUsername parameter

Related

Retrive only videoIds from YouTube using API v3

I am trying to fetch YouTube videos based on keyword search.
https://www.googleapis.com/youtube/v3/search?part=snippet&q=eminem&key=YouTube-API-Key&maxResults=5
items[0].id.videoId and items[3].id.videoId do not exist. Instead they have channelId.
So why am I getting channelIds for non-existent videos ? Do I need to filter them manually or is it possible to filter them via the API ?
You have to request the id in the part parameter.
https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=eminem&key=YouTube-API-Key&maxResults=5&type=video

Post comments to youtube videos using youtube api v3 via Fiddler or custom console app

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

Version 3.0 alternative for YouTube 2.0 API playlist

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.

Getting a Youtube channel's video list as an rss feed

How can I form requests using the youtube api to get the videos from a channel as an rss feed?
I read this question, where a link to the new api (V3) is given, but I couldn't find it there. I tried with the deprecated syntax from api v2:
https://gdata.youtube.com/feeds/users/UCqAEtEr0A0Eo2IVcuWBfB9g/uploads
but it only works sometimes.
I also tried:
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20
where I enter the channel id and the search key, but I get a 'bad request' error.
To answer the question in the headline:
Pre-append https://www.youtube.com/feeds/videos.xml?channel_id= to the channel unique identifier.
For example, lets assume that the channel url is https://www.youtube.com/channel/feed/UCpjNXONNE-JUz74ACsRCgcw. So the rss feed URL would be https://www.youtube.com/feeds/videos.xml?channel_id=UCpjNXONNE-JUz74ACsRCgcw.

How to get Youtube video json list under an user via Google V3 API

In V2, I can use: http://gdata.youtube.com/feeds/api/videos/?alt=json&author=XXX
However, V2 has been deprecated and can not be used anymore.
What's the correct replacement in Google API V3?
You should get your API key (for server or for client).
http://code.google.com/apis/console#access
And use https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={CHANNEL_ID}&key={YOUR_API_KEY}
https://developers.google.com/youtube/v3/docs/search/list
But, there are some bug reports about this API now.
https://code.google.com/p/gdata-issues/issues/detail?id=6598
https://code.google.com/p/gdata-issues/issues/detail?id=6599
https://code.google.com/p/gdata-issues/issues/detail?id=6600

Resources