API guide


The SILO Web Application Programming Interface (API) allows you to query point datasets, as well as a range of metadata, in real time.

Accessing the API

The SILO API has the following base URL:

https://siloapi.longpaddock.qld.gov.au

For example, a request for point data might look like:


https://siloapi.longpaddock.qld.gov.au/pointdata?apikey={YOUR_API_KEY}&start=20160101&finish=20160131&station=40004&format=json&variables=max_temp,min_temp
    

For detailed information about request parameters please consult the reference.

API requests must use HTTPS. A 400 Bad Response will be returned for HTTP requests.

Available data

The following data are available through the SILO API:

  • Point data (an API request provides data for a single location)

The following metadata are available:

Identification

Data requests must be identified with an API key. This allows us to track download volumes. If an API key is not provided for a point data request, a 400 Bad Response will be returned. To obtain an API key, follow these steps:

  1. Log in to SILO then hover over the icon in the navigation bar and select My API keys.
  2. Click the New API key button. Choose a name which will help you remember what you're using the key for. You can have up to 4 API keys.
  3. Your API key is now available for use. Remember to keep it safe.

Requests for metadata do not require an API key.

Download limits

Requests for point data are subject to a download limit of 6GB per month. The download volume is calculated by summing the size of all requests made during the month, and reset on the first day of the month. API keys are used to associate usage with a SILO account. Note that requests submitted and downloaded through the web interface count towards this limit.

This limit is subject to change. We recommend you cache data to reduce download volumes. If you require a larger download quota, please contact us.

Output formats

Point data are available in CSV and JSON, as well as a number of predefined formats, all of which are returned as plain ASCII text.

Metadata are available in CSV and JSON (the default) formats.

You can specify your desired format using the format query parameter, which is required for point data requests and optional for metadata requests. For example:

https://siloapi.longpaddock.qld.gov.au/variables?format=csv

Requests

API requests are standard HTTP calls. The SILO API allows for retrieval of data only, so the API only supports HTTP GET methods. It's possible to use the API simply by typing the URL into your browser. The API can also be queried by a program. Here is a simple example in Python:


import requests

r = requests.get('https://siloapi.longpaddock.qld.gov.au/variables')
data = r.json()
    

The API can also be queried by command line tools. Here is a simple example using curl:


curl https://siloapi.longpaddock.qld.gov.au/variables

# NOTE: you may need to set proxy environment variables to pass through your local firewall
    

Responses

The SILO API uses standard HTTP status codes to indicate the success or failure of requests. The API uses the following status codes:

Status Code Message Meaning Response Body
200 OK Success JSON/CSV/text
400 Bad Request You've made an error in your request JSON
403 Forbidden You've exceeded your download limit for the current cycle JSON
500 Server Error An internal error occurred. If this problem persists, please contact us JSON
503 Service Unavailable The SILO API is down for maintenance

The format of the response body for a successful request is determined by the format query parameter. Responses are encoded as UTF-8.

Note: fields in JSON objects are unordered and may be returned in any order.

Errors

If a request is unsuccessful, the response will contain a JSON body with title and description fields, similar to this:


{
    "title": "Missing parameter",
    "description": "The \"start\" parameter is required."
}