Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.4 KB

1.index.md

File metadata and controls

55 lines (35 loc) · 1.4 KB

Youtube API

This YoutubeAPI is a simple way to interact with Youtube (v3) API.

Installation

The easy way to install YoutubeAPI is to use composer. So please consider the following command:

composer require 'nekland/youtube-api:*'

This will add nekland/youtube-api to your composer.json file and automatically download it to your vendor folder.

Usages

  1. You have to declare a new instance of "Youtube" object;
  2. You have to configure the authentication you want to use;
  3. Enjoy apis compatible with your authentication configuration

Here is an example:

$youtube = new Youtube();

// Authentication with encrypted certificate
$youtube->authenticate(
    'ServiceAuth',
    ['cert_file' => 'my_google_certificate', 'email' => 'myemail_for_google_service@googleapi_etc.com']
);

// The info variable will contains an array of data returned by google
$info = $youtube->api('video')->findVideoById('RnpyRe_7jZA');

For now all APIs are compatible with all authentications.

More

You can learn more about authentication methods here.

To see what API follow your need you can checkout theses pages of documentation:

APIs are well documented inside the classes. Checkout the Api folder.