Yes, I agree - it was a bit of a faff (compared with OpenWeatherMap - which is very easy to set-up).
Another issue is that the "forecast" is based on their last model run and not on the current time. So you need to search through the result array to find the most appropriate entries.
Also, no current data, only model forecast.
I used the met office api a few years ago, but abandoned it because of the absence of current data. So nothing has changed...
I suppose it depends on your use-case. I was interested in forecast information, so it met my needs for that. For current data, I could look out of the window
Weather info and forecasts are now back on the list of goodies to add to my system.
Though that wont tell you the humidity, wind speed and exact direction, ...
Very true, but again it comes down to use-cases. I wanted forecasts for the day for being out on a boat, and it takes about an hour to get to the harbour, get prepped and out on the water, so the immediate local conditions aren't as important.
If there was an API for the shipping and inshore forecasts that would be really useful, but so far the Met Office haven't provided one.
Surely you just subscribe to https://www.bbc.co.uk/programmes/b006qfvv/episodes/player and listen to it in the car ? Much nicer that all this tech imho
Hi Craig,
Interesting flow, could you tell me a bit more about how to specify the requested location please
The MetOffice API includes visibility and wind data which would be useful for the harbour conditions.
Some additional options (not tried):
- https://www.worldweatheronline.com/developer/api/marine-weather-api.aspx
- https://docs.stormglass.io/#/ (includes tides at least) - says that it includes MetOffice data: Global currents, water temperature, sea level and salinity - "High resolution data for currents and waves in North West Shelf"
- https://www.admiralty.co.uk/digital-services/data-solutions/uk-tidal-api
- MetOffice have some other, fairly well hidden & unsupported API's - https://www.metoffice.gov.uk/services/data/datapoint
- Norway's met office - https://api.met.no/weatherapi/oceanforecast/0.9/documentation - not sure whether that data is global or not.
And for reference, a couple of recent reviews of weather API's (mainly for my own reference actually )
- https://www.climacell.co/blog/top-8-weather-apis-for-2020/
- https://rapidapi.com/blog/access-global-weather-data-with-these-weather-apis/
Personally, what I'd like to do is to suck in a few forecasts and compare the data side-by-side. :sigh: another thing to add to the ever lengthening list - I really need to retire!
@TotallyInformation - thanks for those. There are some very interesting options there.
I was using the Met Office Datapoint API in my previous mini-app (just a quick hack in C#) but the newer APIs look worth investigating too. I didn't know about the Admiralty tides API though, and that is very interesting. It could save a bit of work with the tide tables
I've just had a look at Climacell, and it appears very comprehensive with a generous free tier.
Did you try it? I've been looking this evening, but can't see a example of how to structure the api call (one that I can understand ).
Yes, I was looking at it but hit the same issues. I can't get it to return a decent set of data.
If you go to the BOM web site (only for Australia) you can then find the location you are interested in
http://reg.bom.gov.au/catalogue/data-feeds.shtml
Craig
Managed to get it working like this:
[{"id":"452a2900.f9f288","type":"change","z":"d0860be6.7951b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"apikey\":\"<PUT_YOUR_API_KEY_HERE>\",\"lat\":53.00000,\"lon\":-1.00000}","tot":"json"},{"t":"set","p":"url","pt":"msg","to":"https://api.climacell.co/v3/weather/realtime","tot":"str"},{"t":"set","p":"headers","pt":"msg","to":"{\"'content-type\": \"application/json\", \"Accept\":\"application/json\",\"User-Agent\":\"node-red\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":135,"y":1020,"wires":[["ad80fbf0.ace858"]],"l":false,"info":"https://developer.climacell.co/v3/reference#get-realtime\n\nhttps://developer.climacell.co/v3/docs/present\n\nhttps://developer.climacell.co/v3/widgets"},{"id":"1087cc90.ca2083","type":"inject","z":"d0860be6.7951b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":75,"y":1020,"wires":[["452a2900.f9f288"]],"l":false},{"id":"ad80fbf0.ace858","type":"http request","z":"d0860be6.7951b8","name":"","method":"GET","ret":"obj","paytoqs":true,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":195,"y":1020,"wires":[["432f63fd.0ce4ec"]],"l":false},{"id":"432f63fd.0ce4ec","type":"change","z":"d0860be6.7951b8","name":"","rules":[{"t":"set","p":"forecast_cl","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":1020,"wires":[["510f2f7f.f0713"]]},{"id":"510f2f7f.f0713","type":"debug","z":"d0860be6.7951b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":475,"y":1020,"wires":[],"l":false}]
Well done @TotallyInformation, you got much further than me!
I've just added my api key and tried your flow, but the reply isn't as rich as yours, even with my local coordinates added
I assume that you changed the lat/long to something more appropriate?
I deliberately changed them, sorry I should have said. That is because the actual ones I used are the front corner of our property
Yes, I tried my own lat/lon, and a few others, and it only returns precipitation
, precipitation_type
& observation_time
.
Having read https://developer.climacell.co/v3/reference I thought that was the default response, and the other data responses have to be individually added, such as temp
, feels_like
etc.
How have you got the full data response?
You can see in the flow. The fields parameter needs to be an array of field names.
Sorry @TotallyInformation I don't understand what you are saying.
You have posted a flow, and a screenshot of the resultant debug showing an array of objects with everything from temperature
to surface_shortwave_radiation
, whilst although I'm using the same flow that you posted, with just a different api key & lat/lon, I get measly rain conditions!!
Did you use a different flow to get the richer data that you have posted?
WAIT! Spotted it. For some reason, my last change was lost - no idea how that happened. I'll update in a second. Right, see the updated msg.payload
. Weird how that disappeared.
No, that was the flow. It simply gets the data, saves it to a global variable (so I can play with the output without having to use up my allowances) and outputs to debug.
Here is the JSON from the 2nd node:
msg.payload
{
"apikey": "<PUT_YOUR_API_KEY_HERE>",
"lat": 53.0000,
"lon": -1.0000,
"fields": [
"precipitation",
"precipitation_type",
"temp",
"feels_like",
"dewpoint",
"wind_speed",
"wind_gust",
"baro_pressure",
"visibility",
"humidity",
"wind_direction",
"sunrise",
"sunset",
"cloud_cover",
"cloud_ceiling",
"cloud_base",
"surface_shortwave_radiation",
"moon_phase",
"weather_code"
]
}
msg.url
https://api.climacell.co/v3/weather/realtime
msg.headers
{
"content-type": "application/json",
"Accept": "application/json",
"User-Agent": "node-red"
}