Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Youtube] subscriber counter/ total view time #6111

Closed
Gamemap opened this issue Jan 26, 2021 · 14 comments · Fixed by #6333
Closed

[Youtube] subscriber counter/ total view time #6111

Gamemap opened this issue Jan 26, 2021 · 14 comments · Fixed by #6333
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs

Comments

@Gamemap
Copy link

Gamemap commented Jan 26, 2021

📋 Description

Service: Youtube

🔗 Data

-Youtube API (I don't know exactly how)

🎤 Motivation

Maks the information on an internetsite visible to show how "good" the youtube channel is.

@Gamemap Gamemap added the service-badge Accepted and actionable changes, features, and bugs label Jan 26, 2021
@PyvesB
Copy link
Member

PyvesB commented Jan 26, 2021

Hello @Gamemap ! 👋🏻

I believe we can get the number of subscribers to a channel using the following API: https://developers.google.com/youtube/v3/docs/channels

However, after a quick read through the documentation, I see no way of retrieving a total view time. Could you please have a browse through as well to make sure I haven't missed anything?

@Gamemap
Copy link
Author

Gamemap commented Jan 26, 2021

Hi,

in the Json list I found this:

"statistics": {
"viewCount": unsigned long,
"subscriberCount": unsigned long, // this value is rounded to three significant figures
"hiddenSubscriberCount": boolean,
"videoCount": unsigned long
},

The tabel says:

statistics.viewCount | The number of times the channel has been viewed.

Is this we are searching for?

Is it possible to add also the total videos count?

statistics.videoCount | The number of public videos uploaded to the channel. Note that the value reflects the count of the > channel's public videos only, even to owners. This behavior is consistent with counts shown on the > YouTube website.

Thank you,
Gamemap

@PyvesB
Copy link
Member

PyvesB commented Jan 27, 2021

statistics.viewCount | The number of times the channel has been viewed.

Is this we are searching for?

Well, not really, that gives us no clue of the total view time for a given channel. Videos in a channel will have different lengths and most users would not watch them in full anyway, so you can't link the number of users who pressed play to a duration.

@Gamemap
Copy link
Author

Gamemap commented Jan 27, 2021

Is this the time, which is displayed on the Youtube Creators site?

@PyvesB
Copy link
Member

PyvesB commented Jan 31, 2021

Is this the time, which is displayed on the Youtube Creators site?

I wouldn't know for sure, I don't think I've ever used that part of YouTube before.

@Gamemap
Copy link
Author

Gamemap commented Jan 31, 2021

You find at https://studio.youtube.com the subscribers and the monetization tab shows the viewtime (if you don't have reacht the goal) (I found only this place with viewtime)

@PyvesB
Copy link
Member

PyvesB commented Feb 7, 2021

Okay, so coming back to my initial question, you are confirming that there is no way to retrieve the total view time via the API?

@Gamemap
Copy link
Author

Gamemap commented Feb 7, 2021

I found this: https://developers.google.com/youtube/reporting/v1/reports/metrics#watch_time_minutes
There you can also find subscribers_gained or other cool statistics.

I don't know if it is possible to add this.

(I found also video statistics https://developers.google.com/youtube/v3/docs/videos#statistics.viewCount)

@PyvesB
Copy link
Member

PyvesB commented Feb 7, 2021

I found this: https://developers.google.com/youtube/reporting/v1/reports/metrics#watch_time_minutes
There you can also find subscribers_gained or other cool statistics.

As far as I can tell, that API is deprecated and there doesn't seem to be an obvious equivalent in the v3 one.

@Gamemap
Copy link
Author

Gamemap commented Feb 7, 2021

Ok (I am unfortunately not familiar with this)

@PyvesB
Copy link
Member

PyvesB commented Feb 14, 2021

The total subscriber badge can still probably be done though, feel free to submit a pull request. We've got an nice tutorial on how to add badges and you can also leverage the implementation I wrote for the existing Youtube badges. 😉

@Gamemap
Copy link
Author

Gamemap commented Feb 14, 2021

Thank you for this tutorial but unfortunately I don't have time to learn this at the moment. If you or someone else have the time to code it would be great but there is no hurry.

@PyvesB
Copy link
Member

PyvesB commented Apr 5, 2021

This has now been deployed to production, thanks to @tarun7singh for his contribution! 🍾

@Gamemap
Copy link
Author

Gamemap commented Apr 5, 2021

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants