Is there a model card and datasets API?

Welcome!

For searching over models and datasets (and Spaces), you could use either the available Hugging Face Hub Endpoints or the Hub client library (see list_models and 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)

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

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') 
3 Likes