Skip to main content Skip to navigation

Farm data - Application Programming Interface

The department's Application Programming Interface (API) gateway is a free service for producers and industry to access current data related to weather and other conditions that impact on agricultural farming.

Blue sky with dark stormy clouds moving in over bushland

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: 

  1. Review and agree to the terms and conditions 
  2. 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:

API specifications

Weather API

Radar API

Science API

Getting started

  1. Ensure you have read and understood the terms and conditions for using the department's APIs.
  2. Complete the registration form to receive your API key.
  3. 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.

  1. To run a simple test, you can use a simple command line utility called 'cURL'. On Linux, cURL comes pre-installed.
  2. For Windows users, download and install it from
    http://curl.haxx.se/
  3. 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