# Is there a model card and datasets API?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fis-there-a-model-card-and-datasets-api%2F18318%3E%5C
**Category:** Model cards\
**Created:** [May 24, 2022, 4:46pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fis-there-a-model-card-and-datasets-api%2F18318 "2022-05-24T16:46:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lambdaofgod](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lambdaofgod/32/4887_2.png) [@lambdaofgod](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flambdaofgod)%5C
**Post date:** [May 24, 2022, 4:46pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fis-there-a-model-card-and-datasets-api%2F18318%2F1 "2022-05-24T16:46:30Z")

</div>

I want to do an information retrieval project using Huggingface models.

Is there an API which I can use to fetch all available models? Is there something like this for datasets?

If there is no single way to iterate over all models/datasets, is there at least a way to retrieve model cards/dataset information for a given model/dataset using its name?

---

<div class="post-metadata">

**Author:** ![NimaBoscarino](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nimaboscarino/32/4358_2.png) [@NimaBoscarino](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNimaBoscarino)%5C
**Post date:** [May 24, 2022, 6:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fis-there-a-model-card-and-datasets-api%2F18318%2F2 "2022-05-24T18:32:09Z")

</div>

Welcome!

For searching over models and datasets (and Spaces), you could use either the available [Hugging Face Hub Endpoints](https://huggingface.co/docs/hub/endpoints) or the [Hub client library](https://huggingface.co/docs/huggingface_hub/main/en/index) (see [list\_models](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.list_models) and [list\_datasets](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.list_datasets)).

Then you can specifically download the `README.md` file for the dataset or model, which would be the dataset/model card: ([Downloading files](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.hf_hub_download))

I would suggest using the Hugging Face Hub client library so you can do something like:

```python
import huggingface_hub as hf

models = hf.list_models()
datasets = hf.list_datasets()

# Downloads the file and returns the local path
card = hf.hf_hub_download(models[0].modelId, 'README.md') 

```
