You can use PHP getimagesize()
function
Like this:
$img = getimagesize('https://www.filepicker.io/api/file/JNJB5DkqR8C4OAbzXh8z');
echo $img['mime']; // image/png
If you want to just extract the extension without MIME Type. You can use image_type_to_extension
echo image_type_to_extension($img[2]); // .png