[PHP] Youtube Keywords Scraper

jaran

New member
I want to to share Youtube Keywords Scraper for who anyone wants to get money from Youtube. This script will help you to found good keywords your videos with easily. Just place this script on your webserver (localhost) or place at your website to monitoring best keywords competition. Here we go,
PHP:
<div align="center">
Youtube Keywords Scraper :<br>
<form method="POST" action="">
<input name="q" type="text">
<input value="Search" type="submit">
</form>
</div>

<?php
function get_url($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
$result = curl_exec($ch);
return $result;
}

$q = (isset($_POST['q'])    ? $_POST['q']    : '');
$datas = get_url('https://www.youtube.com/keyword_tool_ajax?action_get_kw_by_score=1&query='.urlencode($q).'&lang=en&country=US');
$json = json_decode($datas);
$item = $json->keywords;
if(isset($q)){
for($i=0;$i < count($item);$i++){
if($i==0){
echo '<h3>Keywords :</h3>';
echo $item[$i].'<br>';
}else{
echo $item[$i]."<br>";
}
}
}else{
echo 'Try to search Youtube Keywords.';
}
?>
If you facing any problem how to use it, you can disscuss it right here.
 

jaran

New member
Youtube Keyword Tool has been discontinued by Google at this time now. Please dont used it now. I will share other keyword scraping on the next time. Thanks.