Access our Application Programming Interface (API)

Follow:

  • RSS
  • Cite

Open.canada.ca uses a feature-rich registry system called CKAN. CKAN can be accessed by users through browsing and searching the data through the site or from machine-to-machine through the Application Programming Interface (API). CKAN has extensive instructions on using the API here but for starters, here are some examples of using the API:

  • CKAN's Action API is a powerful, RPC-style API that exposes all of CKAN's core features to API clients. All of a CKAN website's core functionality (everything you can do with the web interface and more) can be used by external code that calls the CKAN API. Each dataset has a “Link to JSON format” button that uses the API to download the complete metadata record for that dataset, delivering it to the end user in JSON format (JavaScript Object Notation). JSON is an easily manipulated, machine readable file but when used with a viewer (such as http://jsonviewer.stack.hu/ for example) can also be read by humans.
  • You can also download an activity stream of recently updated datasets using: https://open.canada.ca/data/en/api/3/action/recently_changed_packages_activity_list
  • And you can use the API to automate search results. Trying this one: https://open.canada.ca/data/en/api/3/action/package_search?q=spending will return all the results with the search term “spending”

These are just a few of the ways you can use our API which can can be accessed using the domain name https://open.canada.ca/data/en/ or https://ouvert.canada.ca/data/fr/dataset. As we implement more features, the possibilities of using the API will increase.

Please Note: The CKAN API on open.canada.ca only supports GET requests. Please pass parameters as part of the request url, not as JSON in the body of a POST request.

Date modified: