Le site http://www.wunderground.com/ propose une API très complète concernant les prévisions météo et les informations lunaires et solaire.
L'inscription de fait en deux étapes ;
- créer un compte
- demander une clé pour les api
Une fois la clé obtenu, il devient très facile de faire un capteur pour la box eedomus et récupérer les phases lunaire en cours par exemple (voir capture d'écran).
L'api étant très complète, on peut récupérer beaucoup d'autres informations ; prévision météo à plusieurs jours, heures de levé et couché de soleil...
Mais également des images de webcam proche de votre localisation ou encore des images radar !
Voici un exemple de retour de l'api :
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"forecast": 1
}
}
,
"forecast":{
"txt_forecast": {
"date":"16:51 CEST",
"forecastday": [
{
"period":0,
"icon":"partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"title":"mercredi",
"fcttext":"Partiellement nuageux. Minimales : 52 ºF.",
"fcttext_metric":"Partiellement nuageux. Minimales : 11 ºC.",
"pop":"0"
}
,
{
"period":1,
"icon":"nt_partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"title":"mercredi soir",
"fcttext":"Partiellement nuageux. Minimales : 52 ºF. Vents et variables.",
"fcttext_metric":"Partiellement nuageux. Minimales : 11 ºC. Vents et variables.",
"pop":"0"
}
,
{
"period":2,
"icon":"chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",
"title":"jeudi",
"fcttext":"Averses au cours de l'après-midi. Maximales : 68 ºF. Vents O soufflant de 5 à 10 mi/h. Risque de pluie : 30 %.",
"fcttext_metric":"Averses au cours de l\u0027après-midi. Maximales : 20 ºC. Vents O soufflant de 10 à 15 km/h. Risque de pluie : 30 %.",
"pop":"30"
}
,
{
"period":3,
"icon":"nt_chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/nt_chancerain.gif",
"title":"jeudi soir",
"fcttext":"Averses en début de journée. Minimales : 53 ºF. Vents O soufflant de 5 à 10 mi/h. Risque de pluie : 40 %.",
"fcttext_metric":"Averses en début de journée. Minimales : 12 ºC. Vents O soufflant de 10 à 15 km/h. Risque de pluie : 40 %.",
"pop":"40"
}
,
{
"period":4,
"icon":"mostlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/mostlycloudy.gif",
"title":"vendredi",
"fcttext":"Très nuageux. Maximales : 68 ºF. Vents NO soufflant de 5 à 10 mi/h.",
"fcttext_metric":"Très nuageux. Maximales : 20 ºC. Vents NO soufflant de 10 à 15 km/h.",
"pop":"10"
}
,
{
"period":5,
"icon":"nt_partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"title":"vendredi soir",
"fcttext":"Partiellement nuageux. Minimales : 50 ºF. Vents O soufflant de 5 à 10 mi/h.",
"fcttext_metric":"Partiellement nuageux. Minimales : 10 ºC. Vents O soufflant de 10 à 15 km/h.",
"pop":"20"
}
,
{
"period":6,
"icon":"chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",
"title":"samedi",
"fcttext":"Averses au cours de l'après-midi. Maximales : 66 ºF. Vents ONO soufflant de 5 à 10 mi/h. Risque de pluie : 50 %.",
"fcttext_metric":"Averses au cours de l\u0027après-midi. Maximales : 19 ºC. Vents ONO soufflant de 10 à 15 km/h. Risque de pluie : 50 %.",
"pop":"50"
}
,
{
"period":7,
"icon":"nt_partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"title":"samedi soir",
"fcttext":"Partiellement nuageux. Minimales : 48 ºF. Vents SO soufflant de 5 à 10 mi/h.",
"fcttext_metric":"Partiellement nuageux. Minimales : 9 ºC. Vents SO soufflant de 10 à 15 km/h.",
"pop":"10"
}
]
},
"simpleforecast": {
"forecastday": [
{"date":{
"epoch":"1434560400",
"pretty":"19:00 CEST le 17 juin 2015",
"day":17,
"month":6,
"year":2015,
"yday":167,
"hour":19,
"min":"00",
"sec":0,
"isdst":"1",
"monthname":"juin",
"monthname_short":"juin",
"weekday_short":"mer",
"weekday":"mercredi",
"ampm":"PM",
"tz_short":"CEST",
"tz_long":"Europe/Paris"
},
"period":1,
"high": {
"fahrenheit":"72",
"celsius":"22"
},
"low": {
"fahrenheit":"52",
"celsius":"11"
},
"conditions":"Partiellement nuageux",
"icon":"partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"skyicon":"",
"pop":0,
"qpf_allday": {
"in": 0.00,
"mm": 0
},
"qpf_day": {
"in": null,
"mm": null
},
"qpf_night": {
"in": 0.00,
"mm": 0
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": null,
"cm": null
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 20,
"kph": 32,
"dir": "",
"degrees": 0
},
"avewind": {
"mph": 5,
"kph": 8,
"dir": "NE",
"degrees": 34
},
"avehumidity": 75,
"maxhumidity": 0,
"minhumidity": 0
}
,
{"date":{
"epoch":"1434646800",
"pretty":"19:00 CEST le 18 juin 2015",
"day":18,
"month":6,
"year":2015,
"yday":168,
"hour":19,
"min":"00",
"sec":0,
"isdst":"1",
"monthname":"juin",
"monthname_short":"juin",
"weekday_short":"jeu",
"weekday":"jeudi",
"ampm":"PM",
"tz_short":"CEST",
"tz_long":"Europe/Paris"
},
"period":2,
"high": {
"fahrenheit":"68",
"celsius":"20"
},
"low": {
"fahrenheit":"53",
"celsius":"12"
},
"conditions":"Risque de pluie",
"icon":"chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",
"skyicon":"",
"pop":30,
"qpf_allday": {
"in": 0.02,
"mm": 1
},
"qpf_day": {
"in": 0.01,
"mm": 0
},
"qpf_night": {
"in": 0.01,
"mm": 0
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": 0.0,
"cm": 0.0
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 10,
"kph": 16,
"dir": "O",
"degrees": 263
},
"avewind": {
"mph": 9,
"kph": 14,
"dir": "O",
"degrees": 263
},
"avehumidity": 76,
"maxhumidity": 0,
"minhumidity": 0
}
,
{"date":{
"epoch":"1434733200",
"pretty":"19:00 CEST le 19 juin 2015",
"day":19,
"month":6,
"year":2015,
"yday":169,
"hour":19,
"min":"00",
"sec":0,
"isdst":"1",
"monthname":"juin",
"monthname_short":"juin",
"weekday_short":"vend",
"weekday":"vendredi",
"ampm":"PM",
"tz_short":"CEST",
"tz_long":"Europe/Paris"
},
"period":3,
"high": {
"fahrenheit":"68",
"celsius":"20"
},
"low": {
"fahrenheit":"50",
"celsius":"10"
},
"conditions":"Nuageux",
"icon":"mostlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/mostlycloudy.gif",
"skyicon":"",
"pop":10,
"qpf_allday": {
"in": 0.00,
"mm": 0
},
"qpf_day": {
"in": 0.00,
"mm": 0
},
"qpf_night": {
"in": 0.00,
"mm": 0
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": 0.0,
"cm": 0.0
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 10,
"kph": 16,
"dir": "NO",
"degrees": 313
},
"avewind": {
"mph": 8,
"kph": 13,
"dir": "NO",
"degrees": 313
},
"avehumidity": 63,
"maxhumidity": 0,
"minhumidity": 0
}
,
{"date":{
"epoch":"1434819600",
"pretty":"19:00 CEST le 20 juin 2015",
"day":20,
"month":6,
"year":2015,
"yday":170,
"hour":19,
"min":"00",
"sec":0,
"isdst":"1",
"monthname":"juin",
"monthname_short":"juin",
"weekday_short":"sam",
"weekday":"samedi",
"ampm":"PM",
"tz_short":"CEST",
"tz_long":"Europe/Paris"
},
"period":4,
"high": {
"fahrenheit":"66",
"celsius":"19"
},
"low": {
"fahrenheit":"48",
"celsius":"9"
},
"conditions":"Risque de pluie",
"icon":"chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",
"skyicon":"",
"pop":50,
"qpf_allday": {
"in": 0.05,
"mm": 1
},
"qpf_day": {
"in": 0.05,
"mm": 1
},
"qpf_night": {
"in": 0.00,
"mm": 0
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": 0.0,
"cm": 0.0
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 10,
"kph": 16,
"dir": "ONO",
"degrees": 282
},
"avewind": {
"mph": 7,
"kph": 11,
"dir": "ONO",
"degrees": 282
},
"avehumidity": 69,
"maxhumidity": 0,
"minhumidity": 0
}
]
}
}
}