The base URL of all endpoints is
http://represent.opennorth.ca. All endpoints output JSON.
Results are paginated 20 per page by default. Set the number of results per page by adding a
limit query parameter. Change pages using the
offset query parameter or using the
previous links under the
meta field in the response to navigate to the next and previous pages (if any). Under the
total_count is the number of results.
Filter results with query parameters. Each endpoint below lists the fields on which you can filter results. To filter for representatives whose first name is “Rodney”, for example, request
Perform substring searches by appending
__querytype to the parameter name, where
querytype is one of
isnull. A leading
i makes the match case-insensitive. For example, to find representatives whose last name starts with “M” or “m”, request
To download all representatives, send a request to http://represent.opennorth.ca/representatives/?limit=1000 and follow the
next link under the
meta field until you reach the end. We host the shapefiles and postal code concordances on GitHub.
Represent is free up to 60 requests per minute (86,400 queries/day). If you need to make more queries, contact us; otherwise, you may get HTTP 503 errors.
For a browsable, HTML version of the JSON response, add a
format=apibrowser query parameter. Add
pretty=1 to just indent the raw JSON.
We support JSONP for client-side cross-domain requests – just add a
callback query parameter.
Find representatives and boundaries by postal code.
To see what boundary sets and representative sets are available, consult the boundary sets and representative sets endpoints. Are we missing information that you need? Contact us so that we can make it a priority.
URLs must include the postal code in uppercase letters with no spaces.
boundaries_centroid field lists boundaries that contain the postal code’s center point (centroid). A centroid is a point, but a postal code can be a line or polygon, so the list of boundaries in
boundaries_centroid will sometimes be inaccurate.
boundaries_concordance field lists boundaries linked to the postal code according to official government data. Postal codes can cross boundaries, therefore
boundaries_concordance may list many Ontario provincial districts for a postal code like K0A 1K0.
representatives_concordance fields behave similarly.
If you are searching for a specific boundary or representative, you must check both the centroid and concordance fields.
In most cases, the
centroid fields will be non-empty.
A boundary set is a group of electoral districts, like BC provincial districts or Toronto wards.
Do we not have a set of boundaries that you need? Contact us so that we can make it a priority.
external_id field (not always present) is the boundary's machine identifier. The
metadata field contains all attributes from the source shapefile; it is unmodified and may be out-of-date or erroneous.
We recommend the
simple_shape endpoint, which simplifies the shape to a tolerance of 0.002, looks fine and loads fast. The default geospatial output format is GeoJSON. Add a
format=wkt query parameter to get KML or Well-Known Text.
A representative set is a group of elected officials, like the House of Commons or Toronto City Council.
Do we not have a set of representatives that you need? Contact us so that we can make it a priority.
Only the bold fields are present in all responses:
|elected_office||MP, MLA, Mayor, Councillor, Alderman|
|source_url||The URL at which the data is scraped||May be the same as
|url||http://legislature.ca/stephen-harper||The representative’s page on the official legislature site|
|personal_url||http://stephenharper.blogspot.com/||A site run by the representative that’s not on the official legislature site|
|district_id||24013||If there’s an identifier besides the district name|
||A list of objects with contact information for the representative’s offices. The keys are:
||Any extra data|
This endpoint behaves like the /representatives/ endpoint. See its documentation for more examples.
Candidate lists may be incomplete or incorrect, as this information changes frequently.
If you would like to add candidates to Represent, contact us.