DWBP API Documentation

API URL: http://data.mycity.example.com/transport/api/

List all bus routes

GET http://data.mycity.example.com/transport/api/bus/routes

Response

{
   "routes":[
      {"id":"1", "uri": "http://data.mycity.example.com/transport/bus/routes/1"},
      {"id":"3", "uri": "http://data.mycity.example.com/transport/bus/routes/3"},
      {"id":"5", "uri": "http://data.mycity.example.com/transport/bus/routes/5"},
      {"id":"8", "uri": "http://data.mycity.example.com/transport/bus/routes/8"},
      {"id":"10", "uri": "http://data.mycity.example.com/transport/bus/routes/10"},
      {"id":"12a", "uri": "http://data.mycity.example.com/transport/bus/routes/12"}
    ]
}

List all bus stops

GET http://data.mycity.example.com/transport/api/bus/stops

Response using fields defined in dwbp-example.html

{
  
    "stops":[
      {"stop_id":"345",
      "stop_name": "Castle Avenue, Sunset Drive",
      "stop_desc": "Castle Avenue, Sunset Drive",
      "stop_lat": "-3.731862",
      "stop_long": "-38.526670",
      "zone_id": "x20",
      "stop_url": "http://data.mycity.example.com/transport/bus/stops/345"
      },
      {"stop_id":"483",
      "stop_name": "Main Street, Lily Park",
      "stop_desc": "Main Street, Lily Park",
      "stop_lat": "-3.731541",
      "stop_long": "-38.535157",
      "zone_id": "x20",
      "stop_url": "http://data.mycity.example.com/transport/bus/stops/483"
      },
      {"stop_id":"541",
      "stop_name": "West Avenue, Beech Road",
      "stop_desc": "West Avenue, Beech Road",
      "stop_lat":"-3.734957"
      "stop_long":"-38.514354",
      "zone_id": "x22",
      "stop_url": "http://data.mycity.example.com/transport/bus/stops/541"
      }
    ]
  }
}

List all bus stops along a single route

GET http://data.mycity.example.com/transport/api/bus/stops/routes/{id}

Response

{
  <"results": {"route": "http://data.mycity.example.com/transport/bus/stops/routes/5",
    "stops":[
      {"stop_id":"345",
      "stop_name": "Castle Avenue, Sunset Drive",
      "stop_desc": "Castle Avenue, Sunset Drive",
      "stop_lat": "-3.731862",
      "stop_long": "-38.526670",
      "zone_id": "x20",
      "stop_url": "http://data.mycity.example.com/transport/bus/stops/345"
      },
      {"stop_id":"483",
      "stop_name": "Main Street, Lily Park",
      "stop_desc": "Main Street, Lily Park",
      "stop_lat": "-3.731541",
      "stop_long": "-38.535157",
      "zone_id": "x20",
      "stop_url": "http://data.mycity.example.com/transport/bus/stops/483"
      },
      {"stop_id":"541",
      "stop_name": "West Avenue, Beech Road",
      "stop_desc": "West Avenue, Beech Road",
      "stop_lat":"-3.734957"
      "stop_long":"-38.514354",
      "zone_id": "x22",
      "stop_url": "http://data.mycity.example.com/transport/bus/stops/541"
      }
    ]
  }
}

Get real-time info for bus stop

GET http://data.mycity.example.com/transport/api/bus/stops/realtime/{stopid}

Example

http://data.mycity.example.com/transport/api/bus/stops/realtime/345

Response

{
  "results": {"id":"345",
    "uri":"http://data.mycity.example.com/transport/bus/stops/345",
    "timestamp":"2016-05-03T13:54:16Z",
    "realtime":[
      {"route": "http://data.mycity.example.com/transport/bus/stops/routes/5",
      "duetime":"2016-05-03T14:00Z"
      },
      {"route": "http://data.mycity.example.com/transport/bus/stops/routes/8",
      "duetime":"2016-05-03T14:03Z"
      },
      {"route": "http://data.mycity.example.com/transport/bus/stops/routes/12",
      "duetime":"2016-05-03T14:05Z"
      },
      {"route": "http://data.mycity.example.com/transport/bus/stops/routes/9",
      "duetime":"2016-05-03T14:06Z"
      }
    ]
  }
}