Download the PHP package madcoda/php-youtube-api without Composer

On this page you can find all versions of the php package madcoda/php-youtube-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-youtube-api

php-youtube-api

Tests Static analysis Latest Stable Version Total Downloads License

A basic PHP wrapper for the Youtube Data API v3 (non-OAuth). Designed to let devs easily fetch public data (video, channel and playlist info) from Youtube. No third-party runtime dependencies.

The reason for returning the decoded JSON response directly is that you only need to read the Google API doc to use this library, instead of learning another set of APIs on top of it. Keep it simple.

Some parameters are missing from this library simply because they were not needed at the time. If you want a particular feature, please file an issue.

OAuth endpoints are out of scope: anything requiring an "authorized request" is not supported.

Requirements

Every release is tested on PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5.

PHP Status
7.0 – 7.4 Supported. All are past end of life; upgrading is strongly recommended.
8.0 – 8.1 Supported. Both are past end of life.
8.2 – 8.5 Supported and actively maintained.

The 1.x line keeps the PHP 7.0 floor so existing installs are not broken. It will be raised in 2.0.

Install

Getting started

Please read the wiki on how to use this library with PHP with composer, Laravel 4 and Laravel 5.

For the functions implemented in this library, see the API reference.

Plain PHP

Laravel

The package is auto-discovered on Laravel 5.5 and newer, so there is nothing to register. Publish the config and set your key:

On Laravel 5.0 to 5.4, register the provider and alias manually in config/app.php:

The Laravel 4 provider is deprecated and will be removed in 2.0. Laravel 4 has been end of life since 2015, and the provider relies on package() and bindShared(), both removed in Laravel 5.

Format of returned data

The returned JSON is decoded into PHP objects, not arrays. See the "Reference" section of the official API doc for the shape of each resource.

Methods that fetch a single resource return false when nothing matches; methods that fetch a list return false when the list is empty. API errors are thrown as \Exception with the Google error code as the exception code.

Using your own HTTP client

Requests go through a small transport interface, so you can route them through your own HTTP stack, add retries or logging, or return canned responses in your own tests.

Without one, the library uses Madcoda\Youtube\Http\CurlHttpClient, which behaves exactly as before.

Development

The test suite runs offline against recorded fixtures, so it needs no API key:

A second suite exercises the real API to catch changes in Google's response shapes. It is excluded by default and needs a key:

No composer.lock is committed, which is deliberate: each supported PHP version has to be free to resolve the PHPUnit major that supports it, from 5.7 on PHP 7.0 up to 11.5 on PHP 8.5.

Youtube Data API v3

Contact

For bugs, complaints or suggestions, please file an issue or email [email protected].

License

madcoda/php-youtube-api is licensed under the MIT License.


All versions of php-youtube-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package madcoda/php-youtube-api contains the following files

Loading the files please wait ...