Add a widget to your own website by adding the following snippet.

  This plug-in requires Bootstrap 3.0 and jQuery 1.9 and above.
You can ignore this if your site already contains Bootstrap -->

<script type="text/javascript" src=""></script>
<link rel="stylesheet" href=''></link>
<script type="text/javascript" src=""></script>

<!--Script for rendering the modal pop up and its styles. Please include these links in your page.-->
<link rel="stylesheet" href=''></link>
<script type="text/javascript" src=""></script>

<!--The actual HTML content to be integrated to the website.
You can customize the width/height or styles, but do not remove any classes starting with 'vote-ca'.
These classes have events attached to them. Also make sure that you have never used these classes anywhere
in your site.
Click-event on 'vote-ca-widget-button' class attaches the modal pop to the body tag of your page.

<div class="vote-ca-widget-container-wrapper">
<div class="vote-ca-widget-logo-area">
<img src="" />
<div class="vote-ca-widget-button-container">
<div class="vote-ca-widget-button"><text>Find where to vote</text></div>

districts api

This freely-available API tells you which political districts contain a given point in Canada.

Quick Summary


        "source_id": "24047", 
        "uptodate": [2010, 9, 24], 
        "name": "Outremont", 
        "electoral_group": {
            "province": "", 
            "name": "Canada", 
            "level": "Federal"
        "source_id": "62", 
        "uptodate": [2010, 9, 24],
        "name": "Mercier", 
        "electoral_group": {
            "province": "QC", 
            "name": "Québec", 
            "level": "Provincial"

Rate Limits

Calls are rate-limited by IP; at the moment, you get roughly 10 requests per minute. If you exceed your rate limit, the API will return HTTP status code 503. If your needs exceed this limit, please get in touch.

Future Changes

This is a new API, and it will change. (In particular, there is currently no concept of changing district boundaries. That'll need to be added relatively soon.) While we'll certainly aim to maintain backwards compatibility, there's not yet any promise of API stability. And, while current functionality will remain free, the API may at some point require authentication. That's why, if you use this API, you should sign up below for a (very low-traffic, announcement-only) mailing list:

join our mailing list


The base URL for the API is . "beta" is the current API version number.

Calls return JSON by default. Adding format=xml to the query string will return XML instead, though it's a (kinda ugly) XML serialization of a data structure designed for JSON. JSONP is supported via a callback= parameter.

Currently a single call is available, districts. It takes two required GET parameters, lat and lng. These are the latitude and longitude (in the WGS84 spatial reference system, which is what pretty much any geocoder will return to you) of a point in Canada. Sample URL:

The return value is an array of district results. Each district result is a hash with the following keys:

nameThe name of the district, e.g. Toronto Centre.
source_idAn ID string used for the district in the original data file the district shape was loaded from. For federal ridings, this is the standard Electoral District ID.
uptodateThe date on which this district was loaded or verified as current. Represented as an array of [year, month, day].
electoral_groupThe set of political districts this district belongs to—e.g. Quebec Assemblée Nationale districts or Toronto city wards. Represented as a hash with three keys:
  • name — e.g. Québec or Toronto
  • province — as two-letter postal abbreviation, e.g. QC or ON. Note that for federal ridings this value will be empty, because the set of federal ridings includes all provinces.
  • levelFederal, Provincial, or Municipal

When no districts are found for a given point—this should only happen for points outside Canada—the response will be an empty array, but will still be delivered with HTTP status code 200.


At the moment, the API is aware of the following groups of districts:

  • Banff—Airdrie (Federal)
  • Battle River—Crowfoot (Federal)
  • Bow River (Federal)
  • Calgary Centre (Federal)
  • Calgary Confederation (Federal)
  • Calgary Forest Lawn (Federal)
  • Calgary Heritage (Federal)
  • Calgary Midnapore (Federal)
  • Calgary Nose Hill (Federal)
  • Calgary Rocky Ridge (Federal)
  • Calgary Shepard (Federal)
  • Calgary Signal Hill (Federal)
  • Calgary Skyview (Federal)
  • Edmonton Centre (Federal)
  • Edmonton Griesbach (Federal)
  • Edmonton Manning (Federal)
  • Edmonton Mill Woods (Federal)
  • Edmonton Riverbend (Federal)
  • Edmonton Strathcona (Federal)
  • Edmonton West (Federal)
  • Edmonton—Wetaskiwin (Federal)
  • Foothills (Federal)
  • Fort McMurray—Cold Lake (Federal)
  • Grande Prairie—Mackenzie (Federal)
  • Lakeland (Federal)
  • Lethbridge (Federal)
  • Medicine Hat—Cardston—Warner (Federal)
  • Peace River—Westlock (Federal)
  • Red Deer—Lacombe (Federal)
  • Red Deer—Mountain View (Federal)
  • Sherwood Park—Fort Saskatchewan (Federal)
  • St. Albert—Edmonton (Federal)
  • Sturgeon River—Parkland (Federal)
  • Yellowhead (Federal)
  • Abbotsford (Federal)
  • Burnaby North—Seymour (Federal)
  • Burnaby South (Federal)
  • Cariboo—Prince George (Federal)
  • Central Okanagan—Similkameen—Nicola (Federal)
  • Chilliwack—Hope (Federal)
  • Cloverdale—Langley City (Federal)
  • Coquitlam—Port Coquitlam (Federal)
  • Courtenay—Alberni (Federal)
  • Cowichan—Malahat—Langford (Federal)
  • Delta (Federal)
  • Esquimalt—Saanich—Sooke (Federal)
  • Fleetwood—Port Kells (Federal)
  • Kamloops—Thompson—Cariboo (Federal)
  • Kelowna—Lake Country (Federal)
  • Kootenay—Columbia (Federal)
  • Langley—Aldergrove (Federal)
  • Mission—Matsqui—Fraser Canyon (Federal)
  • Nanaimo—Ladysmith (Federal)
  • New Westminster—Burnaby (Federal)
  • North Island—Powell River (Federal)
  • North Okanagan—Shuswap (Federal)
  • North Vancouver (Federal)
  • Pitt Meadows—Maple Ridge (Federal)
  • Port Moody—Coquitlam (Federal)
  • Prince George—Peace River—Northern Rockies (Federal)
  • Richmond Centre (Federal)
  • Saanich—Gulf Islands (Federal)
  • Skeena—Bulkley Valley (Federal)
  • South Okanagan—West Kootenay (Federal)
  • South Surrey—White Rock (Federal)
  • Steveston—Richmond East (Federal)
  • Surrey Centre (Federal)
  • Surrey—Newton (Federal)
  • Vancouver Centre (Federal)
  • Vancouver East (Federal)
  • Vancouver Granville (Federal)
  • Vancouver Kingsway (Federal)
  • Vancouver Quadra (Federal)
  • Vancouver South (Federal)
  • Victoria (Federal)
  • West Vancouver—Sunshine Coast—Sea to Sky Country (Federal)
  • Brandon—Souris (Federal)
  • Charleswood—St. James—Assiniboia—Headingley (Federal)
  • Churchill—Keewatinook Aski (Federal)
  • Dauphin—Swan River—Neepawa (Federal)
  • Elmwood—Transcona (Federal)
  • Kildonan—St. Paul (Federal)
  • Portage—Lisgar (Federal)
  • Provencher (Federal)
  • Saint Boniface—Saint Vital (Federal)
  • Selkirk—Interlake—Eastman (Federal)
  • Winnipeg Centre (Federal)
  • Winnipeg North (Federal)
  • Winnipeg South (Federal)
  • Winnipeg South Centre (Federal)
  • Acadie—Bathurst (Federal)
  • Beauséjour (Federal)
  • Fredericton (Federal)
  • Fundy Royal (Federal)
  • Madawaska—Restigouche (Federal)
  • Miramichi—Grand Lake (Federal)
  • Moncton—Riverview—Dieppe (Federal)
  • New Brunswick Southwest (Federal)
  • Saint John—Rothesay (Federal)
  • Tobique—Mactaquac (Federal)
  • Avalon (Federal)
  • Bonavista—Burin—Trinity (Federal)
  • Coast of Bays—Central—Notre Dame (Federal)
  • Labrador (Federal)
  • Long Range Mountains (Federal)
  • St. John's East (Federal)
  • St. John's South—Mount Pearl (Federal)
  • Cape Breton—Canso (Federal)
  • Central Nova (Federal)
  • Cumberland—Colchester (Federal)
  • Dartmouth—Cole Harbour (Federal)
  • Halifax (Federal)
  • Halifax West (Federal)
  • Kings—Hants (Federal)
  • Sackville—Preston—Chezzetcook (Federal)
  • South Shore—St. Margarets (Federal)
  • Sydney—Victoria (Federal)
  • West Nova (Federal)
  • Northwest Territories (Federal)
  • Nunavut (Federal)
  • Ajax (Federal)
  • Algoma—Manitoulin—Kapuskasing (Federal)
  • Aurora—Oak Ridges—Richmond Hill (Federal)
  • Barrie—Innisfil (Federal)
  • Barrie—Springwater—Oro-Medonte (Federal)
  • Bay of Quinte (Federal)
  • Beaches—East York (Federal)
  • Brampton Centre (Federal)
  • Brampton East (Federal)
  • Brampton North (Federal)
  • Brampton South (Federal)
  • Brampton West (Federal)
  • Brantford—Brant (Federal)
  • Bruce—Grey—Owen Sound (Federal)
  • Burlington (Federal)
  • Cambridge (Federal)
  • Carleton (Federal)
  • Chatham-Kent—Leamington (Federal)
  • Davenport (Federal)
  • Don Valley East (Federal)
  • Don Valley North (Federal)
  • Don Valley West (Federal)
  • Dufferin—Caledon (Federal)
  • Durham (Federal)
  • Eglinton—Lawrence (Federal)
  • Elgin—Middlesex—London (Federal)
  • Essex (Federal)
  • Etobicoke Centre (Federal)
  • Etobicoke—Lakeshore (Federal)
  • Etobicoke North (Federal)
  • Flamborough—Glanbrook (Federal)
  • Glengarry—Prescott—Russell (Federal)
  • Guelph (Federal)
  • Haldimand—Norfolk (Federal)
  • Haliburton—Kawartha Lakes—Brock (Federal)
  • Hamilton Centre (Federal)
  • Hamilton East—Stoney Creek (Federal)
  • Hamilton Mountain (Federal)
  • Hamilton West—Ancaster—Dundas (Federal)
  • Hastings—Lennox and Addington (Federal)
  • Humber River—Black Creek (Federal)
  • Huron—Bruce (Federal)
  • Kanata—Carleton (Federal)
  • Kenora (Federal)
  • Kingston and the Islands (Federal)
  • King—Vaughan (Federal)
  • Kitchener Centre (Federal)
  • Kitchener—Conestoga (Federal)
  • Kitchener South—Hespeler (Federal)
  • Lambton—Kent—Middlesex (Federal)
  • Lanark—Frontenac—Kingston (Federal)
  • Leeds—Grenville—Thousand Islands and Rideau Lakes (Federal)
  • London—Fanshawe (Federal)
  • London North Centre (Federal)
  • London West (Federal)
  • Markham—Stouffville (Federal)
  • Markham—Thornhill (Federal)
  • Markham—Unionville (Federal)
  • Milton (Federal)
  • Mississauga Centre (Federal)
  • Mississauga East—Cooksville (Federal)
  • Mississauga—Erin Mills (Federal)
  • Mississauga—Lakeshore (Federal)
  • Mississauga—Malton (Federal)
  • Mississauga—Streetsville (Federal)
  • Nepean (Federal)
  • Newmarket—Aurora (Federal)
  • Niagara Centre (Federal)
  • Niagara Falls (Federal)
  • Niagara West (Federal)
  • Nickel Belt (Federal)
  • Nipissing—Timiskaming (Federal)
  • Northumberland—Peterborough South (Federal)
  • Oakville (Federal)
  • Oakville North—Burlington (Federal)
  • Orléans (Federal)
  • Oshawa (Federal)
  • Ottawa Centre (Federal)
  • Ottawa South (Federal)
  • Ottawa—Vanier (Federal)
  • Ottawa West—Nepean (Federal)
  • Oxford (Federal)
  • Parkdale—High Park (Federal)
  • Parry Sound—Muskoka (Federal)
  • Perth—Wellington (Federal)
  • Peterborough—Kawartha (Federal)
  • Pickering—Uxbridge (Federal)
  • Renfrew—Nipissing—Pembroke (Federal)
  • Richmond Hill (Federal)
  • Sarnia—Lambton (Federal)
  • Sault Ste. Marie (Federal)
  • Scarborough—Agincourt (Federal)
  • Scarborough Centre (Federal)
  • Scarborough—Guildwood (Federal)
  • Scarborough North (Federal)
  • Scarborough—Rouge Park (Federal)
  • Scarborough Southwest (Federal)
  • Simcoe—Grey (Federal)
  • Simcoe North (Federal)
  • Spadina—Fort York (Federal)
  • St. Catharines (Federal)
  • Stormont—Dundas—South Glengarry (Federal)
  • Sudbury (Federal)
  • Thornhill (Federal)
  • Thunder Bay—Rainy River (Federal)
  • Thunder Bay—Superior North (Federal)
  • Timmins—James Bay (Federal)
  • Toronto Centre (Federal)
  • Toronto—Danforth (Federal)
  • Toronto—St. Paul's (Federal)
  • University—Rosedale (Federal)
  • Vaughan—Woodbridge (Federal)
  • Waterloo (Federal)
  • Wellington—Halton Hills (Federal)
  • Whitby (Federal)
  • Willowdale (Federal)
  • Windsor—Tecumseh (Federal)
  • Windsor West (Federal)
  • York Centre (Federal)
  • York—Simcoe (Federal)
  • York South—Weston (Federal)
  • Cardigan (Federal)
  • Charlottetown (Federal)
  • Egmont (Federal)
  • Malpeque (Federal)
  • Abitibi—Baie-James—Nunavik—Eeyou (Federal)
  • Abitibi—Témiscamingue (Federal)
  • Ahuntsic-Cartierville (Federal)
  • Alfred-Pellan (Federal)
  • Argenteuil—La Petite-Nation (Federal)
  • Avignon—La Mitis—Matane—Matapédia (Federal)
  • Beauce (Federal)
  • Beauport—Côte-de-Beaupré—Île d'Orléans—Charlevoix (Federal)
  • Beauport—Limoilou (Federal)
  • Bécancour—Nicolet—Saurel (Federal)
  • Bellechasse—Les Etchemins—Lévis (Federal)
  • Beloeil—Chambly (Federal)
  • Berthier—Maskinongé (Federal)
  • Bourassa (Federal)
  • Brome—Missisquoi (Federal)
  • Brossard—Saint-Lambert (Federal)
  • Charlesbourg—Haute-Saint-Charles (Federal)
  • Châteauguay—Lacolle (Federal)
  • Chicoutimi—Le Fjord (Federal)
  • Compton—Stanstead (Federal)
  • Dorval—Lachine—LaSalle (Federal)
  • Drummond (Federal)
  • Gaspésie—Les Îles-de-la-Madeleine (Federal)
  • Gatineau (Federal)
  • Hochelaga (Federal)
  • Honoré-Mercier (Federal)
  • Hull—Aylmer (Federal)
  • Joliette (Federal)
  • Jonquière (Federal)
  • Lac-Saint-Jean (Federal)
  • Lac-Saint-Louis (Federal)
  • La Pointe-de-l'Île (Federal)
  • La Prairie (Federal)
  • LaSalle—Émard—Verdun (Federal)
  • Laurentides—Labelle (Federal)
  • Laurier—Sainte-Marie (Federal)
  • Laval—Les Îles (Federal)
  • Lévis—Lotbinière (Federal)
  • Longueuil—Charles-LeMoyne (Federal)
  • Longueuil—Saint-Hubert (Federal)
  • Louis-Hébert (Federal)
  • Louis-Saint-Laurent (Federal)
  • Manicouagan (Federal)
  • Marc-Aurèle-Fortin (Federal)
  • Mégantic—L'Érable (Federal)
  • Mirabel (Federal)
  • Montarville (Federal)
  • Montcalm (Federal)
  • Montmagny—L'Islet—Kamouraska—Rivière-du-Loup (Federal)
  • Mount Royal (Federal)
  • Notre-Dame-de-Grâce—Westmount (Federal)
  • Outremont (Federal)
  • Papineau (Federal)
  • Pierre-Boucher—Les Patriotes—Verchères (Federal)
  • Pierrefonds—Dollard (Federal)
  • Pontiac (Federal)
  • Portneuf—Jacques-Cartier (Federal)
  • Québec (Federal)
  • Repentigny (Federal)
  • Richmond—Arthabaska (Federal)
  • Rimouski-Neigette—Témiscouata—Les Basques (Federal)
  • Rivière-des-Mille-Îles (Federal)
  • Rivière-du-Nord (Federal)
  • Rosemont—La Petite-Patrie (Federal)
  • Saint-Hyacinthe—Bagot (Federal)
  • Saint-Jean (Federal)
  • Saint-Laurent (Federal)
  • Saint-Léonard—Saint-Michel (Federal)
  • Saint-Maurice—Champlain (Federal)
  • Salaberry—Suroît (Federal)
  • Shefford (Federal)
  • Sherbrooke (Federal)
  • Terrebonne (Federal)
  • Thérèse-De Blainville (Federal)
  • Trois-Rivières (Federal)
  • Vaudreuil—Soulanges (Federal)
  • Ville-Marie—Le Sud-Ouest—Île-des-Soeurs (Federal)
  • Vimy (Federal)
  • Battlefords—Lloydminster (Federal)
  • Carlton Trail—Eagle Creek (Federal)
  • Cypress Hills—Grasslands (Federal)
  • Desnethé—Missinippi—Churchill River (Federal)
  • Moose Jaw—Lake Centre—Lanigan (Federal)
  • Prince Albert (Federal)
  • Regina—Lewvan (Federal)
  • Regina—Qu'Appelle (Federal)
  • Regina—Wascana (Federal)
  • Saskatoon—Grasswood (Federal)
  • Saskatoon—University (Federal)
  • Saskatoon West (Federal)
  • Souris—Moose Mountain (Federal)
  • Yorkton—Melville (Federal)
  • Yukon (Federal)

Contact & Data

Contact with questions and comments.

New electoral-district data is highly welcome! If you have data, please send it along, and try to ensure it meets the following criteria:

  • In a common geospatial data format: KML, GML, ESRI shapefile
  • Uses the WGS84 spatial reference system, if possible. (All KML files use this.) If the file uses another spatial reference system, it'd be great if you could include its EPSG authority number.
  • Includes a single feature for each political district (multipolygon features are fine, but each political district should have a single row in the attribute table). Attributes should provide a name and, optionally, ID number for each district.
  • Should include no features other than the relevant political districts



This example uses the Google Maps geocoder to match an address with its political districts.

Your address

Here's the code:

<form id="districtsapidemo">
<tr><th>Your address</th><td><input type="text" style="width: 400px"></td></tr>
<tr><td></td><td><input type="submit" value="Go"></td></tr>
<div id="districtsapidemo_message"></div>

<script type="text/javascript" src=""></script> 
<script type="text/javascript" src=""></script>
<script type="text/javascript">

var $message_area = $('#districtsapidemo_message');
$('#districtsapidemo').submit(function (e) {
    // First, find the latitude and longitude for this address
    var geocoder = new google.maps.Geocoder();
    geocoder.geocode({'address': $('#districtsapidemo input[type=text]').val(),
        'region': 'ca'}, function(results, status) {
        // A fuller example would only look at street addresses
        if (results.length > 1) {
            // Resolve multiple possible addresses
            $message_area.append('<p>Which of these looks like your address?</p>');
            $.each(results, function() {
                var result = this;
                $message_area.append($('<p>' + this.formatted_address + '</p>').click(function () {
        else if (results.length == 0) {
            $message_area.append('<p>No match for that address.</p>');
        else {

// Call this function once we have a latitude and longitude
function districts_for_geocoder_result(result) {
    // 'result' is a Google geocoder response object
    // latitude lives in
    $message_area.append('<p>' + result.formatted_address + '</p>');
    $.getJSON('' + $.param({
        'lng': result.geometry.location.lng()}), function (data) {
            if (data.length == 0) {
                $message_area.append('<p>No districts found. Is that address in Canada?</p>');
            $.each(data, function () {
                $message_area.append('<p>In ' + + ' (' + this.electoral_group.level
                    + '), your district is ' + + '.</p>');