PHP Classes


Recommend this page to a friend!
  Classes of Miraz Mac   PHP YouTube Video Scraper   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP YouTube Video Scraper
Get details about videos scraping YouTube pages
Author: By
Last change:
Date: 4 years ago
Size: 1,593 bytes


Class file image Download


YouTube Public Data Scrapper that parses HTML for the data

FackTube is a scrapper for retrieving YouTube public data. Currently it can only scrape videos. Channels, playlists and single video will be added in future. Feel free to fork and add.

It's not a reliable method for fetching data unless you use tons of paid proxies. And I wouldn't recommend using it on Production either. But hey, YouTube's been a real jerk lately with their Data API v3. It's the least we can do, so lets fack on YouTube.

Install via Composer

composer require mirazmac/facktube


  • You can't limit or change the amount of results per page
  • It depends on YouTube's internal html output, and since YouTube heavily relies on JavaScript it can only show the results YouTube provides with no filter whatsoever
  • Its illegal and YouTube may block your IP if you send too many requests


Check usage folder for complete usage examples.

Searching Videos

use MirazMac\FackTube\FackTube;

$fack = new FackTube($options);

try {
    $results = $fack->videos('Honest Trailer');
} catch (\Exception $e) {
    echo $e->getMessage();


But hey, if html parsing is so messy, Why not AJAX endpoints?

Well, yeah I did that previously with and now YouTube completely revamped their AJAX endpoints with session based Tokens and other stuff. So, thats a no no. But if you find a way to bypass those create a new repo and let me know, I'll be happy to contribute.