socialapis / youtube-suggestions
A small webproxy for google and youtube autocomplete results.
v1.0.0
2020-04-20 15:06 UTC
Requires
- php: >=7.0
- google/protobuf: ^3.11
- guzzlehttp/guzzle: ^6.2
- lazyjsonmapper/lazyjsonmapper: ^1.6.1
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2025-04-06 22:01:08 UTC
README
This repo is acting like the original youtube android aplication. It uses Google protobuf to decode the response.
Do you like this project? Support it by donating
socialAPIS
Installation
You Need!
- Use PHP >= 7
- Install composer.
Once you have composer installed, you can do the following:
composer require socialapis/youtube-suggestions
Usage
You can then do the following:
require_once '../vendor/autoload.php';
$youtube = new YoutubeSuggestions\Suggestions();
$response = $youtube->getSuggestions("Search query");
echo "Suggestion count: ", $response->getSearchModel()->count(), "\n";
echo "Requested query: ", $response->getRequestedQuery(), "\n";
echo "Request id: ", $response->getId()->getId(), "\n";
foreach ($response->getSearchModel() as $search_model) {
$sugg = strip_tags($search_model->getSuggestion());
echo $sugg, "\n";
}
See the following example, click here.
License
The Unlicense
For more information, please refer to https://unlicense.org
Legal
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by Google or Youtube or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.