- file_get_contents: documentation ( source)
- json_decode: documentation ( source)
<?php
$track = "spotify:track:5ChkMS8OtdzJeqyybCc9R5";
$url = "https://embed.spotify.com/oembed/?url=".$track."&format=json&callback=spotify";
$get_data = file_get_contents($url);
$get_json = json_decode($get_data);
$cover = $get_json->spotify->thumbnail_url;
echo $cover;