Skip to content

PHP script to gain channel statistics and videos. An alternative to the Youtube Data API. Free to use for everyone! 🤖

License

Notifications You must be signed in to change notification settings

lreiner/YT-API-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube Channel API for PHP

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.

⚠️ VERY IMPORTANT⚠️

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.

How does it work?

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"
}]

Example Functions

getChannelStatistics

// @param channelid -> Youtube Channel ID
// @param counttype -> Either "viewcount" or "subcount"
// @return count -> view or subcount as number

YTChannel::getChannelStatistics(<channelid>, <counttype>)

getLatestVideo

// @param channelid -> Youtube Channel ID
// @return videoID -> Video ID of latest YT Video

YTChannel::getLatestVideo(<channelid>)

Donation Donate

If this project help you reduce time to develop, you can give me a cup of coffee (or a Beer of course) :)

Support via PayPal

Git - Fork

$ 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

Releases

Too see all published releases, please take a look at the tags of this repository.

About

PHP script to gain channel statistics and videos. An alternative to the Youtube Data API. Free to use for everyone! 🤖

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Languages