Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda