Recollect API

This page describes the APIs that you can use to get data from Recollect.

This is a working API under development, one subject to evolution and change. If you would like to depend on certain parts of the API, you should contact @lukec and let him know.

List of Areas

Each city or district constitutes an Area in Recollect.
You can fetch the list of available areas with the /api/areas API call.

Area Data

You can fetch data for each area using the /api/areas/:area_name API call.
:area_name can be either the area id or the text name of the Area.

This data is also available as text/plain, application/json and KML (application/xml).

List of Zones

Each Area will have one or more geographic pickup zones. Each Zone will have it's own set of pickup times.
You can fetch the list of zones for an area with the /api/areas/:area_name/zones API call.

Zone Data

Each zone has its own resource page.
You can fetch the details for a zone with the /api/areas/:area_name/zones/:zone_name API.

This data is also available as text/plain , application/json and KML - application/xml.

Each zone has several pieces of data available:

This data is also has text and JSON representations:

Dates are expressed as YYYY-MM-DD[ F]. Each pickup has a set of flags associated with it. The flags indicate what kind of pickup will happen. The flags are represented as a string of characters, each character is one of the flags specified here:

  • G - Garbage will be picked up.
  • R - Recycling will be picked up.
  • Y - Yard compost will be picked up.

The nextpickup request accepts a limit GET parameter to show the next several pickups.
(eg: /api/areas/Vancouver/zones/vancouver-north-blue/nextpickup.txt?limit=5).

Zone Lookups

You can look up a zone either by lat,long or by zone name. These APIs will return a 302 redirect if a zone was found, or a 404 otherwise.

  • /api/lookup/:lat,:long
  • /api/lookup/:zone-name

These APIs can also be appended with a file extension (.json, say) which will be appended to the redirect URL.

API Version

The API has a simple version number resource at /api/version.

This API version will only be updated when incompatible changes need to happen. All other incremental changes will happen without changing this number.

Webhooks

If you would like to receive garbage day notifications via a HTTP POST, webhooks are a available as a supported notification mechanism. If you create a subscription with a target of "webhook:http://example.com", Recollect will send a HTTP POST to this URL with a JSON payload containing details about the notification. If you want to use this please tweet @lukec for help.