# List all tasks from hfapi

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flist-all-tasks-from-hfapi%2F68661%3E%5C
**Category:** Models\
**Created:** [January 10, 2024, 12:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flist-all-tasks-from-hfapi%2F68661 "2024-01-10T12:30:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodas96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rodas96/32/22863_2.png) [@Rodas96](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FRodas96)%5C
**Post date:** [January 10, 2024, 12:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flist-all-tasks-from-hfapi%2F68661%2F1 "2024-01-10T12:30:35Z")

</div>

Is it possible to list all tasks from hfapi like object detection etc.

And then search for the top 50 downloaded models for each task? thanks 🙂

---

<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:** [January 12, 2024, 10:01am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flist-all-tasks-from-hfapi%2F68661%2F2 "2024-01-12T10:01:22Z")

</div>

Hi @Rodas96, I don’t think there is a built-in way to to list all tasks using `HfApi`. However, you can call [https://huggingface.co/api/tasks](https://huggingface.co/api/tasks) which is the JSON equivalent of this page ([Tasks - Hugging Face](https://huggingface.co/tasks)) on which we maintain a list of tasks with documentation, examples and suggested models for each task.

Once you’ve retrieved this list of tasks, you can search for the top downloaded models using [list\_models](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.list_models). The output is a generator looping through the models returned by the server.

```py
from huggingface_hub import list_models

for model in list_models(limit=10, sort="downloads", direction=-1, filter="object-detection"):
    print(model.id, model.downloads)

```

```auto
microsoft/table-transformer-detection 1132061
microsoft/table-transformer-structure-recognition 842637
facebook/detr-resnet-50 463835
hustvl/yolos-tiny 260857
facebook/detr-resnet-101 135484
TahaDouaji/detr-doc-table-detection 86751
hustvl/yolos-small 71631
microsoft/table-transformer-structure-recognition-v1.1-all 59846
fcakyon/yolov5s-v7.0 34056
keremberke/yolov5n-license-plate 28780

```

---

<div class="post-metadata">

**Author:** ![Rodas96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rodas96/32/22863_2.png) [@Rodas96](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FRodas96)%5C
**Post date:** [January 15, 2024, 1:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flist-all-tasks-from-hfapi%2F68661%2F3 "2024-01-15T13:10:59Z")

</div>

tyvm @Wauplin 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [January 16, 2024, 1:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flist-all-tasks-from-hfapi%2F68661%2F4 "2024-01-16T01:11:30Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
