# Webhook to track dataset downloads

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwebhook-to-track-dataset-downloads%2F61363%3E%5C
**Category:** 🤗Hub\
**Created:** [November 7, 2023, 9:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwebhook-to-track-dataset-downloads%2F61363 "2023-11-07T09:46:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DataBoutique](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/databoutique/32/20987_2.png) [@DataBoutique](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FDataBoutique)%5C
**Post date:** [November 7, 2023, 9:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwebhook-to-track-dataset-downloads%2F61363%2F1 "2023-11-07T09:46:50Z")

</div>

Can I create a webhook to track when a dataset (any of my datasets) is downloaded?  
We are planning to share a series of datasets publicly on the hub, and would like to track usage with a webhook triggered by any action (downloads, comments, etc) that happen on any of our datasets, to post then a message on Discord. Is that possible?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Wauplin](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wauplin/32/40815_2.png) [@Wauplin](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FWauplin)%5C
**Post date:** [November 17, 2023, 9:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwebhook-to-track-dataset-downloads%2F61363%2F2 "2023-11-17T09:35:43Z")

</div>

Hi @DataBoutique! Sorry for the long delay. It is possible to setup webhooks to be notified on changes on the repo (i.e. any new commit) and community activity (i.e. comment, PR, discussion,…). You can have a look at this guide to learn how to configure it: [Webhooks](https://huggingface.co/docs/hub/webhooks). It is possible to configure a webhook to watch all of your datasets at once if you are interested in that.

Regarding watching download counts, this is not possible. This would not be scalable for us given how often some models/datasets are downloaded (1M+ per day for some popular models). However, it is possible to get from an API the number of downloads of a dataset. For example [bigcode/the-stack](https://huggingface.co/datasets/bigcode/the-stack) has been downloaded 3396 times over the last month and 87245 times overall. This information is available at this url: [https://huggingface.co/api/datasets/bigcode/the-stack?expand[]=downloads&expand[]=downloadsAllTime](https://huggingface.co/api/datasets/bigcode/the-stack?expand%5B%5D=downloads&expand%5B%5D=downloadsAllTime).

---

<div class="post-metadata">

**Author:** ![DataBoutique](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/databoutique/32/20987_2.png) [@DataBoutique](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FDataBoutique)%5C
**Post date:** [November 17, 2023, 9:48am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwebhook-to-track-dataset-downloads%2F61363%2F3 "2023-11-17T09:48:45Z")

</div>

The API solution looks like the right fit, thanks a lot!
