Canadian Open Data API Lab
Overview
The Canadian Open Data API Lab is a collection of practical examples and interactive demonstrations for working with Canada's Open Data APIs. Whether you're building a website, developing a desktop application, or integrating data into your own software, this site provides real-world examples to help you get started.
Explore API requests using JavaScript, Python, cURL, and other technologies. Learn how to search datasets, retrieve metadata, access DataStore records, and build applications powered by Canada's open data. Each example is designed to be simple, reusable, and easy to adapt to your own projects.
The goal of this project is to bridge the gap between API documentation and working code by providing clear explanations, sample implementations, and interactive demonstrations that you can experiment with and build upon.
Whether you're a web developer, MS365 developer, data analyst, researcher, student, or simply curious about Canada's open data, the Canadian Open Data API Lab is a place to learn and explore the Open Data API.
Technology
Canada's Open Government Portal API is built with the CKAN Action API. The JSON based API provides programmatic access to datasets, organizations, resources, and metadata, allowing developers to search the catalogue, retrieve dataset details, and interact with the platform using standard HTTP requests.
The API returns data in JSON format and follows an action-oriented design, where each endpoint performs a specific operation such as package_search, package_show, or organization_list. Most read-only operations can be accessed using simple HTTP GET requests, while authenticated operations such as creating or updating content use POST requests with an API token.
This website focuses on the most commonly used Action API endpoints and demonstrates how to consume them from JavaScript, Python, cURL, and other programming languages. Each example includes practical code snippets, explanations of request parameters, and sample responses to help you quickly integrate Canada's Open Data into your own applications.
While this site primarily covers the CKAN Action API for searching and retrieving catalogue metadata, many examples also demonstrate how to work with the CKAN DataStore API, which provides direct access to structured tabular data stored within individual resources. Together, these APIs form a powerful platform for discovering and consuming Canada's open data.