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

133
Visualizações
how can i use the coordinates from current weather api to get 6days forecast from onecall api from openweathermap.org

Can ayneone please help me out with my problem it would be great.

I wanted to get current weather and 5 days forecast data to use in one weather application but iam unable to use "l1" and "l2" values for latitude and longitude asked in onecall api.

                  key:"your api key", 
  
        getweather(city){
                  
               fetch(`https://api.openweathermap.org/data/2.5/forecast? 
               q=${city}&appid=${this.key}&units=metric`)
               .then(res => res.json())
               .then(data => 
                {weather.latdata(data),weather.longdata(data)})          
                 },

        getdaily(data){
              fetch(`https://api.openweathermap.org/data/2.5/onecall? 
lat=${lat}&lon=${lon}&exclude=hourly,minutely,alerts&appid=${this.key}& 
 units=metric`)
              .then(res => res.json())
              .then(data => this.display(data))           
            },
   
       display(data){
            const{temp,humidity}=data.current;
            const{icon,description}=data.current.weather[0];
            console.log(temp,icon,humidity,description);
           },

       latdata(data){ 
                     l1=data.city.coord.lat;
                     console.log(l1);
                  },
       longdata(data){
                    l2=data.city.coord.lon;
                    console.log(l2);
                  }, 
         }

      weather.getdaily();
      weather.getweather("mumbai");   ```
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