Open Government, Canada API

Free to Use
51 D
Measured Score 0 50 100 Speed 7/30 Consistency 20/20 Security 20/20 Browser access 0/15 Transparency 4/15 TESTED 2026-08-10

Overview

The Open Government Canada API provides free access to the Canadian federal government's open data catalog, with thousands of datasets on topics ranging from climate and agriculture to health and justice. No API key is needed to get started. The portal uses the CKAN platform, making it compatible with standard open data tooling.

Beginner Tip

Canada's portal offers bilingual (English/French) metadata; use the API at https://open.canada.ca/data/en/api/3/action/package_search to search datasets in English, or replace /en/ with /fr/ for French results.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://open.canada.ca/data/en/api/3/action/package_search?q=climate&rows=5
Result
HTTP 200 · application/json · 53,951 bytes
Response time
458 ms (median of 3) · fastest 442 ms
Transport
TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by Entrust Limited
Browser CORS
No Access-Control-Allow-Origin header — call it from a server, not the browser
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
count integer 2841
facets object {0 fields}
facet_ranges object {1 fields}
results array [1 item]
sort string score desc, metadata_modified desc
search_facets object {0 fields}

Captured Response

Captured from a real request to https://open.canada.ca/data/en/api/3/action/package_search?q=climate&rows=5 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "help": "https://open.canada.ca/data/en/api/3/action/help_show?name=package_search",
  "success": true,
  "result": {
    "count": 2841,
    "facets": {},
    "facet_ranges": {
      "portal_release_date": {
        "…": "(4 more fields)"
      }
    },
    "results": [
      {
        "…": "(60 more fields)"
      }
    ],
    "sort": "score desc, metadata_modified desc",
    "search_facets": {}
  }
}

Field Reference

success Indicates successful processing of the API request.
result Contains count and results array for search calls.
count Total number of datasets matching the search query.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://open.canada.ca/data/en/api/3/action/package_search?q=climate&rows=5";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist text/html

Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

Connection refused on http:// URL The portal redirects HTTP to HTTPS but some older documentation still lists the http:// URL.
Always use https://open.canada.ca instead of the http:// variant to avoid redirect issues.
Dataset has no downloadable resource Some entries in the catalog are metadata-only or point to external services.
Check the resource_type field in each resource object; look for file or api types to find downloadable content.
Rate limiting Too many rapid requests to the search endpoint.
Add a short delay between requests and use the rows and start parameters to paginate efficiently.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 7/30
Consistency 20/20
Security 20/20
Browser access 0/15
Transparency 4/15
Endpoint Response Time 458ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS NO
CORS UNKNOWN
Category Government
Difficulty Beginner
Endpoint last called: 2026-08-10

Similar APIs

View All →