0

I am looking for a steam web API to get info about games. Im trying to use this: $api_url_rust = "http://steamspy.com/api.php?request=appdetails&appid=252490";

$json2 = json_decode(file_get_contents($api_url_rust), true);

But I keep getting an error: Failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP

I don't think it has something with the way I have PHP installed. I tried running it on my schools server and I still gives me an error. Any idea how I can fix this or another API I could use? I also have other steam web API's that work fine.

Heres an example of one this is working correctly: $api_url_playerData = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$api_key&steamids=$steamid";

$json = json_decode(file_get_contents($api_url_playerData), true);

echo "Account Name: ". $json["response"]["players"][0]["personaname"] . "-----";

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Feb 17, 2022 at 22:23

1 Answer 1

0

So you want to consume a JSON response from an API served over SSL wihtout checking the SSL certificate. It is unsafe and not recommended.

File wrappers (in php especially) are not always enough to connect to another external webservice|microservice. You need to configure your php client to handle SSL properly OR you can do what you need safely only with building a SSL http client with php|java|python|go|etc., and load the JSON response.

It is exactly the same for any API, handshake properly with them and you can do what you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.