Skip to content

Commit

Permalink
🎬 First version of this php script
Browse files Browse the repository at this point in the history
πŸ‘€
  • Loading branch information
danielsebesta authored Dec 31, 2021
1 parent a4752f6 commit 3659e72
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

// PHP - SUBSCRIBER COUNT USING YOUTUBE API V3
// BY @danielsebesta

$api_key = "";
$channel_id = "";




$api_response = file_get_contents('https://www.googleapis.com/youtube/v3/channels?part=statistics&id=' . $channel_id . '&key=' . $api_key . '');
$api_response_decoded = json_decode($api_response, true);

$subscribers = $api_response_decoded['items'][0]['statistics']['subscriberCount'];

echo $subscribers

?>

0 comments on commit 3659e72

Please sign in to comment.