Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!