Parsing weather JSON API data in NodeJS APP

Please follow and like us:
const request=require('request')
const weatherUrl='https://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22'

request({url:weatherUrl},(error,response)=>
	{
	const result=JSON.parse(response.body)
	
  console.log('City: '+result.name)
  console.log('Temp: '+result.main.temp)
  
  
	})
	

Leave a Reply

Your email address will not be published. Required fields are marked *