Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

137
Visualizações
how to access fetch api object

hello just wondering how do I access the temperature? do I have to stringify or just use the data? Im very new to programming and don't know how to access stringifyed object

code below

fetch(
    "https://api.openweathermap.org/data/2.5/weather?q=Zushi,japan&APPID=undefined&units=metric"
)
    .then((response) => response.json())
    .then((data) => {
        console.log(data);
        // let myJSON = JSON.stringify(data);
        document.getElementById("temp").innerHTML = data[0];
    });

this is the object im trying to access and append to html page?

object = {coord: {…}, weather: Array(1), base: 'stations', main: {…}, visibility: 10000, …}
base: "stations"
clouds: {all: 28}
cod: 200
coord: {xxxxxxx}
dt: 1656072014
id: 1847968
main: {temp: 26.87, feels_like: 29.9, temp_min: 26.38, temp_max: 28.8, pressure: 1006, …}
name: ""
sys: {type: 2, id: 20510, country: 'JP', sunrise: 1656012469, sunset: 1656064800}
timezone: 32400
visibility: 10000
weather: [{…}]
wind: {speed: 12.05, deg: 217, gust: 17.58}
[[Prototype]]: Object
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda