---
name: open-government-canada-ckan-ingestion
description: "How to get Government of Canada CKAN API data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load Open Canada catalogue metadata into pandas and Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/open-government-canada-ckan
Provider: https://open.canada.ca/en/access-our-application-programming-interface-api
Checked against the provider's documentation: 2026-11-02

## Access
- No account or key. The Open Government CKAN Action API accepts GET requests with query parameters.

## Request
```bash
curl 'https://open.canada.ca/data/en/api/3/action/package_search?rows=5&sort=metadata_modified%20desc'
```

## Format
JSON with a result object containing a total count and dataset records with identifiers, bilingual metadata, organizations, licences, resource links and update timestamps.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""Government of Canada CKAN metadata search -> pandas -> Parquet."""
import requests
import pandas as pd

URL = "https://open.canada.ca/data/en/api/3/action/package_search"
r = requests.get(URL, params={"rows": 5, "sort": "metadata_modified desc"}, timeout=60)
r.raise_for_status()
rows = r.json()["result"]["results"]
df = pd.DataFrame([{
    "id": x["id"],
    "title": x["title"],
    "organization": (x.get("organization") or {}).get("title"),
    "metadata_modified": x.get("metadata_modified"),
    "num_resources": x.get("num_resources"),
    "license_title": x.get("license_title"),
} for x in rows])
df["metadata_modified"] = pd.to_datetime(df["metadata_modified"], utc=True)
df.to_parquet("open_canada_ckan_metadata.parquet", index=False)
print(len(df), "datasets; latest metadata update", df["metadata_modified"].max().isoformat())
```
Run by us on 2026-11-02 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 5 datasets; latest metadata update 2026-11-02T21:01:41.114988+00:00

## Limits
- Rate limit: Not stated.
- The Open Canada CKAN API supports GET requests only.
- Dataset coverage and linked-resource access conditions vary by publisher.

## Quirks
- Many metadata fields are bilingual objects or arrays rather than scalar text.
- Resource URLs can be relative paths; resolve them against https://open.canada.ca before downloading.
- metadata_modified describes the catalogue record and may differ from a linked file's last-modified time.

## Terms and attribution
- The Open Government Licence – Canada allows lawful commercial and non-commercial reuse subject to its conditions and exemptions.
- Acknowledge the information provider or use the licence's supplied attribution statement when no specific statement is given.
- Inspect the licence fields and source page for each linked dataset because catalogue resources can carry separate conditions.
- Terms page: https://open.canada.ca/en/open-government-licence-canada

## Sources
- https://open.canada.ca/en/access-our-application-programming-interface-api: "The CKAN API on open.canada.ca only supports GET requests."
- https://open.canada.ca/en/access-our-application-programming-interface-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)."
- https://open.canada.ca/en/open-government-licence-canada: "The Information Provider grants you a worldwide, royalty-free, perpetual, non-exclusive licence to use the Information, including for commercial purposes, subject to the terms below."
- https://open.canada.ca/en/open-government-licence-canada: "Contains information licensed under the Open Government Licence – Canada."

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
