Hugging Face APIunofficial
Hugging Face Hub: search public models, datasets and Spaces, and read their repository metadata while logged out.
- huggingface.co
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 setupThen 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=gsm8kOperations
| Operation | Method | Login | Writes | Status |
|---|---|---|---|---|
getDataset(author, name) -> id, description, downloads, likes, tags, taskCategories, sizeCategories, license, lastModifiedRead 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, tagsOne 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, typeList 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, lastModifiedRead 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, modalitiesSearch 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, gatedSearch 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, lastModifiedSearch 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.
searchModelsandsearchDatasetsmatch words in the repository id (owner/name), not in the model card, sorted by trending by default, first page (30) only.searchModelsalso acceptssort=likes,downloads,createdormodified.getModeltakes the id split in two:openai/whisper-large-v3isauthor=openai,name=whisper-large-v3(both come back fromsearchModels). The case of the id matters (Qwen, notqwen).- 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 withsearchModelsbefore anything else: a login does not help with a public model. gatedisfalse,"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,libraryandparametersare missing when the repository doesn't declare them;parametersis counted only from safetensors weights.- In
searchDatasets,rowsandmodalitiescome from the dataset viewer and are missing for a dataset it can't read. getDatasetandgetSpacealso take case-sensitiveauthorandnameparts of a repository id. Dataset card fields can be absent; the description is a shortened card summary andlicensecan be a string or a list.searchSpacesreturns 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.getModelFileslists the root of themainrevision, 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.