HypixelDev / PublicAPI

Official Java implementation of the Hypixel Public API.
https://api.hypixel.net
MIT License
535 stars 151 forks source link

stats.SkyBlock.account.selected_profile does not exist #238

Closed edwnl closed 1 year ago

edwnl commented 4 years ago

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.

Picsou993 commented 4 years ago

Reference of #235.

Omega172 commented 1 year ago
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

ConnorLinfoot commented 1 year ago

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