APIprovides access to the structured data underlying this site. It requires a certain level of technical knowledge to use it, but if you've got the know-how, you can use it to quickly build your own tools using Parliamentary data.
URL structures mirror that of the main site, but on the
api.openparliament.ca domain. Most pages will have a JSON link in the footer leading to the equivalent API content.
Everything is JSON. But, when you access the page in your browser (or, specifically, with a client whose
Accept header indicates a preference for
application/json), you'll get a friendly formatted page instead. Here, take a look.
There’s a rate limit. Make more than 30 requests in a minute, and you may get
HTTP 429 Too Many Requests. Get in touch if this is a problem for you.
Things change. At the moment, there are no promises of backwards compatibility. If you’re using this, you should sign up for a low-traffic mailing list where I’ll post about any breaking changes.
Don’t be shy. The API doesn’t currently enforce this, but you should put your email in
User-Agent headers—that way I can look at how people are using the API, and contact you if your requests are causing problems. And please get in touch with comments and questions.
This kind of API is not especially suited to downloading lots of data at once. For that, download a copy of this site's database.
To find ridings or MPs based on addresses or postal codes, use Represent.
parl.gc.ca has, in recent years, started to include lots of XML data—that's the original source for 90% of the data on this site. Hansard and LegisINFO pages will have little orange XML buttons on them.
ParliamentData.ca is an under-construction independently-built API much like this one.
This site holds no copyright on any data accessible through this API. But providing attribution via a link back to openparliament.ca would be awfully nice of you.