PublicAPI icon indicating copy to clipboard operation
PublicAPI copied to clipboard

stats.SkyBlock.account.selected_profile does not exist

Open edwincrl opened this issue 4 years ago • 1 comments

Recently I opened an issue about adding a selected_profile entry under the player endpoint, and received this response "It's available in stats.SkyBlock.account.selected_profile".

unnamed

stats.SkyBlock.account.selected_profile does not exist.

edwincrl avatar May 14 '20 00:05 edwincrl

Reference of #235.

Picsou993 avatar May 14 '20 00:05 Picsou993

let options = {
    hostname: 'api.hypixel.net',
    path: `/skyblock/profiles?uuid=${UUID}`,
    method: 'GET',
    headers: { 'API-Key': config.hypixelKey }
};

let req = https.request(options, (res) => {
    let data = ''

    res.on('data', (chunk) => {
        data += chunk;
    });

    res.on('end', () => {
        let json = JSON.parse(data)

        fs.writeFile('out.json', JSON.stringify(json), function (err) {
            if (err) return console.log(err);
        });

        json.profiles.forEach(profile => {
            if (profile.selected) {
                profileId = profile.profile_id;
                console.log(`Profile Found: ${profile.cute_name}:${profileId}`);
            }
        })
    });
}).end();

This worked for me

Omega172 avatar Dec 05 '22 12:12 Omega172

Closing this issue as we did add the selected boolean to the profiles endpoint to provide this information

ConnorLinfoot avatar Jun 07 '23 11:06 ConnorLinfoot