API Anything

Hugging Face APIunofficial

Hugging Face Hub: search public models, datasets and Spaces, and read their repository metadata while logged out.

all live 7 operations, checked by the installs that call them.

Seeded by the maintainers.

Try it

Set up API Anything for your agents:

npx -y api-anything setup

Then ask your agent, which finds this site by itself, or call it from a shell:

api-anything pull huggingface
api-anything call huggingface getDataset author=openai name=gsm8k

Operations

OperationMethodLoginWritesStatus
getDataset(author, name) -> id, description, downloads, likes, tags, taskCategories, sizeCategories, license, lastModified

Read a public dataset's card summary, downloads, likes, tags, task categories, size categories, license and last modification time.

GET no no Live0 confirmations · success unknown; last worked unknown
getModel(author, name) -> id, author, task, library, license, parameters, downloads, likes, createdAt, lastModified, gated, tags

One model's record: id, author, task, library, license, parameters (from its safetensors files), downloads, likes, createdAt, lastModified, gated and tags.

GET no no Live0 confirmations · success unknown; last worked unknown
getModelFiles(author, name) -> path, size, type

List the first page of files and directories at the root of a public model repository on its main revision, without downloading file contents.

GET no no Live0 confirmations · success unknown; last worked unknown
getSpace(author, name) -> id, title, emoji, sdk, runtimeStage, hardware, likes, models, datasets, lastModified

Read a public Space's title, SDK, runtime stage, hardware, likes and linked model and dataset repositories.

GET no no Live0 confirmations · success unknown; last worked unknown
searchDatasets(q) -> id, author, downloads, likes, lastModified, gated, rows, modalities

Search datasets by name, as typed into the Filter by name box on huggingface.co/datasets (trending order, up to 30): id, author, downloads, likes, lastModified, gated, rows and modalities.

GET no no Live0 confirmations · success unknown; last worked unknown
searchModels(q, sort?) -> id, author, name, task, downloads, likes, lastModified, gated

Search models by repository name, returning up to 30 results in the chosen order.

GET no no Live0 confirmations · success unknown; last worked unknown
searchSpaces(q) -> id, title, emoji, sdk, likes, lastModified

Search public Spaces by name, returning the first page of titles, SDKs, emoji, likes and last modification times.

GET no no Live0 confirmations · success unknown; last worked unknown

Notes

No account is needed. Reads public repositories only.

  • searchModels and searchDatasets match words in the repository id (owner/name), not in the model card, sorted by trending by default, first page (30) only. searchModels also accepts sort=likes, downloads, created or modified.
  • getModel takes the id split in two: openai/whisper-large-v3 is author=openai, name=whisper-large-v3 (both come back from searchModels). The case of the id matters (Qwen, not qwen).
  • A model id that doesn't exist, or a private one, answers class: "auth" (Hugging Face sends HTTP 401 rather than 404 for both). Check the id with searchModels before anything else: a login does not help with a public model.
  • gated is false, "auto" or "manual": a gated model's record is public, but its files need an account that accepted its terms.
  • task (the pipeline tag), license, library and parameters are missing when the repository doesn't declare them; parameters is counted only from safetensors weights.
  • In searchDatasets, rows and modalities come from the dataset viewer and are missing for a dataset it can't read.
  • getDataset and getSpace also take case-sensitive author and name parts of a repository id. Dataset card fields can be absent; the description is a shortened card summary and license can be a string or a list.
  • searchSpaces returns the first page, including Spaces that are not running. A Space's linked models or datasets, runtime hardware, SDK, title and emoji may be absent when not declared. Runtime status can change independently of the repository's last modification time.
  • getModelFiles lists the root of the main revision, not subdirectories or other revisions. It returns the first page only, with sizes in bytes; a directory's size may be zero. It does not download file contents.

About these operations

Each operation is a request learned from Hugging Face's own web pages: API Anything replays it over plain HTTP and falls back to a browser when it must. Read them as JSON.

← All shared sites