1. Go to this page and download the library: Download firelike/itunes-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Firelike\ITunes\Request\AbstractRequest;
use Firelike\ITunes\Request\Search as SearchRequest;
use Firelike\ITunes\Service\ITunesService;
$request = new SearchRequest();
$request->setTerm('micheal connelly')
->setMedia('audiobook')
->setLimit(25);
$service = new ITunesService();
$result = $service->search($request);
$numberOfRecords = $result->toArray()['resultCount'];
var_dump($numberOfRecords);
$records= $result->toArray()['results'];
var_dump($records);
php public/index.php itunes search -v
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.