-2

Hi everyone!

Im trying to log an github`s gist api value into my console. For example i want to use this api link: https://api.github.com/gists/66db7c87873b63918e5451b06df8e0f0

i want to log files/sas/content value using console.log()

How can i do this?

Nothing
  • 1
  • 1

1 Answers1

1

This is probably what you wanted

(async() => {
  const data = await (await fetch('https://api.github.com/gists/66db7c87873b63918e5451b06df8e0f0')).json()
  console.log(data.files.SAS.content)
})()
Konrad
  • 21,590
  • 4
  • 28
  • 64
  • Thanksssss it works. can you solve this too? https://stackoverflow.com/questions/73590856/how-can-i-get-specific-value-in-object-values-node-js-from-my-code – Nothing Sep 03 '22 at 18:08