1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

itunes api search term file_get_contents

Discussion in 'PHP' started by Ledz, Jan 13, 2017.

  1. #1
    I have strange issue about getting info from itunes api.
    So in my error log is written :
    "PHP Warning: file_get_contents(https://itunes.apple.com/search?term=the-bouncing-souls&limit=1&media=music&entity=song): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden"
    But when i enter this link in adress bar its getting me content.
    Also in my site when i reload page two tree times its getting me content but in first time it getting me this forbidden error.
    why?
    SEMrush
    down is my code :
    $response = json_decode(file_get_contents('https://itunes.apple.com/search?term='.$iartist.'&limit=1&media=music&entity=song'));
     
    Ledz, Jan 13, 2017 IP
    SEMrush