-
Notifications
You must be signed in to change notification settings - Fork 9
Archive: HowdTheyVote.ca transition guide
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.
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.
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.
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.
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.
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.
We are collecting code samples to help people use the API. So far we have: