Using APIs to Get Covers - URL Error

I need album covers for my PHP site, but something no longer works.

I used JSON to get the album ID, and then I used this ID to get the album art.

My problem is that I am trying to decode json from the site, but I no longer get any result (it worked before ...).

Here is the code (getting JSON and decoding it):

$req="http://api-v3.deezer.com/1.0/search/track/?q=".$deezer."&index=0&nb_items=8&output=json";
$result = file_get_contents($req);
$testjson=json_decode($result,true);
+3
source share
1 answer

I think you are using the old Deezer api code (1.0, and I am not getting JSON from your url).

Try changing $reqto:

$req="http://api.deezer.com/2.0/search/album/?q".$deezer."&index=0&nb_items=8&output=json";

Then some codes are missing and are also important for change.

, URL- (2.0).

Deezer Api : .

+2

All Articles