Is there a "live subscriber count" API that is not abbreviated nowadays? If so, how can I access it?
https://www.youtube.com/watch?v=w4F7qjmXGOE
This shows that it's possible.
This doesn't exist. The sub counts are abbreviated on youtube's end, so before it gets to the site it is already abbreviated.
Look here: https://support.google.com/youtube/thread/6543166?hl=en. It's not like the sub counters abbreviate it. Also, the video is unavaliable
Related
A few days that the youtube api stop to show a livestream videos, is this error only on my api key? if does, is there any other way to find a livestream videos?
I googled if there any message from youtube about this, and i didn't find.
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC4R8DWoMoI7CAwX8_LjQHig&eventType=live&type=video&key={MY_API_KEY}
You are not alone.
It's broken for everybody, unfortunately, and it's been this way for over ten days now. As with all Google services, human support and feedback is non-existent, not even an acknowledgement of the issue.
Ref.: https://support.google.com/youtube/thread/14611425
As a workaround, I had to change the logic to use the q parameter along with eventType=live. This actually works, and, depending on keywords, can also return a whole lot of unrelated live material, which, I think, can be further filtered on the client. This also seems to incur higher quota usage.
Well, I guess the issue is you try to use a meta-channel. UC4R8DWoMoI7CAwX8_LjQHig refers to what you get when you click on live in the menu, but this only "sums up" what's live, it isn't a real channel itself. Just strip the channelId parameter you should get all active live streams (only tested at reference page https://developers.google.com/youtube/v3/docs/search/list but got me 14.5k at time of try).
Matt
It seems that the YouTube API doesn't give updated results for mostPopular videos in my country since few days.
Example:
This request (https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails&chart=mostpopular®ionCode=FR) doesn't give me the same videos results than the ones displayed directly on YouTube for the French most popular channel (https://www.youtube.com/channel/UCmzy72gDEpfXoFV9Xdtd0DQ). It seems that the results of this request is not updated since the 1th of february. Results was real time updated before this.
Does someone know if something is wrong with my API request, or if there are some issues with the YouTube API at this moment?
There is nothing wrong with your request. This is a known issue with the YouTube API reported here for Saudi Arabia (but also applicable to multiple regions), and another related issue here with regard to content from France.
Your best bet would be to follow up with the YouTube team on one of those defects, or potentially (and dangerously) scrape the YouTube site for the correct results.
Problem seems to be solved since 13th of february (maybe someone from Google have seen my post..)
YouTube Channels and chart=mostPopular parameter data are separate data entities, aka you will get different results. They may be related but there is no guarantee you will get the same data. To get the data that you want you may need to query for channel itself and its videos.
I got this information from the thread #Jal linked, there was an update by matthewc...#google.com a few days ago:
The most popular channel for Saudia
Arabia and
the mostPopular chart parameter in the video.list
call
are separate and distinct entities. If you'd like to get the content
of the most popular channel for Saudia
Arabia
please use the Data API video.list call to list the videos with the
channel ID (in this case "UCWY-_j1MCth6yf24m58Bh_Q") by setting the
items/snippet/channelId parameter.
My current concern right now is that there is supposedly a way to get video information from the videos.list endpoint using a channelId, which does not seem the case in the API Explorer. I will update my answer once I figure out what this person meant exactly.
I have a problem with commentThread API call. Here is one specific case: comment id: z13ocxipdz3hwxqqe04cgbuadtmnhhmybyc0k
https://www.googleapis.com/youtube/v3/commentThreads?id=z13ocxipdz3hwxqqe04cgbuadtmnhhmybyc0k&part=snippet%2C+replies&key={YOUR_DEVELOPER_KEY}&alt=json&order=time
There are 44 replies for now.
But if you use video_id (not comment id like we did above. Link: https://www.googleapis.com/youtube/v3/commentThreads?videoId=Ui-ulCWmpOU&maxResults=100&pageToken=ChYQp7fipbfsxgIYkNGqiobjxQIgACgDEhQIABCQ0aqKhuPFAhiMqqKive-5AhgCIKwC&part=snippet%2C+replies&key={YOUR_DEVELOPER_KEY}&alt=json&order=time) and come across the comment (you may have to use pageToken to iterate over pages) you will see this:
(Screenshot: https://www.dropbox.com/s/d4bf9tk51eaw7dr/Screenshot%202015-07-21%2021.08.31.png?dl=0)
As you noticed; there is 39 replies (comments) which is not true. And even if we have replies; there is no replies section. Am I missing something?
Two questions: Why number of replies don't match? Why that commentThread doesn't have replies even it has 39 replies?
Notes: As part I am using 'snippet, replies'. I don't get any API error (like throttle or limit violation)
From the commentThreads documentation:
The commentThread resource does not necessarily contain all replies to
a comment, and you need to use the comments.list method if you want to
retrieve all replies for a particular comment.
Use the comments.list call instead and specify the commentThread's ID for the parentId.
When I do the following call:
https://www.googleapis.com/youtube/v3/comments?part=snippet,id&parentId=z13ocxipdz3hwxqqe04cgbuadtmnhhmybyc0k&key=[API_KEY_HERE]&order=time&maxResults=50
I get all (44) of the responses to the comment thread you mentioned.
To address your questions:
Why number of replies don't match?
If I had to guess, I'd say it might be due to how the API differentiates between comments and comment threads (where it considers replies to other replies in a thread as opposed to them being associated with the video itself). Since the documentation says that the commentThread resource might not contain all replies to a comment, I think this is still working as intended. At any rate, in the future it's generally better to just go with the higher number of replies reported, since it's more likely that the API is missing some results than reporting extra results. Also, remember that you should be using comments.list if you want all of the replies to a certain comment thread.
Why that commentThread doesn't have replies even it has 39 replies?
To be honest, I'm not sure if it's a YouTube thing or a G+ thing. When I looked at some of the other comment threads that had replies, I was able to see them via the API call when video ID is specified. However, as Daniel mentioned, you can't actually see the replies for the thread you specified on the video itself (but you can see them when you go to that user's G+ page). It's possible that user did something to their G+ settings regarding comments on their shared posts, which is why they aren't showing up on the video itself and thus not showing up in the commentThreads list request. It's hard to say unless you talked to someone who's familiar with G+/YouTube integration.
While I wasn't able to answer your questions definitely, I was able to find some useful info that may give you some clarity and direction.
With regard to the specific case outlined in your question: the user "authorDisplayName": "Tammy L." commented on the video "videoId": "Ui-ulCWmpOU" on 11/16/2013, and received replies between 11/16/2013 and 11/18/2013. According to Tammy L.'s record on Google+, there are 44 replies to her initial comment from this date:
Although, according to the record on YouTube, it appears that there are 42 replies to her comment, which doesn't match either value returned from your API calls. Even more bizarre, Google won't display the comments when I click on "View all 42 replies":
It seems that the commentId call provides the correct number of replies made to Tammy L.'s initial comment, which is consistent with the number of replies shown on her Google+ account. Perhaps the issues with the videoId call (including the fact that this call doesn't provide replies) are attributable to the changes Google implemented around the time that Tammy L. made her initial comment (November 2013), although I'm not totally sure.
I was wondering if there is a list of available categories where videos can be uploaded to YouTube (programmatically, that is). I have found this but to be honest I don't know what part is supposed to be meaning.
See the documentation.
part can be either id or snippet (which includes the category names).
You also need to provide a regionCode (e.g. US) or the list of category IDs you want.
At the end of the documentation page there's a form where you can test it.
I have seen numerous companies doing like Twitter lotteries where users got to retweet their tweet and then one of retweeters will get the prize or whatever.
I was wondering now how do they get the list of all retweeters or pick the winner?
I checked Twitter API and found only this thing: GET statuses/retweets/:id but it returns maximum of 100 retweeters. Is that the only way?
It looks likes there's a couple services out there doing almost exactly this. A quick google pulls up http://onekontest.com/ and there's a few other Twitter contest services, but they all seem to be different levels of broken since they haven't kept up with changes to the API.
As far as the Twitter API itself is concerned, if you were expecting more than 100 responses, I think using GET statuses/mentions makes the most sense. That API call returns any mentions of a user, and you can pass the flag include_rts to include any retweets of your tweets. Then, if you wanted to list RTs of a specific tweet, you could check the in_reply_to_status_id field in the returned data to see if it matches the original tweet ID. This API call only returns the last 800 status, 200 at a time, so if you expect a bunch of data, you would need to poll the API repeatedly over time to get all the tweets. I imagine services like favstar are doing exactly this, just on a larger scale.
If you're actually looking for code to do something like this, I wrote a sinatra app called twitter-rss-digest which handles querying Twitter over time to track different sorts of queries. It's pretty rough, and doesn't quite handle this specifically, but it might point you in the right direction if you want to code something.
The Twitter API has an endpoint that returns up to 100 retweeter IDs for a given tweet.
Note that for historical reasons, that endpoint only returns up to 100 results and the documentation about the cursor is useless. Twitter refused to fix the situation.
2013 note
That said, the first thread on the Developers site that surfaced in a quick google has #episod, a Twitter employee saying:
You can't likely get to all of them. The data is spread out. Your best bet is to use the REST API to determine many of the users who performed the retweet, but the data will still be constrained.
It's easiest to track retweets as they happen rather than try to find them from the past. Use the Streaming API for that.
I like muffinista's method, but I think if you want a 100% complete list of retweets, simply enable the retweet email notifications and write a script that polls the email box for those matching the subject "retweeted one of your Tweets!" and put the data into a table. Do this right from the start.
The site https://twren.ch/ enlists all the retweeters for a given tweet (note that it only enlists retweeters who are direct followers of the source tweeter.) Nevertheless its probably the only public source available.