National Network of Regional Coastal Monitoring Programmes
CCO Real-Time Data API
The API gives the latest and recent wave, tide and meteorological observations, and tide predictions, from the stations of the National Network of Regional Coastal Monitoring Programmes (NNRCMP).
Contents
- Terms of use
- Authentication
- Endpoints and returned data
- Query options
- Quality control
- Test harness
- Errors
- Changes
- Contact
1. Terms of use
Data from the NNRCMP is made freely available under the terms of the Open Government Licence.
Web pages and other outputs which use real-time NNRCMP data must include the following attribution:
"Real time data displayed on this page are from the National Network of Regional Coastal Monitoring Programmes, made freely available under the terms of the Open Government Licence. Please note that data are not quality-controlled in real-time."
1.1 Acceptable use
Each API key is for the domain it was issued for. Please don't share your key or use it from other sites.
Please cache responses, and request data no more often than it is recorded (see section 3): every 30 minutes for waves, except Penarth at 10 minutes, and every 10 minutes for tides and met. A request covering all wave stations can use a 10-minute interval to include Penarth. For a longer period, use duration (section 4.1) rather than many single requests.
Data may arrive late and stations may stop reporting, so check each record's timestamp.
We may limit or disable keys that cause heavy load or ignore these terms, and we may limit request rates without notice to protect the service.
2. Authentication
An API key must be provided with every API request, either as an HTTP GET variable, key=YOUR_API_KEY, or in the custom request header X-API-Key: YOUR_API_KEY. If both are sent, the GET variable is used.
The Referer header must be a web address on the domain the key is issued for, or on a subdomain of it. For a key issued for yourdomain.com, pages on https://yourdomain.com/ and https://www.yourdomain.com/ qualify, and https://yourdomain.com.example.net/ does not. A web browser sends this header itself. Other programs, such as scripts run on a server, should send it themselves, for example Referer: https://www.yourdomain.com/. A domain on its own, without https://, is not recognised.
2.1 Obtaining an API key for your own service
This will be automated via a web interface on the CCO user management page. In the meantime, please fill in the form below:
3. Endpoints and returned data
There are four groups of endpoints, one for each type of data: waves, tides, tidepredictions and met.
Wave measurements are normally recorded at 30-minute intervals, except Penarth, which records at 10-minute intervals. Water level and meteorological measurements are normally recorded at 10-minute intervals. Gaps and timestamp variations occur, and data can arrive late, so check each record's timestamp. A station that has stopped reporting may still return its last record.
Some entries are external sites, run by other organisations and included for reference. They have a link to the provider's page as their id, and no readings.
Fields common to all endpoints
| Field | Description |
|---|---|
| boundedBy, msGeometry, msGeometryOSGB | The position of the station in GML: a bounding box, a point in longitude and latitude (EPSG:4326) and a point in British National Grid eastings and northings (EPSG:27700). GeoJSON has the same three fields, always null, so that the field lists match. In GeoJSON, read the position from geometry (longitude, latitude). KML has none of these fields and gives the position as a Point. |
| id | Numeric identifier for NNRCMP stations. For an external site, a link to the data provider's page. |
| sensor | Site name |
| institution | The organisation(s) that collected the data |
| date | The timestamp of the record in GMT (UTC), as YYYYMMDD#hhmmss: date and time are separated by '#' |
| type | The data type: waves, tides, tidepredictions or met. In KML, only the waves endpoint has this field. |
KML responses also have a gml_id field, which is the data type and the id joined by a full stop.
3.1 Waves
| Field | Description |
|---|---|
| gps_latitude | The latitude of the buoy in decimal degrees, from the buoy's own GPS. Empty for stations without one. |
| gps_longitude | The longitude of the buoy in decimal degrees, from the buoy's own GPS. Empty for stations without one. |
| hs | The spectral significant wave height in metres |
| hmax | The maximum wave height in metres |
| sst | The sea surface temperature, measured at 0.5 metres below the surface, in degrees Celsius |
| tp | The spectral peak wave period in seconds |
| tz | The spectral zero-upcrossing wave period in seconds |
| pdir | The spectral peak wave direction in degrees |
| value | A copy of pdir, kept for older applications. Please use pdir. |
| spread | The spread of wave direction in degrees |
| te | The wave energy period in seconds |
| power | The wave power in kW/m |
| QCflag | The quality-control flag, see section 5 |
3.2 Tides
| Field | Description |
|---|---|
| value | The measured water level in metres above Chart Datum |
| hw | The elevation of the next predicted High Water in metres above Chart Datum |
| hw_timestamp | The timestamp of the next predicted High Water in GMT (UTC), as YYYYMMDD#hhmmss |
| lw | The elevation of the next predicted Low Water in metres above Chart Datum |
| lw_timestamp | The timestamp of the next predicted Low Water in GMT (UTC), as YYYYMMDD#hhmmss |
| prev_hw | The elevation of the previous predicted High Water in metres above Chart Datum |
| prev_hw_timestamp | The timestamp of the previous predicted High Water in GMT (UTC), as YYYYMMDD#hhmmss |
| prev_lw | The elevation of the previous predicted Low Water in metres above Chart Datum |
| prev_lw_timestamp | The timestamp of the previous predicted Low Water in GMT (UTC), as YYYYMMDD#hhmmss |
| QCflag | The quality-control flag, see section 5 |
3.3 Tide predictions
Tide predictions are available at one-minute intervals up until the end of the current or next year. latest returns the prediction for the current minute. The fields are the same as for tides, without QCflag, and value is the predicted water level in metres above Chart Datum.
3.4 Met
| Field | Description |
|---|---|
| speed | Wind speed in metres per second |
| value | A copy of speed, kept for older applications. Please use speed. |
| dir | Mean wind direction in degrees, averaged over 10 minutes |
| temp | Air temperature in degrees Celsius |
| gust | Gust speed in metres per second |
| pressure | Atmospheric pressure in hectopascals |
| rainfall | Precipitation in millimetres |
| humidity | Relative humidity as a percentage |
| QCflag | The quality-control flag, see section 5 |
Met responses in KML do not have dir or temp. Use GML or GeoJSON for those.
4. Query options
4.1 Time
All timestamps are in GMT (UTC). Each request names a time: either latest, which returns the most recent record, or a date and time as YYYYMMDDhhmmss. With a date and time, the API returns the most recent record at or before that time. today is not supported.
https://coastalmonitoring.org/observations/waves/latest?key=YOUR_API_KEY
https://coastalmonitoring.org/observations/tides/latest?key=YOUR_API_KEY
https://coastalmonitoring.org/observations/tidepredictions/20210123130000?key=YOUR_API_KEY
https://coastalmonitoring.org/observations/met/20210123130000?key=YOUR_API_KEY
For more than one record per site, add duration: the number of hours before latest or the given time. The maximum is 168 hours (one week) for all sites, or 8,760 hours (one year) for a single site. Larger values are reduced to the maximum. With a duration, tide predictions are given at 10-minute rather than one-minute intervals.
https://coastalmonitoring.org/observations/waves/latest?key=YOUR_API_KEY&duration=24
https://coastalmonitoring.org/observations/tides/20210123130000?key=YOUR_API_KEY&duration=1
https://coastalmonitoring.org/observations/tidepredictions/latest?key=YOUR_API_KEY&duration=6
4.2 Location
By default, the API returns records from all sites, in alphabetical order. For a single site, add sensor with the site name or its numeric id. A request without sensor lists every site with its name (sensor) and id.
https://coastalmonitoring.org/observations/waves/latest?key=YOUR_API_KEY&sensor=Dawlish
https://coastalmonitoring.org/observations/tides/20210123130000?key=YOUR_API_KEY&sensor=89
https://coastalmonitoring.org/observations/tidepredictions/20210123130000?key=YOUR_API_KEY&sensor=89&duration=24
https://coastalmonitoring.org/observations/met/latest?key=YOUR_API_KEY&sensor=Deal%20Pier&duration=6
The stations and their recent readings can also be browsed as plain web pages, with no key, at https://coastalmonitoring.org/observations/. Those pages are for people; programs should use the API.
4.3 Output format
Every endpoint is available as GML (a WFS document, which is XML with coordinates), KML (a Google Earth document, also XML) or GeoJSON. Choose the format with the Accept header:
application/xml for GML, application/vnd.google-earth.kml+xml for KML or application/json for GeoJSON
Without an Accept header, or with one that allows anything, the response is GML. Alternatively, add the format to the URL to override the Accept header:
https://coastalmonitoring.org/observations/waves/latest.gml?key=YOUR_API_KEY
https://coastalmonitoring.org/observations/tides/20210123130000.kml?key=YOUR_API_KEY
https://coastalmonitoring.org/observations/tidepredictions/latest.kml?key=YOUR_API_KEY&sensor=89
https://coastalmonitoring.org/observations/met/latest.geojson?key=YOUR_API_KEY&duration=24
5. Quality control
Data is not quality controlled in real-time. Wave, tide and met data are quality controlled monthly in arrears. Erroneous data is flagged rather than removed.
Until a record has been through quality control, it has no flag: QCflag is null in GeoJSON and empty in GML and KML. An empty flag does not mean that the data passed quality control. Tide predictions have no QCflag.
For a full description of the quality control procedure and the flags, please see the quality control handbooks.
6. Test harness
Try the API with the Swagger test page:
https://coastalmonitoring.org/swagger-ui-master/dist/
Use the development API key for the coastalmonitoring.org domain: 6cefd36d8e12a4dead4cf06d4dbd09c0
7. Errors
Errors are returned as plain text with one of these status codes:
- 400 Bad Request: the date is today, which is not supported; use latest or a date and time such as 20210123130000.
- 401 Unauthorized: the API key is missing or unknown.
- 403 Forbidden: the Referer header does not name the domain the key is issued for.
- 404 Not Found: the address is not an API endpoint.
- 406 Not Acceptable: the URL has no format suffix and the Accept header allows none of the three formats.
8. Changes
| Date | Version | Changes |
|---|---|---|
| November 2026 | 1.8 | GPS survey stations removed from waves, Shanklin removed from met, and the Hinkley Point entry updated to the current WaveNet buoy |
| October 2026 | 1.7 | A missing or unknown key returns 401, and a Referer that does not match returns 403 |
| August 2026 | 1.6 | Buoy positions from the buoys' own GPS (gps_latitude, gps_longitude) added to waves |
| March 2026 | 1.5 | GeoJSON returns null for every missing value |
| February 2026 | 1.4 | QCflag added for wave, tide and met data. Missing values are returned as null (GeoJSON) or empty (GML, KML) instead of "None" |
| 13 September 2024 | 1.3 | The tidepredictions endpoint |
| 23 September 2022 | 1.2 | Several records per site with duration |
| 16 September 2022 | 1.1 | Filtering for a single site with sensor |
9. Contact
For questions or comments on using the API, please use our feedback form or email us.
