YouTube API Search (by. Mp3-API.com):


Mp3-Api.com offers you an alternative to the YouTube Data API. Without limiting resources. Search for any video with no search limits.

Simple to use and without limit
- The complete URL for request is: https://mp3-api.com/@youtube?key=your_secret_key&lang=your_language&search=your_keyword
- This request will give you an answer with the founded videos in JSON format
- JSON response contains maximum 20 results for each search
- View JSON file example by clicking here
- Example of site that uses our Search API: https://mp3-hot.com

Get your FREE access key now by contacting us.

Results example:

{
"response " : "200",
"estimatedResults" : "1692572234",
"results" : [
{
"id":"RHQC4fAhcbU",
"title":"Eminem - Darkness (Official Video)",
"thumbnail":"https:\/\/i.ytimg.com\/vi\/RHQC4fAhcbU\/hqdefault.jpg",
"uploader":"EminemMusic",
"uploader_url":"https:\/\/www.youtube.com\/channel\/UCfM3zsQsOnfWNUppiycmBuw",
"duration":"6 minutes, 10 seconds",
"views":"38,115,696 views",
"description":"Eminem - Darkness (Official Video) by EminemMusic 1 month ago 6 minutes, 10 seconds 38,115,696 views"
},
...............................................................
],
"display":"20"
}


Code exmple:

//Request results
$json = file_get_contents('https://mp3-api.com/@youtube?key=your-secret-key&lang=en&search=music+2020'
$decode = json_decode($json);

//Display HTTP response
echo $decode->response;
//Display estimated results
echo $decode->estimatedResults;
//Display the number of results from the json response (Max.20)
echo $decode->display;

//Check and diplay results
if (empty($display))
{
echo 'No results where found!';
}
else
{
$x = 0;
while($x < $decode->display)
{
//Display video id
echo $decode->results[$x]->id;

//Display video title
echo $decode->results[$x]->title;

//Display video thumbnail
echo $decode->results[$x]->thumbnail;

//Display video uploader
echo $decode->results[$x]->uploader;

//Display youtube uploader url
echo $decode->results[$x]->uploader_url;

//Display video lenght time
echo $decode->results[$x]->duration;

//Display video views
echo $decode->results[$x]->views;

//Display video short description
echo $decode->results[$x]->description;

$x++;
}
}