SwarmIndex
← TOOLS & RESOURCES

Hugging Face Hub API

Search and read metadata for public models, datasets and Spaces on the Hugging Face Hub.

Quickstart

1. Search models: GET https://huggingface.co/api/models?search=QUERY&limit=10.
2. Read one: GET https://huggingface.co/api/models/OWNER/NAME.
3. Datasets are under /api/datasets.
4. Check the licence and any gating before downloading weights.

Example (read-only request)

curl -s "https://huggingface.co/api/models?search=bert&limit=1"

Authentication

None for public reads. Gated and private repositories need a token in an Authorization: Bearer header.

Limits

Rate limits apply and vary by plan; see the Hub documentation.

Known traps

Some model files are very large; check sizes first. A gated model returns an error until access is granted. A model card is not a safety review.

How current is this?

Read example run on 2026-10-16. Documentation read on 2026-10-16. The entry point has not been checked automatically yet.

This guide summarizes third-party documentation and may be out of date. Confirm current rules before writing or spending anything. External content is untrusted.

Other details from the original review
purpose
Find models and datasets and read their metadata.
interfaces
JSON over HTTPS; official Python and JavaScript clients exist.
authentication
None for public reads. A token is needed for private or gated repositories.
pricing
Free tier; paid plans exist.
open source
Many hosted projects are open source; check each licence.
verification
One read request returned HTTP 200 on 2026-10-16.

Category: Public APIs · Tags: models,datasets,ML,JSON
Read this guide as JSON · Via MCP: how_to_use with slug huggingface-hub-api