Government — entry 044 of 90
Open Government, Canada
Open.canada.ca is the Government of Canada's federal open-data portal; the public site has moved fully to HTTPS (the stored `http://` link now redirects), and behind its Drupal front end sits a keyless CKAN REST API at `open.canada.ca/data/en/api/3/action/`, confirmed live via `package_list` returning full bilingual (English/French) dataset JSON. The response carried no `Access-Control-Allow-Origin` header, so cross-origin browser calls are blocked despite the API itself being keyless. It catalogues datasets from federal departments spanning health, environment, finance, and transport.
Open.canada.ca runs a keyless CKAN REST API behind its Drupal front end. A live GET this run against /package_search?rows=1 returned a genuine 200, 21,083 B JSON envelope (content-type: application/json;charset=utf-8) reporting count: 47731 datasets and success: true. Both the entry's own documented path (/data/en/api/3/action/...) and the shorter, locale-free /data/api/3/action/... answer live — this quickstart pins the shorter one, and the third gotcha below has the byte-for-byte comparison. No access-control-allow-origin header was present on any probe, including an explicit OPTIONS preflight (which returned 403), confirming the stored cors: no despite the API sending an Access-Control-Allow-Methods: GET, POST header that makes it look CORS-aware.
GreatAPIs Score
Auth quickstart
- No API key, signup, or credit card required — a live GET this run against
/package_search?rows=1returned a full, real result set on the first anonymous try.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Search datasets, one result
GEThttps://open.canada.ca/data/api/3/action/package_search?rows=1
{
"help": "https://open.canada.ca/data/api/3/action/help_show?name=package_search",
"success": true,
"result": {
"count": 47731,
"results": [
{
"id": "0032ce54-c5dd-4b66-99a0-320a7b5e99f2",
"name": "0032ce54-c5dd-4b66-99a0-320a7b5e99f2",
"title": "Federal Corporations",
"title_translated": {
"en": "Federal Corporations",
"fr": "Sociétés de régime fédéral"
},
"organization": {
"title": "Innovation, Science and Economic Development Canada | Innovation, Sciences et Développement économique Canada"
},
"num_resources": 10,
"license_title": "Open Government Licence - Canada"
}
]
}
}Trimmed to a handful of representative fields out of 59 on the real result object — the full live response above is 21,083 B. title is a plain, single-language string; the real bilingual pair lives under the separate title_translated field — see the first gotcha below.
Try it
Developer reference
https://open.canada.ca/data/api/3/action- GET/package_search
- GET/package_show
- GET/package_list
Gotchas & limits
- The plain
title/notesfields on each result are single-language strings (English in this run's probe), not the{en, fr}bilingual objects you might expect from a bilingual government portal — the real bilingual pair lives in separately-namedtitle_translated/notes_translatedfields, confirmed live above (title_translated: {"en": "Federal Corporations", "fr": "Sociétés de régime fédéral"}). Code that readsresult.title.enon the plain field will getundefined. - Errors keep the CKAN envelope rather than an HTTP-only signal — a live GET this run against
/package_show?id=nosuchdatasetreturned 404, 162 B,{"help": ..., "error": {"__type": "Not Found Error", "message": "Not found"}, "success": false}—resultis absent entirely and you must branch on thesuccessboolean, not just the HTTP status. - The entry's own summary documents the API at
/data/en/api/3/action/..., but the shorter, locale-free/data/api/3/action/...(this quickstart'sbaseUrl) answers identically live — both returned real, near-identical result sets this run (21,083 B vs 21,086 B for the samerows=1query). Either prefix works; this quickstart pins the shorter one. - The API sends
Access-Control-Allow-Methods: GET, POSTon every response, which can read as CORS support, but never sendsAccess-Control-Allow-Origin— confirmed live this run on both a plain GET and an explicitOPTIONSpreflight (403, still no origin header). Browser code needs a server-side proxy despite the misleading methods header.