An open API service indexing awesome lists of open source software.

https://github.com/lreiner/yt-api-php

PHP script to gain channel statistics and videos. An alternative to the Youtube Data API. Free to use for everyone! 🤖
https://github.com/lreiner/yt-api-php

php youtube youtubeapi

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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.

## :warning: VERY IMPORTANT:warning:

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:
```php
http:///get_channel_statistics.php?id=UC-lHJZR3Gqxm24_Vd_AJ5Yw
```

Example Output in JSON:
```json
[{
"channelID":"UC-lHJZR3Gqxm24_Vd_AJ5Yw",
"viewCount":"21082625429",
"subscriberCount":"93689562",
"latestVideoID":"bRG6sy3VaWU"
}]
```

## Example Functions

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

YTChannel::getChannelStatistics(, )
```

#### getLatestVideo
```php
// @param channelid -> Youtube Channel ID
// @return videoID -> Video ID of latest YT Video

YTChannel::getLatestVideo()
```

## Donation [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/LukasReiner/)
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](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.me/LukasReiner/)

## 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](https://help.github.com/articles/fork-a-repo/)

## Releases

Too see all published releases, please take a look at the [tags of this repository](https://github.com/lreiner/YT-API-PHP/tags).