1. I'm trying to get ranked skywars wins from the api but I can't find the path to it.
    I'm doing

    $json = file_get_contents('https://api.hypixel.net/player?key=(My Key)&name='.$name);

    $doc= json_decode($json, true);

    $swrw = ($doc['player']['Skywars']['wins_ranked']);

    But all I get is a blank variable. Anyone know how to do it?
    Last edited: Feb 4, 2020
  2. The path should be:
    Let me know if that helped.

    Also watch out, your link in your thread still includes your private API key, try to remove that link to keep it private.
    Last edited: Feb 4, 2020
  3. I still don't get an output from it, I was able to do it with solo and teams wins but those are under achievements.
  4. Try to enable PHP error reporting, that will always help you in case of errors.

    In your case, it is probably because it is supposed to be "SkyWars", not "Skywars".

    I tried the following code and it is working:

    $key "";

    $json file_get_contents('https://api.hypixel.net/player?key='.$key.'&name='.$name);
    $doc json_decode($jsontrue);


Share This Page