How to count a dataset's downloads over a specific period

Edited

When working with datasets on the Opendatasoft platform, it can be useful to track and quantify how many times they have been downloaded, whether it be to assess the dataset's popularity or just monitor its usage.

In this article, we explain how you can use the ods-api-monitoring dataset to count a dataset's downloads over a specified period.

This is a common way to use this data. See here for more information about the different fields in the monitoring datasets that might interest you.

The relevant "api" field values

To analyze downloads, we will rely on the following values under the "api" column in the "ods-api-monitoring" dataset:

  • export_dataset: This represents an export of the dataset from the explore API v2 and from the export tab.

  • download_dataset & download_dataset_records: These represents an export of the dataset records from the explore API v1.

  • alternative_exports_lookup: This represents an alternative export of the dataset from the explore API v2 and from the export tab.

  • download_dataset_alternative_export: This represents an alternative export of the dataset records from the explore API v1.

Filtering the data

Before starting the analyzing process, it's crucial to set a specific filter for the period and dataset in question. Here's an example of a filter in the ods-api-monitoring dataset view:

(api:export_dataset or api:download_dataset or api:download_dataset_records or api: alternative_exports_lookup or api:download_dataset_alternative_export) and #null(attributes) and timestamp:[2023-10-01T00:00:00Z TO 2023-10-15T00:00:00Z] and dataset_id:"<your-dataset-id>"

This filter will allow you to display only the dataset downloads for your dataset over a two-week period in October 2023.

Why not just use "download_count"?

There is a significant difference between the download values obtained from the ods-api-monitoring dataset and the "download_count" column in the ods-datasets-monitoring dataset.

This "download_count" column counts the total number of downloads made since the dataset was created.

In contrast, the data you filter from the ods-api-monitoring dataset data provides the number of downloads over a specified period.