API gateway
The department continually collects and generates extensive amounts of near real-time data related to weather and other conditions that can impact agricultural farming systems.
The department's Application Programming Interface (API) gateway is a free service for producers and industry. It allows registered users to securely access data from 3 of our APIs: Weather, Radar and Science.
Data retrieved from the APIs can be embedded into other applications, to enrich a user’s own data and provide insights based on historical and current conditions.
To start using an API:
- Review and agree to the terms and conditions
- Complete the registration form
Once approved and registered, an API key will be issued to allow API access.
Access open data using the department's APIs
Read more about the APIs and data available below:
The Weather API provides data from the department's state-wide network of almost 300 automatic weather stations and radars.
Every minute, each weather station collects data, which is uploaded to a central database around every six minutes. Averages, totals, minimum and maximum values are calculated and summarised into hourly, daily, monthly and yearly data.
Weather data includes air temperature, humidity, rainfall, wind speed and direction and solar radiation (to calculate evaporation and evapotranspiration).
Weather data tables and dynamic weather charts visit are available via the Weather website.
The Radar API provides:
- rainfall data from the department radars located in Geraldton, Albany, Esperance, Newdegate, Kalgoorlie, South Doodlakine, Perth (Serpentine) and Watheroo.
- daily, monthly and yearly rainfall summaries are available for the closest radar, given specific GPS coordinates.
- rainfall (since 9am, current-hour, month-to-date and year-to-date).
The Science API provides data from the:
API specifications
Weather API
Radar API
Science API
Getting started
- Ensure you have read and understood the terms and conditions for using the department's APIs.
- Complete the registration form to receive your API key.
- Once you have an API key, you can access the API service from any platform or technology you are using.
API key
To use your registered API key the department server will check for a custom HTTP header called 'api-key'.
HTTP headers are used to send requests and receive responses. They carry information about the client browser, requested page, server and other details.
A custom header allows access to all publicly available APIs (if the API key is valid).
The instruction ‘api-key’ can be added to the URL as an extra parameter if pasting the address into your internet browser. For example:
https://api.agric.wa.gov.au/v1/weatherstations/dailysummary.json&api_key=<your api key here>
API key testing
A test harness is provided for each API, to easily test endpoints, parameters and ensure returned data fits your needs. It also allows identification of any issues and the opportunity to fix them prior to integrating the API into your application.
- To run a simple test, you can use a simple command line utility called 'cURL'. On Linux, cURL comes pre-installed.
- For Windows users, download and install it from
http://curl.haxx.se/
- Start the test by typing the following command line:
curl -X GET -k -H "api-key:yourkeyhere" https://api.agric.wa.gov.au/v1/weatherstations.json
API technical issues and feedback
If you are experiencing any technical issues related to the APIs, or would like to provide feedback, email EconnectedGrainBelt@dpird.wa.gov.au
Contact us
-
eConnect+ team