How to caculate a countdown to the next high and low tide.
First, there is a nice plugin called Tides Today UK and Ireland tide times that allows tidal charts to be displayed using a Sidebar Widget or a shortcode. For example:
[tide_times days=1 title="Tide times for Leith" location="leith"]These are today's tides for Leith[/tide_times]
That outputs a tidy forecast like so:
Tide times for Leith
These are today’s tides for Leith
28 May 2017
Copyright 2017 © Tides Today. See full Terms and Conditions for usage of this data. By using this data, you are agreeing that you are responsible for your own safety at sea. The owner of this site or Tides Today/Stephen Wright cannot be held responsible for anything that happens to anyone as a result of using tide times shown here or elsewhere.
The shortcode references the authors own web-service api that returns a JSON encoded dataset. Here is the dataset for Leith. However, the plugin author clearly (if not threateningly) states:
You may not use the data provided by the API for anything other than displaying tide information on your website by the
means provided by this plugin.
…Failure to comply with any of the conditions outlined here or as outlined in the Tides Today Terms and conditions will result in legal action being taken.
In the words of Al Swearengen:
Not a tone to get a deal done.
Even though the datasource provide is from the UK Hydrographic Office:
All data is provided by the UK Hydrographic Office and is provided under license. Crown Copyright 2016.
So we might need to find our own, tax-funded, public, non-threatening api to get our tidal info from, for example:
The NOAA api looks quite promising… but it’s only for North America. So we move on to Worworldtides api which provides 1000 free calls per month. So far that is a winner. Now let’s take a look at The National Tidal and Sea Level Facility. It seems it only serves the UK and Ireland. Here is Leith.