ParliamentData.ca API Documentation

Introduction

About

To assist with the development of tools and applications that use the Canadian Government’s datasets, ParliamentData.ca aims to bridge the gap between the existing convoluted document structure of the existing parl.gc.ca website.

During development or testing of your application / web-tool, I strongly recommend using either the
Chrome or Firefox plugin JSONView .

Structure

Similar to REST protocol, the API structure is as follows:

http://api.parliamentdata.ca/dataset [ /identifier [, identifier [, … ] ] /collection ]

All requests return a JSON string of the resulting query that includes a _meta object and a results array.

To Do

There are still quite a lot of things to do within the API. However, pulling the raw data for the most part is fully functional for the existing datasets.

I am taking requests for features and items that would be good to add so if you do have something that you would like to see, please don’t hesitate in contacting me .

Items planned to implement in no particular order:

  • Add “Publications” datasource
  • Add “Meetings” datasource
  • Allow for manipulation and limiting of data during call:
    • Sorting
    • Limiting
    • Pagination
  • Add the “rolls” array items to the representative details
  • Clean up some of the objects
    • Standardize geographical locations
    • Remove redundant items
  • Add ability to capture individual items of committees rather than always showing everything

Datasets

Bills

Description

Federal bill data pulled directly from the XML files available through LEGISinfo and then extended upon through each of their respective detail pages. Note that due to the website not displaying bills before legislation that have a status of entering the House of Commons, bills may appear within the API prior to displaying within the government’s LEGISinfo site.


Details

id (integer)
Unique numeral identifier provided by the government’s website. This is recommended as the primary identifier for transactions and request for data identifiers for the API.
last_update (string)
The UTC string of the last time the bill had been updated on the government’s website.
prefix (string: “C” or “S”)
Signifying whether the bill originated from the House of Commons or the Senate. This can be paired with the bill number (not to be confused with the bill id) as an identifier during API requests.
number (integer)
The assigned number for the current parliament session. This should not be confused with the bill ID due to this being reset during every sitting of the parliament.
introduction (integer)
UNIX timestamp of the date in which the bill was introduced to parliament.
sponsor (integer)
The id of the sponsor representative that submitted the bill for consideration
title (object)
EN (string)
English title of the bill
FR (string)
French title of the bill
type (integer)
The type of bill :
  • 1 House bill
  • 2 Senate bill
  • 3 Senate public bill
  • 4 Senate private bill
  • 5 Private member’s bill
language (string: “EN” or “FR”)
The language in which the bill was submitted by the sponsor.
party (null)
To be removed
statute (object)
To be removed
status (integer)
Integer of the current stage of the bill :
  • 0 Bill defeated / not proceeded with
  • 1 Pre-study of the commons bill
  • 2 Introduction and first reading
  • 3 Second Reading and/or debate at second reading
  • 4 Referral to committee
  • 5 Committee report presented / debate at condisteration of committee report
  • 6 Debate at report stage
  • 7 Concurrence at report stage
  • 8 Committee report adopted, 3rd reading and/or debate at 3rd reading
  • 9 Placed in order of precedence / message sent to the House of Commons
  • 10 Jointly seconded by or concurrence in the Senate amendments
  • 20 Royal assent / completed
party_pr_links (array)
Object of per caucus press releases
id (integer)
The id of the caucus
name (object)
Link to the official French legislative summary page
EN (string)
English name of the caucus
FR (string)
French name of the caucus
links (object)
Links broken down into their respective languages
EN (array)
name (string)
Name of the link
link (string)
URI string
FR (array)
name (string)
Name of the link
link (string)
URI string
publications (array)
Object of per caucus press releases
id (integer)
The id of the publication
type (integer)
The type of the publication
  • 1 First Reading
  • 2 As amended by committee
  • 3 As passed by the House of Commons
  • 4 As passed by the Senate
  • 5 Royal Assent
recommendation (object or null)
EN (string)
English language recommendation of the publication
FR (string)
French language recommendation of the publication
summary (object or null)
EN (string)
English language summary of the publication
FR (string)
French language summary of the publication
legislative_summary (object)
EN (string)
Link to the official English legislative summary page
FR (string)
Link to the official French legislative summary page
related_links (object)
EN (string)
name (string)
Name of the link
link (string)
URI string
FR (string)
name (string)
Name of the link
link (string)
URI string
divisions (array)
A collection of the House of Commons’ and Senate divisions (votes)
hoc (array)
The House of Commons division list
parliament (integer)
The parliament when the division took place
session (integer)
The session when the division took place
division_number (integer)
The parliament session division number, note that a combination of all 3 values are required when searching through the government’s website
yeas (integer)
Number of representatives that are for the motion expressed
nays (integer)
Number of representatives that are against the motion expressed
pairs (integer)
Number of representatives that have joined their decision to another representative of the opposite type thereby cancelling out the vote
votes (array)
The vote details
id (integer)
Identifier of the representative of the vote
caucus (integer)
Identifier of the caucus of the voting representative
decision (integer)
The value of the vote
  • 1 Yea
  • -1 Nay
sen (array)

The Senate debate list

debate_link (string)
URI of the debate content
debate_id (string)
Unique identifier for the debate
last_modified (integer)
To be removed
short_title (object)
Not all bills have this value however some may have a smaller version of the title available to use.
EN (string)
English title of the bill
FR (string)
French title of the bill
events (object)
Changes to the bill
id (integer)
Event unique identifier
date (integer)
Date and time that the event occurred
meeting (integer)
Unique identifier of the meeting where the event occurred
chamber (integer)
Unique identifier of the chamber where the event occurred
status (integer)
Status of the bill change (the latest event status is used to determine the bill status) stage of the bill
description (object)
Coming soon…
recommendation (object or null)
EN (string)
English language recommendation of the bill
FR (string)
French language recommendation of the bill
summary (object or null)
EN (string)
English language summary of the bill
FR (string)
French language summary of the bill

List Bills

http://api.parliamentdata.ca/bills

Return a results array of all available bills with their basic information:

  • id
  • last_updated
  • prefix
  • number
  • introduction
  • sponsor
  • title
  • type
  • language
  • status
  • legislative_summary
  • last_modified
  • short_title
  • events

Individual Bill(s) Details

Basic bill details
http://api.parliamentdata.ca/bills/id
http://api.parliamentdata.ca/bills/[prefix + number]
Multiple bill details
Bill id: http://api.parliamentdata.ca/bills/id1,id2,…
Prefix & number: http://api.parliamentdata.ca/bills/[prefix1 + number1],[prefix2 + number2],…
Combination: http://api.parliamentdata.ca/bills/id1,[prefix2 + number2],…

Examples

Select the basic details of a bill:

http://api.parliamentdata.ca/bills/C1

Results:

								
Select elements of several bills:

http://api.parliamentdata.ca/bills/C1,S15/title.EN,short_title.EN

Results:

								
Select all of the details of a bill:

http://api.parliamentdata.ca/bills/5079843/all

Results:

								

Representatives

Description

Federal representative data comes from several locations on the government’s website. Unfortunately, there is no absolute pure datasource for capturing the majority of the information so it requires parsing from several areas. Please take note that this information is not parsed as frequently as the bills as the changes to representatives are not common.

Details

id (integer)
Unique numeral identifier provided by the government’s website. Note that ParliamentData.ca attempts to normalize this number to the most common one used however there are cases where there are multiple numeric identifiers for a given representative.
item_id (string)
Unique string identifier provided by the government’s website. This long-string value is also used for various areas of the government’s website including areas of historical record for a given representative
name (object)
family (string)
Commonly referred to as a last name
given (string)
The first name of a representative and their respective middle name(s)
honourable (integer)
Whether the representative holds the honourable or right-honourable title
  • 0 N/A
  • 1 Honourable
  • 2 Right-Honourable
suffixes (array)
A list of distinctions and titles that the represenative has.
image_id (string)
Used as the Item value with the following URI to capture the image for the representative:
http://www.parl.gc.ca/Parlinfo/images/Picture.aspx?Item=
offices (array)
phone (string)
Phone number of the location
fax (string)
Fax number of the location
postal_code (string)
Mailing postal code of the location
province (string)
Full name of the province
city (string)
Full name of the city
lines (array)
The lines of the mailing address, this is common for street addresses and potential multiple address lines
constituencies (array)
See constituency for structure of array items
rolls (array)
N/A
committees (array)
id (string)
Government provided identifier for the committee, commonly a 4 character string that uses characters found within the English name
member_type (integer)
The member type the representative holds within the committee:
  • 1 Chair
  • 2 Co-Chair
  • 3 Vice-Chair
  • 4 Member
  • 5 Associate Member
name (object)
EN (string)
English name of the caucus
FR (string)
French name of the caucus
start (integer)
UNIX timestamp of the date the representative join the committee
end (integer)
UNIX timestamp of the date the representative left the committee
professions (array)
String labels to professions held by the representative
birthplace (object)
city (string)
Name of the city
prov (string)
Full name of the province
country (string)
Full name of the country
birthdate (int)
UNIX timestamp of the date the representative was born
links (object)
MP Profile (string)
Parliamentarian’s profile page on the government’s website
Party Website (string)
Caucus’ Website
Personal Website (string)
Representative’s personal website
constituency (object)
Details on the constituency the representative is responsible for
id (integer)
Unique identifier of the constituency
name (object)
EN (string)
English name of the constituency
FR (string)
French name of the constituency
elections_id (integer)
Unique identifier of the election where the representative was elected office
province (object)
code (string)
2 character province code
name (object)
EN (string)
English name of the constituency
FR (string)
French name of the constituency
caucus (object)
Details on the party that the representative is a member of
id (integer)
Unique identifier of the caucus provided by the government’s website
name (object)
EN (string)
English name of the caucus
FR (string)
French name of the caucus
item_id (string)
Unique string identifier provided by the government’s website. This long-string value is also used for various areas of the government’s website including areas of historical record for a given caucus
date_elected (integer)
The UNIX timestamp of the date when the representative was elected

List Representative(s)

http://api.parliamentdata.ca/representatives

Return a results array of all available representatives with their basic information:

  • id
  • item_id
  • name
  • image_id
  • links
  • constituency

Individual Representative(s) Details

Basic representative details
http://api.pariamentdata.ca/representatives/id
Multiple representative details
http://api.pariamentdata.ca/representatives/id1,id2,…

Examples

Select the basic details of a representative:

http://api.parliamentdata.ca/representatives/78553

Results:

							
Select specific elements of a representative:

http://api.parliamentdata.ca/representatives/78553/name.given,name.family

Results:

							
Select all the details of a representative:

http://api.parliamentdata.ca/representatives/78553/all

Results:
[Sample too large to display inline effectively]

Committees

Description

Because of the process in which bills pass through the parliament, committees was taken priority as the third element to be implemented.

Committees are generally the group of people that make the decisions and recommendations to the remaining representatives. Often is the case, that when bills are submitted, contacting the sponsor representative accomplishes nothing as it is out of their hands. Contacting members of the committee that is responsible for the bill at a given stage will have far more of an effect.

Details

Coming Soon…

List Committees

http://api.parliamentdata.ca/committees

Return a results array of all available committees with their basic information:

  • id
  • name
  • session
  • parliament
  • mandate
  • history
  • meetings
  • studies
  • reports
  • chair
  • vice_chairs
  • members
  • clerk
  • publications

Individual Committee(s) Details

Coming Soon…

Examples

Select the basic details of a committee:

http://api.parliamentdata.ca/committees/AGRI

Results:
[Sample too large to display inline effectively]