PHP script to gain channel statistics in live time. An alternative to the Youtube Data API. Free to use for everyone! 🤖 Youtube Data API has one common problem: You cant do live updates on channel statistics because they limit your Queries per day. This script solves this problem by extracting channel statistics in live time from there official youtube channel pages. |
This application is for private or educational purposes only. You should use the official Youtube Data API: https://developers.google.com/youtube/v3/. We do not accept responsibility for banned accounts or penalties of any kind caused by the use of this script. We would like to point out that using this script violates the Terms and Conditions. By using the script, you automatically accept that you yourself are criminally responsible for yourself and you are aware that it violates the guidelines. |
Just put the files on your Http Server and call the script like this:
http://<server-ip-or-address>/get_channel_statistics.php?id=UC-lHJZR3Gqxm24_Vd_AJ5Yw
Example Output in JSON:
[{
"channelID":"UC-lHJZR3Gqxm24_Vd_AJ5Yw",
"viewCount":"21082625429",
"subscriberCount":"93689562",
"latestVideoID":"bRG6sy3VaWU"
}]
// @param channelid -> Youtube Channel ID
// @param counttype -> Either "viewcount" or "subcount"
// @return count -> view or subcount as number
YTChannel::getChannelStatistics(<channelid>, <counttype>)
// @param channelid -> Youtube Channel ID
// @return videoID -> Video ID of latest YT Video
YTChannel::getLatestVideo(<channelid>)
If this project help you reduce time to develop, you can give me a cup of coffee (or a Beer of course) :)
$ git clone https://github.com/lreiner/YT-API-PHP
When you fork a project in order to propose changes to the original repository, you can configure Git to pull changes from the original, or upstream, repository into the local clone of your fork.
Click here to see how to keep a fork synched
Too see all published releases, please take a look at the tags of this repository.