0

when I do this:

const uuidapi = await axios.get('https://api.hypixel.net/player?key=mykey&name=' + args[1]);
console.log(uuidapi);

I get this response from Axios:

https://paste.menudocs.org/paste/7vppu

So my question is: How do I get the Data after "socialMedia"? Heres how socialMedia looks like:

"socialMedia": {
          "links": {
            "YOUTUBE": "https://www.youtube.com/channel/UC1L7H9qQyB2zZgt-1XUv6jA",
            "DISCORD": "Altpapier#4847"
        }
    }

Why does it say socialMedia: [Object], and how do I get more than this? I can't use const { data } = await axios.get(URL); because I want to get 2 URL responses with the complete data. I also want to be able to safe for example the DISCORD Name Altpapier#4847 how do I do that?

Altpapier
  • 11
  • 2

2 Answers2

1

All the data is already here, it's just the formatting of console.log that's not printing every nested object. If you replace

 console.log(uuidapi);

by

 console.log(JSON.stringify(uuidapi));

it will work better

Axnyff
  • 9,213
  • 4
  • 33
  • 37
1

See this question: How can I get the full object in Node.js's console.log(), rather than '[Object]'?

you can use console.dir( yourObject, { depth: null } )