# CKAN

> Read open data from any CKAN portal, the software behind hundreds of government and city data sites: search and read datasets, files, organizations, groups and tags, and query table rows by search or SQL.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/ckan

## Actions

### Get a dataset

Get a dataset's details and its resources: each file or link, with its download address.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Dataset (`dataset`, text, required): Pick a dataset, or enter its name or id, or paste a link to its page. The list shows the portal's most recently updated datasets.

**Outputs**

- `author` (text): The author named on the dataset.
- `created_at` (text): When the dataset was created on the portal.
- `datastore_resource_ids` (list): The ids of the resources whose rows can be searched, ready for Search a resource's records.
- `description` (text): The dataset's description, often in Markdown.
- `groups` (list): The short names of the groups it belongs to.
- `id` (text): The dataset's id.
- `license` (text): The licence the data is published under.
- `maintainer` (text): The maintainer named on the dataset.
- `maintainer_email` (text): The maintainer's email address.
- `name` (text): The dataset's short name, as used in its web address.
- `organization` (text): The short name of the organization that publishes it.
- `organization_title` (text): The publishing organization's full name.
- `resource_count` (number): How many resources (files and links) it has.
- `resources` (list): The dataset's files and links.
- `source_url` (text): A link to the data's original source, when given.
- `tags` (list): The dataset's tags.
- `title` (text): The dataset's title.
- `updated_at` (text): When the dataset or its resources last changed.
- `url` (text): The dataset's page on the portal.

**Example output**

```json
{
  "author": null,
  "created_at": "2017-01-10T19:30:20.779833",
  "datastore_resource_ids": [
    "254adca6-64ab-4c5c-9fc0-a6da622be185"
  ],
  "description": "This data set includes all channels of engagement in which a service request is created.",
  "groups": [
    "city-services"
  ],
  "id": "8048697b-ad64-4bfc-b090-ee00169f2323",
  "license": "Open Data Commons Public Domain Dedication and License (PDDL)",
  "maintainer": null,
  "maintainer_email": null,
  "name": "311-service-requests",
  "organization": "boston-311-org",
  "organization_title": "Boston 311",
  "resource_count": 2,
  "resources": [
    {
      "created_at": "2025-10-28T16:43:44.225893",
      "dataset_id": "8048697b-ad64-4bfc-b090-ee00169f2323",
      "datastore_active": true,
      "description": null,
      "format": "CSV",
      "id": "254adca6-64ab-4c5c-9fc0-a6da622be185",
      "mimetype": null,
      "name": "311 Service Requests - NEW SYSTEM",
      "page_url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/254adca6-64ab-4c5c-9fc0-a6da622be185",
      "size_bytes": 488098,
      "updated_at": "2026-10-15T15:20:19.005832",
      "url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/254adca6-64ab-4c5c-9fc0-a6da622be185/download/tmp_qi__s0s.csv"
    },
    {
      "created_at": "2025-09-22T13:40:07.682283",
      "dataset_id": "8048697b-ad64-4bfc-b090-ee00169f2323",
      "datastore_active": false,
      "description": null,
      "format": "PDF",
      "id": "6e443a5d-8027-41d5-9574-35e8f84b8284",
      "mimetype": null,
      "name": null,
      "page_url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/6e443a5d-8027-41d5-9574-35e8f84b8284",
      "size_bytes": 88578,
      "updated_at": "2025-09-22T13:43:02.875983",
      "url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/6e443a5d-8027-41d5-9574-35e8f84b8284/download/311-service-requests-data-dictionary-new-system.pdf"
    }
  ],
  "source_url": null,
  "tags": [
    "311",
    "pothole",
    "street lights",
    "trash"
  ],
  "title": "311 Service Requests",
  "updated_at": "2026-10-15T15:20:19.050811",
  "url": "https://data.boston.gov/dataset/311-service-requests"
}
```

### Get a group

Get one group's details and how many datasets it has.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Group (`group`, text, required): Pick a group, or enter its short name or id, or paste a link to its page.

**Outputs**

- `created_at` (text): When it was created on the portal.
- `dataset_count` (number): How many public datasets it has.
- `description` (text): The description, which may contain HTML.
- `id` (text): The id.
- `image_url` (text): Its logo or icon, when it has one.
- `name` (text): The short name, as used in its web address.
- `title` (text): The full name.
- `url` (text): Its page on the portal.

**Example output**

```json
{
  "created_at": "2016-10-04T16:55:03.079073",
  "dataset_count": 16,
  "description": null,
  "id": "5287bf7d-3e3f-40a4-96ac-c0b0377fa0ae",
  "image_url": "https://data.boston.gov/uploads/group/2017-01-17-210311.757864governmentbuilding160.png",
  "name": "city-services",
  "title": "City Services",
  "url": "https://data.boston.gov/group/city-services"
}
```

### Get a resource

Get one of a dataset's resources (a file or link): its format, size, download address and whether its rows can be searched.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Dataset (`dataset`, text): The dataset the resource belongs to. Only used to fill the Resource list.
- Resource (`resource`, text, required): Pick a resource, or enter its id, or paste a link to its page.

**Outputs**

- `created_at` (text): When the resource was added (ISO 8601, portal time).
- `dataset_id` (text): The id of the dataset the resource belongs to.
- `datastore_active` (true/false): True when the portal holds this file as a table, so Search a resource's records and Run a SQL query can read its rows.
- `description` (text): What the resource holds.
- `format` (text): The file format, such as CSV, JSON or PDF.
- `id` (text): The resource's id. Use it in Get a resource or Search a resource's records.
- `mimetype` (text): The file's media type, when the portal knows it.
- `name` (text): The resource's name, when it has one.
- `page_url` (text): The resource's page on the portal.
- `size_bytes` (number): The file's size in bytes, when the portal knows it.
- `updated_at` (text): When the file or its details last changed.
- `url` (text): The link to download the file, or the page or service it points to.

**Example output**

```json
{
  "created_at": "2025-10-28T16:43:44.225893",
  "dataset_id": "8048697b-ad64-4bfc-b090-ee00169f2323",
  "datastore_active": true,
  "description": null,
  "format": "CSV",
  "id": "254adca6-64ab-4c5c-9fc0-a6da622be185",
  "mimetype": null,
  "name": "311 Service Requests - NEW SYSTEM",
  "page_url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/254adca6-64ab-4c5c-9fc0-a6da622be185",
  "size_bytes": 488098,
  "updated_at": "2026-10-15T15:20:19.005832",
  "url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/254adca6-64ab-4c5c-9fc0-a6da622be185/download/tmp_qi__s0s.csv"
}
```

### Get an organization

Get one organization's details and how many datasets it has.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Organization (`organization`, text, required): Pick an organization, or enter its short name or id, or paste a link to its page.

**Outputs**

- `created_at` (text): When it was created on the portal.
- `dataset_count` (number): How many public datasets it has.
- `description` (text): The description, which may contain HTML.
- `id` (text): The id.
- `image_url` (text): Its logo or icon, when it has one.
- `name` (text): The short name, as used in its web address.
- `title` (text): The full name.
- `url` (text): Its page on the portal.

**Example output**

```json
{
  "created_at": "2017-01-16T20:39:55.773887",
  "dataset_count": 2,
  "description": "311 is an easy-to-remember telephone number that connects you with highly-trained Constituent Service Center representatives.",
  "id": "188d8440-c096-492a-8798-4a44ccc6faaa",
  "image_url": "https://data.boston.gov/uploads/group/2020-01-13-191403.177390bos311icon.svg",
  "name": "boston-311-org",
  "title": "Boston 311",
  "url": "https://data.boston.gov/organization/boston-311-org"
}
```

### Get portal info

Check a portal is up and see its name, CKAN version and whether it has a DataStore for searching rows.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.

**Outputs**

- `api_url` (text): Where the portal's CKAN API answers.
- `ckan_version` (text): The version of CKAN it runs.
- `datastore_enabled` (true/false): True when the portal has the DataStore, so table rows can be searched.
- `description` (text): The portal's description.
- `extensions` (list): The CKAN extensions the portal has turned on.
- `locale` (text): The portal's default language.
- `title` (text): The portal's name.
- `url` (text): The portal's web address.

**Example output**

```json
{
  "api_url": "https://data.boston.gov/api/3",
  "ckan_version": "2.9.11",
  "datastore_enabled": true,
  "description": "Boston's Open Data Hub",
  "extensions": [
    "stats",
    "harvest",
    "dcat",
    "datastore",
    "xloader",
    "showcase"
  ],
  "locale": "en",
  "title": "Analyze Boston",
  "url": "https://data.boston.gov"
}
```

### List datasets

List the names of all a portal's public datasets, in name order.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Results (`limit`, number): How many to return. From 1 to 1000. Default: `100`.
- Skip (`offset`, number): How many to skip first, to page through long lists. From 0 to 1000000. Default: `0`.

**Outputs**

- `count` (number): How many datasets are on this page.
- `datasets` (list): The datasets on this page, in name order.
- `has_more` (true/false): True when this page was full, so more may follow.

**Example output**

```json
{
  "count": 2,
  "datasets": [
    {
      "name": "1920-women-s-voter-register",
      "url": "https://data.boston.gov/dataset/1920-women-s-voter-register"
    },
    {
      "name": "2011-contours-1ft",
      "url": "https://data.boston.gov/dataset/2011-contours-1ft"
    }
  ],
  "has_more": true
}
```

### List groups

List a portal's groups: themed collections of datasets, such as Transportation or Health.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Sort by (`sort`, text): The order to list them in. One of: `name`, `most_datasets` (Most datasets). Default: `name`.
- Results (`limit`, number): How many to return. From 1 to 1000. Default: `100`.
- Skip (`offset`, number): How many to skip first, to page through long lists. From 0 to 1000000. Default: `0`.

**Outputs**

- `count` (number): How many are on this page.
- `groups` (list): The groups on this page.

**Example output**

```json
{
  "count": 1,
  "groups": [
    {
      "created_at": "2016-10-04T16:55:03.079073",
      "dataset_count": 16,
      "description": null,
      "id": "5287bf7d-3e3f-40a4-96ac-c0b0377fa0ae",
      "image_url": "https://data.boston.gov/uploads/group/2017-01-17-210311.757864governmentbuilding160.png",
      "name": "city-services",
      "title": "City Services",
      "url": "https://data.boston.gov/group/city-services"
    }
  ]
}
```

### List organizations

List the organizations that publish on a portal, such as a city's departments, with how many datasets each has.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Sort by (`sort`, text): The order to list them in. One of: `name`, `most_datasets` (Most datasets). Default: `name`.
- Results (`limit`, number): How many to return. From 1 to 1000. Default: `100`.
- Skip (`offset`, number): How many to skip first, to page through long lists. From 0 to 1000000. Default: `0`.

**Outputs**

- `count` (number): How many are on this page.
- `organizations` (list): The organizations on this page.

**Example output**

```json
{
  "count": 2,
  "organizations": [
    {
      "created_at": "2017-01-16T20:33:05.935247",
      "dataset_count": 5,
      "description": "We manage, preserve, and provide access to the municipal government records of Boston.",
      "id": "af233dff-e05c-4ada-9bfa-e783f81d5c66",
      "image_url": "https://data.boston.gov/uploads/group/2020-01-13-191317.250697archivesandrecordsicon.svg",
      "name": "archives-and-record-management-org",
      "title": "Archives and Record Management",
      "url": "https://data.boston.gov/organization/archives-and-record-management-org"
    },
    {
      "created_at": "2017-01-16T20:39:55.773887",
      "dataset_count": 2,
      "description": "311 is an easy-to-remember telephone number that connects you with highly-trained Constituent Service Center representatives.",
      "id": "188d8440-c096-492a-8798-4a44ccc6faaa",
      "image_url": "https://data.boston.gov/uploads/group/2020-01-13-191403.177390bos311icon.svg",
      "name": "boston-311-org",
      "title": "Boston 311",
      "url": "https://data.boston.gov/organization/boston-311-org"
    }
  ]
}
```

### List tags

List the tags used on a portal's datasets, or those containing some text.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Containing (`query`, text): Only tags containing this text. Leave empty for all.
- Results (`limit`, number): How many to return. From 1 to 1000. Default: `100`.

**Outputs**

- `count` (number): How many tags are listed here.
- `tags` (list): The tags, in the portal's order.
- `total` (number): How many tags matched before the limit.

**Example output**

```json
{
  "count": 3,
  "tags": [
    "Affordable Housing",
    "housing",
    "Housing a Changing City"
  ],
  "total": 8
}
```

### Run a SQL query

Query a portal's DataStore tables with a read-only SQL SELECT, to count, group or join rows. Name a table by its resource id in double quotes. Many portals turn this off.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- SQL query (`sql`, text, required): A SELECT statement, such as SELECT neighborhood, COUNT(*) FROM "<resource id>" GROUP BY neighborhood.

**Outputs**

- `count` (number): How many rows the query returned.
- `fields` (list): The columns in the rows, in order.
- `records` (list): The rows, each keyed by column name.

**Example output**

```json
{
  "count": 2,
  "fields": [
    {
      "name": "neighborhood",
      "type": "text"
    },
    {
      "name": "cases",
      "type": "int8"
    }
  ],
  "records": [
    {
      "cases": 10450,
      "neighborhood": "Dorchester"
    },
    {
      "cases": 6361,
      "neighborhood": "South End"
    }
  ]
}
```

### Search a resource's records

Read the rows of a table the portal holds in its DataStore: search them by words, match columns exactly, choose columns and sort. Not every portal has a DataStore.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Dataset (`dataset`, text): The dataset the table belongs to. Only used to fill the Resource list.
- Resource (`resource`, text, required): The table to read. Pick one, or enter a resource id, or paste a link to the resource's page.
- Search words (`query`, text): Only rows containing these words, in any column.
- Exact matches (`filters`, object): Only rows whose column holds exactly this value, such as neighborhood = Dorchester.
- Columns (`columns`, list): The columns to return. Leave empty for all.
- Sort by column (`sort_column`, text): The column to sort the rows by.
- Sort direction (`sort_direction`, text): Which way to sort. One of: `asc` (Ascending (A to Z, smallest first)), `desc` (Descending (Z to A, largest first)). Default: `asc`.
- Rows (`limit`, number): How many rows to return. From 1 to 1000. Default: `100`.
- Skip (`offset`, number): How many to skip first, to page through long lists. From 0 to 1000000. Default: `0`.

**Outputs**

- `count` (number): How many rows are on this page.
- `fields` (list): The columns in the rows, in order.
- `records` (list): The rows, each keyed by column name.
- `resource_id` (text): The resource whose rows these are.
- `total` (number): How many rows match in all, beyond this page.

**Example output**

```json
{
  "count": 2,
  "fields": [
    {
      "name": "case_id",
      "type": "text"
    },
    {
      "name": "case_topic",
      "type": "text"
    },
    {
      "name": "neighborhood",
      "type": "text"
    },
    {
      "name": "open_date",
      "type": "text"
    },
    {
      "name": "case_status",
      "type": "text"
    }
  ],
  "records": [
    {
      "case_id": "BCS-00253943",
      "case_status": "Closed",
      "case_topic": "Litter & Debris",
      "neighborhood": "South End",
      "open_date": "2026-07-14 10:56:30.994145+00"
    },
    {
      "case_id": "BCS-00240446",
      "case_status": "Closed",
      "case_topic": "Litter & Debris",
      "neighborhood": "Dorchester",
      "open_date": "2026-07-01 10:42:58.103557+00"
    }
  ],
  "resource_id": "254adca6-64ab-4c5c-9fc0-a6da622be185",
  "total": 70208
}
```

### Search datasets

Find datasets on a CKAN portal by words, publisher, tag, file format or group.

**Inputs**

- Portal (`portal`, text, required): The CKAN portal's web address, such as data.boston.gov or data.gov.au. A link to any page on the portal works too.
- Search words (`query`, text): Words to look for in titles, descriptions and tags. Leave empty to list every dataset.
- Organization (`organization`, text): Only datasets this organization publishes.
- Tag (`tag`, text): Only datasets with this tag.
- File format (`file_format`, text): Only datasets with a file in this format, such as CSV.
- Group (`group`, text): Only datasets in this group (a themed collection).
- Sort by (`sort`, text): The order to return datasets in. One of: `relevance` (Best match), `recently_updated` (Recently updated), `newest`, `title_asc` (Title A to Z), `title_desc` (Title Z to A). Default: `relevance`.
- Results (`rows`, number): How many datasets to return. From 1 to 1000. Default: `10`.
- Skip (`start`, number): How many matches to skip first, to page through them. From 0 to 1000000. Default: `0`.

**Outputs**

- `count` (number): How many datasets match in all, beyond this page.
- `datasets` (list): The matching datasets on this page.
- `has_more` (true/false): True when more matches follow; raise Skip to see them.

**Example output**

```json
{
  "count": 9,
  "datasets": [
    {
      "author": null,
      "created_at": "2017-01-10T19:30:20.779833",
      "datastore_resource_ids": [
        "254adca6-64ab-4c5c-9fc0-a6da622be185"
      ],
      "description": "This data set includes all channels of engagement in which a service request is created.",
      "groups": [
        "city-services"
      ],
      "id": "8048697b-ad64-4bfc-b090-ee00169f2323",
      "license": "Open Data Commons Public Domain Dedication and License (PDDL)",
      "maintainer": null,
      "maintainer_email": null,
      "name": "311-service-requests",
      "organization": "boston-311-org",
      "organization_title": "Boston 311",
      "resource_count": 2,
      "resources": [
        {
          "created_at": "2025-10-28T16:43:44.225893",
          "dataset_id": "8048697b-ad64-4bfc-b090-ee00169f2323",
          "datastore_active": true,
          "description": null,
          "format": "CSV",
          "id": "254adca6-64ab-4c5c-9fc0-a6da622be185",
          "mimetype": null,
          "name": "311 Service Requests - NEW SYSTEM",
          "page_url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/254adca6-64ab-4c5c-9fc0-a6da622be185",
          "size_bytes": 488098,
          "updated_at": "2026-10-15T15:20:19.005832",
          "url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/254adca6-64ab-4c5c-9fc0-a6da622be185/download/tmp_qi__s0s.csv"
        },
        {
          "created_at": "2025-09-22T13:40:07.682283",
          "dataset_id": "8048697b-ad64-4bfc-b090-ee00169f2323",
          "datastore_active": false,
          "description": null,
          "format": "PDF",
          "id": "6e443a5d-8027-41d5-9574-35e8f84b8284",
          "mimetype": null,
          "name": null,
          "page_url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/6e443a5d-8027-41d5-9574-35e8f84b8284",
          "size_bytes": 88578,
          "updated_at": "2025-09-22T13:43:02.875983",
          "url": "https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/6e443a5d-8027-41d5-9574-35e8f84b8284/download/311-service-requests-data-dictionary-new-system.pdf"
        }
      ],
      "source_url": null,
      "tags": [
        "311",
        "pothole",
        "street lights",
        "trash"
      ],
      "title": "311 Service Requests",
      "updated_at": "2026-10-15T15:20:19.050811",
      "url": "https://data.boston.gov/dataset/311-service-requests"
    }
  ],
  "has_more": true
}
```
