Skip to content

Archive: HowdTheyVote.ca transition guide

James McKinney edited this page Feb 1, 2017 · 1 revision

This is a draft transition guide for users of the HowdTheyVote.ca API, which shut down on September 1, 2012.

You can use Represent to replace your FindMember and FindRiding HowdTheyVote.ca API calls. We encourage you to read the Represent API documentation. We provide a quick transition guide below.

If you have any questions or issues, please contact us at [email protected] or send a message to our Google group.

FindMember

By postal code

A HowdTheyVote.ca postal code lookup looks like:

/api.php?call=findmember&key=APITESTKEY&house_id=1&postal_code=K1P5A5

In Represent, it would be:

http://represent.opennorth.ca/postcodes/K1P5A5/

The postal code must be uppercase without spaces. Have a look at a sample JSON response and read the API documentation on postal code lookups to interpret it. Note that you will get representatives for all levels of government for which we have data, not just the House of Commons. You can check which legislative body a representative belongs to by checking the value of representative_set_name for each representative.

By latitude and longitude

A point lookup looks like:

/api.php?call=findmember&key=APITESTKEY&house_id=1&latitude=49.2108&longitude=-123.0360

In Represent, it would be:

http://represent.opennorth.ca/representatives/house-of-commons/?point=49.2108,-123.0360

The point query string parameter takes a latitude and a longitude (in that order) separated by a comma. Please ensure that your coordinates use a period . as the decimal mark. Have a look at a sample JSON response. There's a lot more you can do with this API method. Read the documentation to find out more.

FindRiding

By postal code

A HowdTheyVote.ca postal code lookup looks like:

/api.php?call=findriding&key=APITESTKEY&house_id=1&postal_code=K1P5A5

In Represent, it would be:

http://represent.opennorth.ca/postcodes/K1P5A5/

The postal code must be uppercase without spaces. Have a look at a sample JSON response and read the API documentation on postal code lookups to interpret it. Note that you will get boundaries (ridings) from all levels of government for which we have data, not just the federal electoral districts. You can check which jurisdiction a boundary belongs to by checking the value of boundary_set_name for each boundary.

By latitude and longitude

A point lookup looks like:

/api.php?call=findriding&key=APITESTKEY&house_id=1&latitude=49.2108&longitude=-123.0360

In Represent, it would be:

http://represent.opennorth.ca/boundaries/federal-electoral-districts/?contains=49.2108,-123.0360

The contains query string parameter takes a latitude and a longitude (in that order) separated by a comma. Please ensure that your coordinates use a period . as the decimal mark. Have a look at a sample JSON response. There's a lot more you can do with this API method. Read the documentation to find out more.

Other Changes

Unlike HowdTheyVote.ca, Represent does not require an API key. Data is mostly language-independent; if not, we try to provide the data in the official language of the jurisdiction. The data format is JSON/JSONP. To turn on JSONP, just add a callback parameter to the query string. We do not currently provide XML, because there has been no demand for it. If you want or need XML, please contact us.

Code Samples

We are collecting code samples to help people use the API. So far we have: