Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rusq/aklapi

Repository files navigation

Auckland Council API (unofficial)

Full list of available endpoints, for detailed description see below.

Name Endpoint Parameters Comments
Address /api/v1/addr addr: partial address Address Query
Rubbish and Recycling short /api/v1/rr addr: partial address Rubbish and Recycling, short format
Rubbish and Recycling /api/v1/rrext addr: partial address Rubbish and Recycling
Healthcheck /healthcheck Returns OK if alive

Address search

  • /api/v1/addr, parameter: addr -

Rubbish and Recycling

Two endpoints so far, both accepting addr parameter.

  • /api/v1/rr - rubbish and recycling, returns the JSON of the following format:

    {
     "rubbish": "2020-02-25",
     "recycle": "2020-02-25",
     "address": "Britomart, CBD"
    }
    
  • /api/v1/rrext - extended rubbish and recycling. Returns the JSON in the following format:

    {
     "Collections": [
     {
     "Day": "Monday 24 January",
     "Date": "2020-01-24T00:00:00+13:00",
     "Rubbish": true,
     "Recycle": true
     },
     {
     "Day": "Monday 31 January",
     "Date": "2020-01-31T00:00:00+13:00",
     "Rubbish": true,
     "Recycle": false
     }
     ],
     "Address": {
     "ID": "12342478585",
     "Address": "500 Queen Street, Auckland Central"
     }
    }
    

Example:

$ curl --location --request GET 'https://<server>/api/v1/rr?addr=500%20Queen%20Street'
{"rubbish":"2020年02月24日","recycle":"2020年02月24日","address":"500 Queen Street, Auckland Central"}

Integrating with Home Assistant

Assuming your aklapi API server running on localhost:5010, add the following to your configuration.yaml:

rest:
 - resource: http://localhost:5010/api/v1/rr?addr=xx
 method: GET
 scan_interval: 300
 sensor:
 - name: Recycle
 value_template: "{{ value_json.recycle }}"
 device_class: date
 unique_id: recycle_date
 - name: Food Scraps
 value_template: "{{ value_json.foodscraps }}"
 device_class: date
 unique_id: foodscraps_date
 - name: Rubbish
 value_template: "{{ value_json.rubbish }}"
 device_class: date
 unique_id: rubbish_date

Packages

No packages published

Contributors 4

Languages

AltStyle によって変換されたページ (->オリジナル) /