Google youtube api v3 does not return part "brandingSettings" - api

I am trying to extract the banner-image used in a certain youtube channel programmatically.
As far as I know it is to be in the brandingSettings, to be exact I think it is brandingSettings.image.bannerImageUrl, see here for an indetail description of the API:
https://developers.google.com/youtube/v3/docs/channels
So, I suppose I should be able to get that information with a GET request like this:
https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&key=[YOURAPIKEY]&forUsername=esltv
But that request (replacing the [YOURAPIKEY] with my actual key of course) returns without the desired part "brandingSettings":
{
"kind": "youtube#channelListResponse",
"etag": "\"79S54kzisD_9SOTfQLu_0TVQSpY/WJfuNLYVgEQVEhWQ-03PpQlCyzo\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"79S54kzisD_9SOTfQLu_0TVQSpY/GwL7oIruOCBr66yiNtrJqE3_Drs\"",
"id": "UC0G2qz-hoaCswQNgoWU_LTw"
}
]
}
I currently have turned on "YouTube Data API v3" in google api console.
Am I missing some permission, or does the channel somehow not suit in regard of retrieving its brandingSettings?
BRs,
Sebastian

for Username is actually for you to get the channelId. channels.list actually depends on channelId.
So with your first request you get channelID back, then do the same request second time, use channelId instead of username. (If you already know channelID use it first time as well.)
GET https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&id=UC0G2qz-hoaCswQNgoWU_LTw&key={YOUR_API_KEY}

Related

Linkedin endpoint adAnalyticsV2

I am having an issue in getting the data from LinkedIn API , I have got the permissions and trying postman to test endpoint to get data mention below is my get request , every time the response is an empty elements list with 200 ok. any help in this regard will be highly appreciated. I am sure that their is data its not that there is no activity but cant retrieve via api request.
https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.year=2019&dateRange.start.month=5&dateRange.start.day=28&dateRange.end.year=2021&dateRange.end.month=9&dateRange.end.day=30&timeGranularity=DAILY&pivot=MEMBER_COMPANY&projection=(*,elements*(externalWebsiteConversions,dateRange(*),impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue~(localizedName)))&fields=externalWebsiteConversions,dateRange,impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue&accounts[0]=urn:li:sponsoredAccount:123456789
and this is the response every time
{
"paging": {
"count": 10,
"start": 0,
"links": []
},
"elements": []
}

YouTube Data API V3 not returning Livestream from Channel ID

I'm working on a project that requires me to get a YouTube live stream's chat for use in my program. Everything was working perfectly with this js package, but it seems that google has changed something because it suddenly stopped working. I have regenerated keys, and am well below my quota, so I know that isn't the problem.
Strangely, when I use the youtube data api "try this api" section in their online documentation, the same problem is happening where the live stream is not found by the id. I've tried it on many different live channels, and all have returned an empty "items" array. Anyone else have this issue?
function execute() {
return gapi.client.youtube.search.list({
"part": "snippet, id",
"channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
"eventType": "live",
"type": "video"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
Results from the request:
{
"kind": "youtube#searchListResponse",
"etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/4y-zlkAvKOyrH7TNQpxpBtYUxKU\"",
"regionCode": "US",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": []
}
I can confirm this issue but the issue is a bug from Google. Hope it gets fixed soon.
There is definitely something going on with the YouTube Data API. If you give it a try on the on the Deverloper Console for Search: list it won't work if you are providing channelId. However, if you leave channelId blank it will return all of YouTube's live streams.
Google's instructions for getting help say to add the tag google-apis-explorer to your post. I have submitted an edit to add that tag to your original post. Hopefully we'll all get some answers soon.

Youtube v3 Data Api get category Id by channel id

I'm using youtube v3 data api and I would like to get channel category id using only the channel id, is it possible?
Yes, it is possible get the category (or categories) from a given channel_id.
The way you can do this is using the "channel" API as follows:
https://content.googleapis.com/youtube/v3/channels?id=<CHANNEL_ID>&part=topicDetails&key=<YOUR_API_KEY>
The following information was taken from the YouTube Data API - official documentation:
id: Id of the YouTube Channel you want retrieve the category (or categories).
key: your API key.
part: The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. For this case, I added topicDetails.
You can use the try-it functionality available in the official documentation for test the channels API requests.
For an specific scenario, I used the try-it functionality using the channel "PiewDiePiew", and the results for this channel are:
{
"kind": "youtube#channelListResponse",
"etag": "\"XpPGQXPnxQJhLgs6enD_n8JR4Qk/SZVZPmfCMK51FYGbt3QJc0cSuS8\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [{
"kind": "youtube#channel",
"etag": "\"XpPGQXPnxQJhLgs6enD_n8JR4Qk/k9uIVtL0Ha-_i_u38vFWu3Xws0A\"",
"id": "UC-lHJZR3Gqxm24_Vd_AJ5Yw",
"topicDetails": {
"topicIds": [
"/m/0bzvm2",
"/m/0bzvm2"
],
"topicCategories": [
"https://en.wikipedia.org/wiki/Video_game_culture"
]
}
}]
}
The categories of the channel will be shown in the topicCategories section of the API response.

Issue with retrieving video statistics using youtube data api

I am using following youtbe data api url:
"https://www.googleapis.com/youtube/v3/videos?part=statistics&id=ZR2GpiDE4FI&key=yourkey"
I am getting response:
{
"kind": "youtube#videoListResponse",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/pox2n0n-cJSP1MGKUsoLm6qpH8E\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/iVM0LfP5vvHBM6wl1BhD0yBeR9k\"",
"id": "eZSe4xVXHhI"
}
]
}
statistics node is missing from the response .
Yes, as per the YouTube API docs, the statistics can be part of the response: https://developers.google.com/youtube/v3/docs/videos/list
I have noticed this as well last week that statistics for certain videos were empty.
Looks like there has been some change in the YouTube API and they stopped returning stats for older videos. Bug? New feature? I don't know.
However I can receive the statistics for newer videos but not the old ones anymore.
Best to get some response from someone from YouTube.

Unable to retrieve page insights using Graph API explorer

I have the 'Insights Analyst' permission to my facebook page, and I try to use Graph API Explorer to get the metric page_fans
I "Get Access Token" with 'read_insights' and 'manage_pages', and "Submit" a graph API call that looks something like
GET /<page_id>/insights/page_fans
But then I get an empty response. (This occurs for all metrics except page_story_adds_unique, page_storytellers, and page_admin_num_posts)
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/<page_id>/insights/post_storytellers/?since=1369004893&until=1369264093",
"next": "https://graph.facebook.com/<page_id>/insights/post_storytellers/?since=1369523293&until=1369782493"
}
}
What permissions am I missing? What am I doing wrong?
There seems to be a larger than usual backlog of data missing in the insights at the moment. Use values for since and until to see where the data is.
/<page_id>/insights/page_fans?since=1369008000&until=1371686400
The numbers are unix timestamps to specify the date range you want. If the range is too large then you will get
"error": {
"message": "Unsupported operation",
"type": "FacebookApiException",
"code": 100
}
I know it's very frustrating and Facebook seems to not have any proper way of checking that the data is backlogged.