Find an API

Search public APIs with auth details & Postman guides

← All APIs

Elections Canada Open Data API

elections.ca · Government

Government No Auth Free & Open Government Electoral Geospatial Demographics

Open data API from Elections Canada providing electoral district boundaries, polling division shapefiles, registered party information, election results, and electoral event data. The electoral boundary API is widely used for geographic data applications — riding boundaries align closely with demographic and insurance market boundaries. Fully open with no authentication required.

Authentication

No authentication requiredFree to use with no key needed.

Sample Requests

GET Get federal electoral districts

Retrieves shapefile download links for federal electoral district boundaries (338 ridings). Data available in GeoJSON, Shapefile, and KML formats.

https://www.elections.ca/open_data/https:/www.elections.ca/res/rep/off/062da/table_of_contents_e.html

Hover any highlighted part to learn what it does

curl -X GET "https://www.elections.ca/open_data/https://www.elections.ca/res/rep/off/062da/table_of_contents_e.html"
import requests
response = requests.get(
    "https://www.elections.ca/open_data/https://www.elections.ca/res/rep/off/062da/table_of_contents_e.html",
)
print(response.json())
const url = 'https://www.elections.ca/open_data/https://www.elections.ca/res/rep/off/062da/table_of_contents_e.html';

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	targetURL := "https://www.elections.ca/open_data/https://www.elections.ca/res/rep/off/062da/table_of_contents_e.html"
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://www.elections.ca/open_data/https://www.elections.ca/res/rep/off/062da/table_of_contents_e.html")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://www.elections.ca/open_data/https://www.elections.ca/res/rep/off/062da/table_of_contents_e.html";
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET Get election results

Downloads election results by polling station for the 44th General Election in CSV format. Each row represents one polling station's results.

https://www.elections.ca/open_data/https:/elections.ca/res/rep/off/44gedata/allresults/44ge.csv

Hover any highlighted part to learn what it does

curl -X GET "https://www.elections.ca/open_data/https://elections.ca/res/rep/off/44gedata/allresults/44ge.csv"
import requests
response = requests.get(
    "https://www.elections.ca/open_data/https://elections.ca/res/rep/off/44gedata/allresults/44ge.csv",
)
print(response.json())
const url = 'https://www.elections.ca/open_data/https://elections.ca/res/rep/off/44gedata/allresults/44ge.csv';

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	targetURL := "https://www.elections.ca/open_data/https://elections.ca/res/rep/off/44gedata/allresults/44ge.csv"
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://www.elections.ca/open_data/https://elections.ca/res/rep/off/44gedata/allresults/44ge.csv")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://www.elections.ca/open_data/https://elections.ca/res/rep/off/44gedata/allresults/44ge.csv";
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. No API key — Elections Canada data is fully open under the Open Government Licence – Canada
  2. Electoral boundaries: https://elections.ca/res/rep/off/23fedbd/boundaries/ — download shapefiles
  3. Election results: elections.ca/res/rep/off/{event}/ — replace {event} with general election number (e.g., 44ge)
  4. Registered parties and candidates: open.canada.ca — search "Elections Canada"
  5. Polling division maps change after each electoral redistribution — verify boundary year
  6. FED (Federal Electoral District) codes are standard 5-digit codes used across federal datasets

What can you build with Elections Canada Open Data API?

Elections Canada Open Data API is a Government API. Developers commonly use government APIs for:

  • surfacing public datasets in citizen-facing apps
  • building transparency and civic engagement tools
  • accessing legislation, court records, and official data
  • powering research and journalism tools
  • creating compliance and regulatory monitoring dashboards

No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. Elections Canada Open Data API is free to use, making it a low-risk choice to experiment with.

New to APIs? Read our beginner's guide · Learn about API keys · What is REST?

Open documentation ↗