understand-ckan

Documents the CKAN Action API endpoints, pagination, and conventions for Montréal's open data portal.

1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/alistaircroll/montreal-open-data --skill understand-ckan-alistaircroll
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: understand-ckan
Source: https://github.com/alistaircroll/montreal-open-data/tree/main/skills/core/understand-ckan
Command: npx skills add https://github.com/alistaircroll/montreal-open-data --skill understand-ckan-alistaircroll

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with Montréal's open data portal requires understanding the CKAN Action API's structure, endpoints, and quirks. This Skill provides a complete bilingual reference so an AI agent can correctly query donnees.montreal.ca without trial-and-error or misinterpreting API responses. ## Core Features & Use Cases - Three API Layers Documented: Covers the Action API for catalog metadata, the DataStore API for SQL and filtered queries on tabular data, and the FileStore API for raw file downloads. - Gotchas & Edge Cases: Explains critical details like the 32,000-row DataStore limit, UUID-based resource IDs, double-quoted SQL column names, and French-dominant metadata. - Use Case: When asked "How many trees are in the Plateau?", the agent uses this reference to construct a correct datastore_search_sql call with proper quoting, pagination, and filter syntax against the tree dataset's resource UUID. ## Quick Start Ask the agent to explain how to query a dataset on donnees.montreal.ca using the CKAN DataStore API with filters and pagination.

Frequently Asked Questions about understand-ckan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Montréal open data with the CKAN API?

Use the DataStore API endpoint datastore_search with a resource UUID, optional filters as a JSON object, and limit/offset for pagination. For full SQL, use datastore_search_sql with the resource UUID as the double-quoted table name.

How do I search for datasets on donnees.montreal.ca?

Use the package_search endpoint with a q parameter for keywords, plus field-specific filters like organization:ville-de-montreal or tags:Transport. Control result size with rows and start parameters for pagination.

Does the CKAN API require an API key for reading data?

No authentication is required for read operations on Montréal's CKAN portal. All Action API endpoints accept GET or POST requests without credentials, returning JSON with a success flag and result payload.

Why does my CKAN SQL query fail on column names?

CKAN DataStore SQL requires double quotes around column names containing accents, spaces, or mixed case, such as "Essence_fr". The table name must also be the resource UUID in double quotes, and JOINs across resources are not supported.

What is the row limit for CKAN DataStore queries?

DataStore queries return at most 32,000 rows per request. For larger datasets like the 333,556-record tree inventory, paginate using the offset and limit parameters across multiple requests.

Can I query GeoJSON or Shapefile resources through the DataStore API?

No. Only resources with datastore_active set to true are queryable. GeoJSON, Shapefile, PDF, and GBFS resources must be downloaded directly via the FileStore download URL pattern instead.