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.assembly.opennwt.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.
It’s hypertext. Most resources link to related resources. Start with bills, votes, MLAs, debates, or committees, and you should be able to find your way to what you're looking for. Resources are identified by their URLs, which are of course guaranteed to be unique; if you need a field to use as a primary key for objects, I suggest the URL or a fragment of it. When filtering based on a relationship with another object, you use the URL, like so.
Many resources can be filtered. The list of available filters appears on each resource’s friendly API page. You can use simple operators for most numeric and date fields: gt (greater than), gte (greater than or equal), lt (less than), lte (can you guess?). Here's an example.
There’s a rate limit. If you make tons of concurrent requests, you'll get
HTTP 429 Too Many Requests. Get in touch if this is a problem for you.
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 please contact me at the link below and I can setup you up with a copy of the database.
The Legislative Assembly is the original source for most of the data on this site so take a look at their website as well.
Most of the content on this site comes from the Legislative Assembly, and so is copyright of the Speaker (which I suppose actually means Queen Elizabeth). The rest of the information is publicly available (things like Cabinet appointments or elections results that we've dug up). We've strived to make sure the data is accurate and complette, so if you notice any problems please let us know!
This site holds no copyright on any data accessible through this API. But please do provide some attribution via a link back to opennwt.ca (and in turn, the code base for this site started out as the fantastic openparliament.ca.
Help us improve OpenNWT
Please only include contact information if you would like to hear back.