PHP code example of vinelab / itunes

1. Go to this page and download the library: Download vinelab/itunes 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/ */

    

vinelab / itunes example snippets


// change this to point correctly according
// to your folder structure.
 = $iTunes->search('Porcupine Tree')); // The original iTunes response

$json = json_encode($response);



    // Search the iTunes Store
    ITunes::search('Metallica');

    // Search the iTunes Store with custom parameters
    ITunes::search('Cannibal Corpse', array('limit'=>25, 'entity'=>'...'));

    /**
     * Search for media
     *
     * check (http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html#searching)
     * for all supported media types (the media parameter)
     */
    ITunes::music('Rolling Stones');

    ITunes::musicVideo('Immolation');

    ITunes::tvShow('Sex and The City');


    ITunes::musicInRegion('LB', 'Myriam Fares');

    ITunes::musicVideoInRegion('US', 'Immolation');



    // Lookup defaults to id=...
    ITunes::lookup(490326927);

    // You can also specify the lookup request
    ITunes::lookup('amgVideoId', 17120);

    // Multiple items lookup
    ITunes::lookup('amgAlbumId', '15175,15176,15177,15178,15183,15184,15187,1519,15191,15195,15197,15198');




    ITunes::cacheFor(10);
    ITunes::search('Gangnam Style'); // will be cached for 10 min.

    ITunes::cacheFor(1);
    ITunes::search('Yesterday'); // will be cached for 1 min.

    // To bypass caching pass 0
    ITunes::cacheFor(0);
    ITunes::search('Hallelujah'); // won't be cached