DarkSky API Error in Snippet

This part of the error

file_get_contents(https://api.darksky.net/forecast//,)

would suggest that the variables $api, $lat and $lng are all empty.
How do you call this snippet?

Btw, it looks like you had the same issue back in january.