This repository contains a CKAN open-source extension that can be added to any CKAN 2.10+ instance. It was developed by Norwegian Refugee Council (NRC) and Open Knowledge Foundation (OKFN).
CKAN API tracking extension
This extension allows CKAN portals to monitor the use of API tokens by users or service accounts.
Use-cases
NRC uses this extension in the following way:
- Track API usage by dataset and organization.
- Track API usage by users.
- Track API usage by API token.
How it works
This extension adds a new middleware to the CKAN application that intercept all API requests and log them into the CKAN database. A new database table was created to store this information. This table is similar to the current CKAN tracking_raw table (in use at the TrackingMiddleware). Considering the similarities with the CKAN core feature, a possible future for this extension is to capture all calls and unify usage tracking.
This extension also includes a series of dashboards with a summary of the available data. These dashboards are based on the CKAN core StatsPlugin plugin. This extension eventually will attempt to replace the current stats plugin.
All data from this extension is only accessible by sysadmins.
See tracking_type.md for more information on the tracking fields.
Sample screenshots

API endpoints