TL;DR
The Government of Canada Open Data Portal provides access to over 80,000 federal datasets through a CKAN-based REST API. Topics include climate and weather, economy and industry, health, immigration, natural resources, transportation, and geospatial services. Each dataset includes metadata (title, description, organization, update frequency), downloadable resources (CSV, JSON, GeoJSON, XML, SHP), and API endpoints. The portal uses the CKAN v3 API standard with actions like package_search, package_show, organization_list, and tag_list. It also provides a SPARQL endpoint for linked data queries.
Quick start: https://open.canada.ca/data/api/3/action/package_list
No API key needed — just make a request!
How to Use This API
1. Search Datasets by Keyword
https://open.canada.ca/data/api/3/action/package_search?q=climate&rows=5
https://open.canada.ca/data/api/3/action/package_search?q=population&rows=20&start=0
Full-text search across title, description, and tags. Supports pagination with rows and start.
2. Get Dataset Details
https://open.canada.ca/data/api/3/action/package_show?id=climate-change-canada
https://open.canada.ca/data/api/3/action/package_show?id=census-profiles-2021
Returns full metadata including all resources, organization info, and custom fields.
3. List All Government Organizations
https://open.canada.ca/data/api/3/action/organization_list
https://open.canada.ca/data/api/3/action/organization_list?all_fields=true
Browse which departments contribute data: Environment Canada, StatCan, NRCan, Health Canada, etc.
4. List Dataset Tags
https://open.canada.ca/data/api/3/action/tag_list
https://open.canada.ca/data/api/3/action/tag_list?all_fields=true&query=climate
Discover related tags to build better searches.
5. Response Format
{
"help": "https://...",
"success": true,
"result": {
"count": 120,
"results": [
{
"id": "abc-123-def",
"name": "climate-change-canada",
"title": "Climate Change in Canada",
"notes": "Indicators of climate change...",
"organization": {
"name": "environment-canada",
"title": "Environment and Climate Change Canada"
},
"resources": [
{
"name": "Temperature data",
"format": "CSV",
"url": "https://.../download.csv"
}
]
}
]
}
}
6. JavaScript — Search and Display Canada Data
fetch('https://open.canada.ca/data/api/3/action/package_search?q=population+canada&rows=3')
.then(r => r.json())
.then(d => {
d.result.results.forEach(ds => {
console.log(ds.title);
console.log(` By: ${ds.organization.title}`);
console.log(` Updated: ${ds.metadata_modified?.slice(0, 10)}`);
console.log(` Formats: ${ds.resources.map(r => r.format).join(', ')}`);
});
});
7. Python — Search and List Resources
import requests
resp = requests.get(
'https://open.canada.ca/data/api/3/action/package_search',
params={'q': 'immigration', 'rows': 5}
)
data = resp.json()
for ds in data['result']['results']:
print(f"\n{ds['title']}")
for res in ds.get('resources', []):
print(f" [{res['format']}] {res.get('name', 'Unnamed')}")
8. Python — Download All Datasets from an Organization
import requests
org = 'statcan'
resp = requests.get(
'https://open.canada.ca/data/api/3/action/package_search',
params={'q': '', 'fq': f'organization:{org}', 'rows': 100}
)
data = resp.json()
print(f"Statistics Canada datasets: {data['result']['count']}")
for ds in data['result']['results'][:5]:
print(f" \u2022 {ds['title']}")
https://open.canada.ca/data/api/3/action/package_search?q=climate&rows=3
Frequently Asked Questions
- What federal departments contribute data to the portal?
- Environment and Climate Change Canada, Statistics Canada, Natural Resources Canada, Health Canada, Immigration, Refugees and Citizenship Canada, Transport Canada, Agriculture and Agri-Food Canada, Fisheries and Oceans, Public Safety, and dozens more.
- How do I filter by department or subject?
- Use the
qparameter with keywords, or filter more precisely withfq=organization:statcanfor Statistics Canada, orfq=tags:climatefor tagged results. Combine with+for multiple filters. - What geospatial APIs are available?
- In addition to CKAN, Canada offers GeoBase/GEO.ca APIs for geospatial data including administrative boundaries, hydrography, road networks, and satellite imagery. Many CKAN datasets also include GeoJSON and Shapefile resources.
- How often is the data updated?
- Update frequency varies: daily for weather and climate data, quarterly for economic indicators, annually for Census data, and on-demand for many research datasets. The
metadata_modifiedfield shows the last update timestamp. - Can I access historical versions of a dataset?
- The CKAN API provides the current version of each dataset. For historical versions, you would need to poll periodically or check if old versions are maintained as separate datasets (some are labeled by year).
- What's the rate limit?
- No formal rate limit, but please be respectful. For bulk operations, use the CSV/JSON resource download URLs rather than querying the API for every record.
What You Can Build
- Canadian civic data dashboard combining climate, health, and economic indicators
- Immigration trends analyzer using IRCC data on permanent and temporary residents
- Weather and climate application using Environment Canada datasets
- Natural resources map aggregating forestry, mining, and energy data by region
- Statistical tool exploring Census demographic profiles at federal and provincial levels