You have to suscribe to https://openweathermap.org/api, it’s free
once you get json string, you have to use my code.
this is the string you get with API
{"coord":{"lon":5.01,"lat":44.84},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"base":"stations","main":{"temp":19.99,"feels_like":13.56,"temp_min":18.89,"temp_max":21,"pressure":1029,"humidity":43},"visibility":10000,"wind":{"speed":8.2,"deg":350},"clouds":{"all":34},"dt":1590341663,"sys":{"type":1,"id":6505,"country":"FR","sunrise":1590292743,"sunset":1590347696}
as you can see, sunrise is 1590292743, unix time