Read one public model from the Hugging Face models API. Pass owner/name from search, or the model page URL. The response is a flat record. For google-bert/bert-base-uncased the id, likes, and downloads match the search card for that same id.
GET https://api.piloterr.com/v2/huggingface/model?query=google-bert/bert-base-uncased
GET https://api.piloterr.com/v2/huggingface/model?query=https://huggingface.co/google-bert/bert-base-uncased
GET and POST take the same query. The record is fill-mask on transformers, license apache-2.0, language en, mask token [MASK], datasets bookcorpus and wikipedia.
| Parameter |
Required |
Example |
query |
yes |
google-bert/bert-base-uncased |
query is required. A model URL on huggingface.co is reduced to the id. Suffixes such as /discussions or /tree/main are removed. The first path segment cannot be a reserved site section (models, datasets, spaces, docs, and similar). Another host returns 400.
| Field |
Type |
Meaning |
id |
string |
Model id, owner/name |
author |
string or null |
Owner |
url |
string |
https://huggingface.co/ plus the id |
pipeline_tag |
string or null |
Task, such as fill-mask |
library_name |
string or null |
Library, such as transformers |
likes |
number or null |
Likes. Same value as the search card when both calls see the same revision |
downloads |
number or null |
Downloads |
trending_score |
number or null |
Trending score |
private |
boolean or null |
Private flag |
gated |
boolean, string, or null |
Gated-access flag. false on bert-base-uncased |
disabled |
boolean or null |
Disabled flag |
sha |
string or null |
Revision |
last_modified |
string or null |
Last update |
created_at |
string or null |
Creation time |
license |
string or null |
License from the model card, such as apache-2.0 |
language |
array or null |
Languages. A single card value becomes a one-item array |
datasets |
array |
Datasets named on the card. Empty array when none are listed |
tags |
array |
Tags |
mask_token |
string or null |
Mask token when the model exposes one, such as [MASK] |
There is no results wrapper.
- Check
apache-2.0 and fill-mask on google-bert/bert-base-uncased before a download.
- Read
mask_token [MASK] and language ["en"] for a fill-mask pipeline.
- Compare
likes and downloads with the search card for the same id.
| Code |
Meaning |
400 |
Empty query, a reserved path, or a domain outside huggingface.co |
401 |
Missing API key |
404 |
No model with that id |
500 |
The fetch failed |
Hugging Face Search