Access our Application Programming Interface (API)

Follow:

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: http://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: http://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 http://open.canada.ca/data/en/ or http://ouvert.canada.ca/data/fr/. 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.

Promotional image displaying envelopes

Receive updates about Open Government

Sign up to receive updates about Open Government and hear about new datasets, new information resources, upcoming consultations, and current blogs.

Promotional image representing people discussing

Mid-Term Self-Assessment Report on Canada's Action Plan on Open Government 2014-16

Read about our progress on Canada’s Open Government Action Plan.

A map of Canada - Une carte de Canada

Open government across Canada

Explore open government programs and events from coast to coast to coast, get information and tools to help build your own portal, including implementing the Open Government Licence in your jurisdiction.