Download Rainfall Data

SEPA has approximately 275 rain gauges which measures of the amount of precipitation (mm) via Tipping Bucket Raingauges (TBR). The data reported here gives accumulated totals for each 15 min period. The data is typically transfered once or twice per day.

The Rainfall Data Downlad provides access to these rainfall measurements, and to information on the monitoring stations providing those measurements.

The data is provided as open data under the Open Government Licence with no requirement for registration. If you make use of this data please acknowledge 'SEPA' in the attribution statement.

Data download Summary

The table below gives a brief summary of the data available

The Data API provides a REST access to via simple HTTP Get Requests. Returning data in JSON,XML or CSV format.

Baseurl: https://www2.sepa.org.uk/rainfall

WhatURLFormat Alternatives
All rainfall stations: {baseurl}/api/Stations XML : {baseurl}/api/Stations?xml=true
CSV : {baseurl}/api/Stations?csv=true
Single site station Information:
Where {id} is the unique station number (integer)
{baseurl}/api/Stations/{id} XML : {baseurl}/api/Stations/{id}?xml=true
CSV : {baseurl}/api/Stations/{id}?csv=true
7 day hourly rainfall for a station
Where {id} is the unique station number (integer)
{baseurl}/api/Hourly/{id}?all=true XML : {baseurl}/api/Hourly/{id}?xml=true&all=true
CSV : {baseurl}/api/Hourly/{id}?csv=true&all=true
One Month Daily Rainfall Totals for a station
Where {id} is the unique station number (integer)
{baseurl}/api/Daily/{id}?all=true XML : {baseurl}/api/Daily/{id}?xml=true&all=true
CSV : {baseurl}/api/Daily/{id}?csv=true&all=true
Twelve Month Monthly Rainfall Totals for a station
Where {id} is the unique station number (integer)
{baseurl}/api/Month/{id}?all=true XML : {baseurl}/api/Month/{id}?xml=true&all=true
CSV : {baseurl}/api/Month/{id}?csv=true&all=true
Diplay what data is available for each site
Where {id} is the unique station number (integer)
{baseurl}/data/index/{id}

Sample Requests

for all examples we will get data for station id : 11518 (Millport)(https://www2.sepa.org.uk/rainfall/data/index/115618)

Site Details

JSON

https://www2.sepa.org.uk/rainfall/api/Stations/115618

    {
        station_name: "Millport",
        station_latitude: "55.74955539",
        station_longitude: "-4.907441406",
        station_no: "115618",
        station_id: "23008",
        itemDate: "2018-08-15 13:00:00",
        itemValue: "6",
        itemValue2: "6",
        accumRange: "10",
        ts_id: "130449010",
        oldtime: "0",
        station_longname: "Millport , Rainfall Gauge, Great Cumbrae Coastal ()"
    }
        

XML

https://www2.sepa.org.uk/rainfall/api/Stations/115618?xml=true

    <?xml version="1.0" encoding="UTF-8"?>
    <Site xmlns="http://schemas.datacontract.org/2004/07/Rainfall.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <accumRange>10</accumRange>
        <itemDate>2018-08-15 13:00:00</itemDate>
        <itemValue>6</itemValue>
        <itemValue2>6</itemValue2>
        <oldtime>0</oldtime>
        <station_id>23008</station_id>
        <station_latitude>55.74955539</station_latitude>
        <station_longitude>-4.907441406</station_longitude>
        <station_longname>Millport , Rainfall Gauge, Great Cumbrae Coastal ()</station_longname>
        <station_name>Millport</station_name>
        <station_no>115618</station_no>
        <ts_id>130449010</ts_id>
    </Site>
        

Hourly Data

JSON

https://www2.sepa.org.uk/rainfall/api/Hourly/115618?all=true

   [
    {
    Timestamp: "08/08/2018 00:00:00",
    Value: "0"
    },
    {
    Timestamp: "08/08/2018 01:00:00",
    Value: "0"
    },
    {
    Timestamp: "08/08/2018 02:00:00",
    Value: "0"
    },
    {
    Timestamp: "08/08/2018 03:00:00",
    Value: "0"
    },
    {
    Timestamp: "08/08/2018 04:00:00",
    Value: "0"
    },  
 ...
    
    {
    Timestamp: "15/08/2018 12:00:00",
    Value: "0"
    }
   ]
    

XML

https://www2.sepa.org.uk/rainfall/api/Hourly/115618?xml=true&all=true

    <?xml version="1.0" encoding="UTF-8"?>
    <ArrayOfHourlyResult xmlns="http://schemas.datacontract.org/2004/07/Rainfall.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
       <HourlyResult>
          <Timestamp>08/08/2018 00:00:00</Timestamp>
          <Value>0</Value>
       </HourlyResult>
       <HourlyResult>
          <Timestamp>08/08/2018 01:00:00</Timestamp>
          <Value>0</Value>
       </HourlyResult>
       <HourlyResult>
          <Timestamp>08/08/2018 02:00:00</Timestamp>
          <Value>0</Value>
       </HourlyResult>
       <HourlyResult>
          <Timestamp>08/08/2018 03:00:00</Timestamp>
          <Value>0</Value>
       </HourlyResult>
       <HourlyResult>
          <Timestamp>08/08/2018 04:00:00</Timestamp>
          <Value>0</Value>
       </HourlyResult>
       <HourlyResult>
          <Timestamp>08/08/2018 05:00:00</Timestamp>
          <Value>0</Value>
       </HourlyResult>
       .....
    </ArrayOfHourlyResult>

Daily Rainfall Totals

JSON

https://www2.sepa.org.uk/rainfall/api/Daily/115618?all=true

[
	{
	Timestamp: "15/08/2017 09:00:00",
	Value: "0.2"
	},
	{
	Timestamp: "16/08/2017 09:00:00",
	Value: "9.2"
	},
	{
	Timestamp: "17/08/2017 09:00:00",
	Value: "11.4"
	},
	{
	Timestamp: "18/08/2017 09:00:00",
	Value: "7.2"
	},
	{
	Timestamp: "19/08/2017 09:00:00",
	Value: "4.2"
	},
	
	...
	
	{
	Timestamp: "14/08/2018 09:00:00",
	Value: "4.6"
	}
]

XML

https://www2.sepa.org.uk/rainfall/api/Daily/115618?all=true

    <?xml version="1.0" encoding="UTF-8"?>
    <ArrayOfDailyResult xmlns="http://schemas.datacontract.org/2004/07/Rainfall.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
       <DailyResult>
          <Timestamp>15/08/2017 09:00:00</Timestamp>
          <Value>0.2</Value>
       </DailyResult>
    ...
       <DailyResult>
          <Timestamp>14/08/2018 09:00:00</Timestamp>
          <Value>4.6</Value>
       </DailyResult>
    </ArrayOfDailyResult>

Monthly Rainfall Totals

JSON

https://www2.sepa.org.uk/rainfall/api/Month/115618?year=y

[
    {
    Timestamp: "Aug 2017",
    Value: "111.2"
    },
    {
    Timestamp: "Sep 2017",
    Value: "133.8"
    },
    ....
    {
    Timestamp: "Aug 2018",
    Value: "35"
    }
]

XML

https://www2.sepa.org.uk/rainfall/api/Month/115304?xml=true&year=y

<?xml version="1.0" encoding="UTF-8"?>
    <ArrayOfHourlyResult xmlns="http://schemas.datacontract.org/2004/07/Rainfall.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
       <HourlyResult>
          <Timestamp>Aug 2017</Timestamp>
          <Value>411</Value>
       </HourlyResult>
         ... 
       <HourlyResult>
          <Timestamp>Jul 2018</Timestamp>
          <Value>238.6</Value>
       </HourlyResult>
       <HourlyResult>
          <Timestamp>Aug 2018</Timestamp>
          <Value>159.6</Value>
       </HourlyResult>
    </ArrayOfHourlyResult>