API

From CKAN

Jump to: navigation, search

Use the CKAN API to get at the data catalogue programmatically. In your own web page or program you can:

Examples of use:

The official reference documentation for the CKAN API is in the Administrator Manual: http://docs.ckan.org/en/latest/api.html

This page provides additional information and an overview.

Contents

Introduction to the CKAN API

To use a the CKAN API, your application will make an HTTP request and parse the response. By default, the response format is JSON. Most of the API is RESTful and your methods will be the standard HTTP methods like GET, PUT, POST and DELETE.

CKAN's APIs provide access to all of the objects in the CKAN Domain Model. The standard access url is:

/api/rest/{object-name}/{object-id}

There are API endpoints for:

API Reference Documentation

See the CKAN Administration Guide for the CKAN API Reference: http://docs.ckan.org/en/latest/api.html

Tutorial

Using_the_API

API Client Libraries

There exist clients for the CKAN API in several languages

Javascript Client

The CKAN API can just be used directly from jquery. However, for more sophisticated uses -- as well as a source of code examples -- you may wish to check out the CKAN Javascript client library:

Python client

The Python client is officially maintained by the CKAN core developers.

Command-line client

Datapkg allows you to download the data in CKAN packages on the command-line, in the style of software package managers (e.g. apt-get, cpan, pypi).

PHP client

Ckan_client-PHP is an almost full and (I hope) easy-to-use interface to the CKAN APIs.

Perl client example

This example accesses the CKAN REST API to get a list of the packages, count the uses of an 'extra' field and then plots it with the Google chart API. Luke broke the CKAN bits out into a CKAN specific client library - Net::CKAN.

Luke is open to improving this library and eventually releasing it to CPAN.

Other Code related to CKAN

Drupal module

A Drupal module for integrating with CKAN.

Advanced module:

Simple module:

Other Examples of Using the API

Retrieved from "http://wiki.ckan.org/API"
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox