Morocco Open Data Portal Connector
The Morocco Open Data Connector enables seamless integration with the Morocco Open Data Portal (CKAN), providing access to catalog and dataset data for analytics, visualization, and policy development. It acts as a proxy for dataset enumeration, metadata queries, search operations, and activity tracking.
Integration Overview
This document outlines each integration point, its purpose, configuration, and workflow support using the Morocco Open Data Connector.
- package_list. Retrieves a list of all datasets in the catalog.
- group_list / tag_list. Lists all groups and tags in the catalog.
- package_show / group_show / tag_show. Retrieves metadata for a specific dataset, group, or tag.
- package_search / resource_search. Searches datasets or resources based on a query.
- recently_changed_packages_activity_list. Retrieves an activity stream of recently modified datasets.
Detailed Integration Documentation
Catalog Lists (datasets / groups / tags)
| Action | package_list / group_list / tag_list |
|---|---|
| Purpose | Retrieves all dataset names, all group names, and all tag names in the catalog — the entry point for exploring available data, themes, and keywords. |
| Configuration | Ensure the connector is configured with the appropriate environment variables for authentication and connectivity to the Morocco Open Data Portal. |
| Parameters | package_list optional: limit (default 1000); offset. group_list / tag_list optional: all_fields; limit; query (tag_list — partial match). |
| Output | Successful: JSON with success and result (array of names, or objects when all_fields=true). Failure: API connectivity / invalid query. |
| Workflow example | Execute package_list to identify datasets (e.g. health-statistics), and tag_list to explore keywords. |
Metadata (dataset / group / tag)
| Action | package_show / group_show / tag_show |
|---|---|
| Purpose | Retrieves detailed metadata for a specific dataset (fields and resources), group (thematic collection), or tag (topic). |
| Configuration | Ensure the connector is configured with the appropriate environment variables for authentication and connectivity to the Morocco Open Data Portal. |
| Parameters | Required: id (dataset, group, or tag identifier). Optional: use_default_schema (package_show); include_datasets (group_show / tag_show). |
| Output | Successful: JSON with success and result (an object with the entity’s metadata). Failure: invalid ID. |
| Workflow example | Use package_list to pick a dataset, then package_show with id=health-statistics to plan resource queries. |
Search (datasets / resources)
| Action | package_search / resource_search |
|---|---|
| Purpose | Queries datasets by a search term (with facets and sorting), or queries resources across datasets by field. |
| Configuration | Ensure the connector is configured with the appropriate environment variables for authentication and connectivity to the Morocco Open Data Portal. |
| Parameters | package_search optional: q (e.g. health statistics); fq (e.g. tags:health); sort; rows (default 10, max 1000); start. resource_search required: query (e.g. name:Health Data); optional fields; limit (default 100). |
| Output | Successful: JSON with success and result (count + a results array of datasets or resources). Failure: invalid query. |
| Workflow example | Execute package_search with q=health statistics, then package_show; or resource_search with query=name:Health Data. |
Activity Stream
| Action | recently_changed_packages_activity_list |
|---|---|
| Purpose | Retrieves an activity stream of recently modified datasets — for monitoring updates and timely data access. |
| Configuration | Ensure the connector is configured with the appropriate environment variables for authentication and connectivity to the Morocco Open Data Portal. |
| Parameters | Optional: limit (default 31); offset. |
| Output | Successful: JSON with success and result (an array of activity objects). Failure: API connectivity issues. |
| Workflow example | Execute recently_changed_packages_activity_list to track changes, then package_show to explore modified datasets. |
Example Workflow: Exploring & Analyzing Health Statistics
| Retrieve datasets | Use package_list to fetch datasets and identify a target (e.g. health-statistics). |
|---|---|
| Refine & query | Use package_search with q=health, then package_show with id=health-statistics to identify resources. |
| Search resources | Use resource_search with query=name:Health Data and download relevant files. |
| Monitor & explore | Use recently_changed_packages_activity_list for updates, and group_list / tag_list with group_show / tag_show for related datasets. |
Use Case
A public-policy firm leverages the Morocco Open Data Connector, integrated with GCP, for socio-economic analysis. Using package_list and package_search via the base URL, the firm retrieves datasets like health-statistics in CSV; data is ingested into BigQuery for querying, while package_show fetches metadata stored in Cloud Storage. The recently_changed_packages_activity_list action monitors updates, triggering workflows in Cloud Functions — enabling real-time policy insights and visualizations in Google Data Studio.
For technical support, contact custom-connectors-support@isolutions.sa.