{"description":"Searches the Government of Canada Open Government portal datasets through its public CKAN catalogue API, the same search its dataset catalogue uses: dataset title, publishing organisation, description, last modified date and dataset page link. First 20 results, most relevant first, plus the total number of matches. The search page on the site itself shows no results at the moment, so this uses the catalogue API.","effect":"read","id":"open.canada.ca/search-open-data","keywords":["open.canada.ca","open government","canada","canadian","datasets","open data","government data","statistics","housing","climate","census","données ouvertes","gouvernement du canada"],"output":{"schema":{"properties":{"datasets":{"items":{"properties":{"description":{"description":"Dataset notes, may contain line breaks","type":["string","null"]},"modified":{"description":"Last modified timestamp, ISO 8601","type":["string","null"]},"organization":{"type":["string","null"]},"resource_count":{"description":"Number of files or resources in the dataset","type":["integer","null"]},"title":{"type":"string"},"url":{"type":"string"}},"required":["title","url"],"type":"object"},"type":"array"},"query":{"type":"string"},"total":{"description":"Number of matching datasets in the whole catalogue","type":["integer","null"]}},"required":["query","datasets"],"type":"object"},"value":"{query: params.query, total: steps.search.total, datasets: steps.search.datasets[?id != `null` && title != `null`].{title: title, url: join('', ['https://open.canada.ca/data/en/dataset/', id]), organization: organization.title, description: notes, modified: metadata_modified, resource_count: num_resources}}"},"params":{"additionalProperties":false,"properties":{"query":{"description":"Topic or keyword for the dataset, e.g. 'housing', 'climate', 'census'","maxLength":100,"minLength":2,"type":"string"}},"required":["query"],"type":"object"},"provenance":{"method":"har","notes":"GET /data/api/3/action/package_search?q=…&rows=20 on open.canada.ca, the public CKAN catalogue API. The HTML search page at /en/search?q= renders no results in the current response, so the API is used. Title, notes, organization title, metadata_modified and num_resources come from each result. The link is the dataset page /data/en/dataset/<id>, which returned 200 for a sample id. robots.txt does not disallow the API path.","recorded_at":"2026-11-08T16:50:00.000Z","recorded_by":"wield-forge (claude-haiku agent)"},"requires_login":false,"schema":"https://wield.run/schema/recipe/v1.json","site":{"country":"CA","id":"open.canada.ca","language":"en","name":"Open Government Portal Canada","origin":"https://open.canada.ca","origins":["https://open.canada.ca"]},"steps":[{"description":"Public CKAN catalogue API of the Open Government portal: GET /data/api/3/action/package_search?q=…&rows=20. No key, read-only. result.results holds the datasets, result.count the total.","expect":{"assert":"status == `200` && body.success == `true` && type(body.result.results) == 'array'","content_type":"json","status":[200]},"extract":{"json":{"datasets":"result.results","total":"result.count"}},"id":"search","request":{"headers":{"Accept":"application/json"},"method":"GET","query":{"q":"{{params.query}}","rows":20},"url":"/data/api/3/action/package_search"}}],"task":"Search Canadian open datasets","tos":{"notes":"Not reviewed. One search page per call, the same page a visitor loads. The site's terms on automated access were not checked.","reviewed":false},"verify":{"checks":["length(output.datasets) > `0`","length(output.datasets[?starts_with(url, 'https://open.canada.ca/data/en/dataset/')]) == length(output.datasets)","length(output.datasets[?title != `null`]) == length(output.datasets)"],"example_params":{"query":"housing"},"max_ms":5000},"version":1}