API

Overview

Services

API Overview

Winnipeg Transit's Open Data Web Service provides a way for you to retrieve live information about Winnipeg Transit's services by sending GET requests to URLs like: http://api.winnipegtransit.com/web-service-path?and=parameters

Data is returned in the ubiquitous XML format, and is subject to change throughout the day. This is because it represents a real-time picture of what is currently happening on the streets, with information about our city-wide service status, which individual buses are delayed and by how much, the estimated arrival times of buses at stops, and more.

Look here for an example of how to use this API.

Static Schedule Data

All of our static schedule data (as opposed to the real-time data provided by our Open Data Web Services) is also available for download in a single file. This file is updated daily and adheres to the General Transit Feed Specification.

API Key

Once you've signed up for an account, you will be given an API key. This key must be included in all requests you make, like so: http://api.winnipegtransit.com/stops/10064?api-key=your-api-key

Request Throttling

Winnipeg Transit's Open Data Web Service throttles requests to prevent its servers from being overloaded. Each API key is allowed 100 requests per IP address per minute.

URL Types

A Web service's requests are typically organized into three different types: identity, filter, and wildcards. These generally define the type of response you'll get.

Sample URLs are shown in the API documentation for each available Web service if you are logged in. Clicking the "Show results" link next to each sample URL will display the results in your browser using your API key — so results are best viewed in a browser which shows formatted XML, like Firefox. Alternatively, copy the link and use it in whatever tool you choose.
Examples of invalid URLs are displayed in red italics.

Identity Queries

Identity queries return a single result. They're typically accessed by specifying the ID of the desired resource.

eg. http://api.winnipegtransit.com/stops/10064

Filter Queries

Filter queries are so named because the results returned are filtered according to specified URL parameters. You can, for example, filter stop results according to a coordinate point and radius — only stops which fall within that radius will be returned.

eg. http://api.winnipegtransit.com/stops?x=633861&y=5525798&radius=100

Wildcard Queries

Wildcard queries are queries which do their best to match whatever string you provide. They're useful for doing things like quickly looking up resources based on a name. Like filter queries, wildcard queries potentially return multiple results.

eg. http://api.winnipegtransit.com/stops:glas

Common URL Parameters

These URL parameters are common to all services and all URL types:

usage The style of names to return.
  • long: Yields more verbose names.
  • short: Yields terser names.

JSON

You can retrieve JSON results for any web service by adding ".json" to the end of the path (before the URL parameters).

eg.