Hi
I have below code & i want to get Traffice Source keywords to my own Video
List listVideo = new List();
var client = new RestClient("googleapis.com/youtube/v3");
var request = new RestRequest("search", Method.GET);
request.AddParameter("part", "snippet");
request.AddParameter("type", "video");
request.AddParameter("key", "A8");
var response = client.Execute(request);
foreach (var data in response.Data.items)
{
var clientTag0 = new RestClient("googleapis.com/youtube/v3/");
var tagRequest0 = new RestRequest("videos", Method.GET);
tagRequest0.AddParameter("key", "A8");
tagRequest0.AddParameter("part", "snippet,statistics");
tagRequest0.AddParameter("id", data.id.videoId);
var tagResponse0 = clientTag0.Execute(tagRequest0);
foreach (var searchResult in tagResponse0.Data.items)
{
listVideo.Add(searchResult);
var tags = searchResult.snippet.tags;
}
}
Thanks
Ramco RamcoPosted Apr 11, 2024, 8:53 AM
Hi Abhishek
I am trying below code but it is not returning anything
Thanks
Abhishek YadavPosted Apr 11, 2024, 7:48 AM
for reaching out. It looks like you are trying to fetch traffic source keywords for your own videos using the YouTube Data API.
To achieve this, you can make use of the YouTube Analytics API to retrieve traffic sources for your videos. Here is an example code snippet that demonstrates how you can fetch traffic source keywords for your videos:
In this code snippet, you need to replace
CHANNEL_ID,VIDEO_ID,START_DATE, andEND_DATEwith your actual channel ID, video ID, start date, and end date respectively. The API call will return a list of traffic source keywords along with the number of views.Please note that you need to have the necessary permissions and authentication setup to access YouTube Analytics API. Make sure you have followed the authentication process as per the API documentation.
I hope this helps. Let me know if you have any further questions.