Hugging Face Space API
One Space with its app URL, runtime state, hardware, replicas and the models and datasets it uses.
GET /v1/hugging-face/spaces/{owner}/{name}1 credit Failed requests are free
About this endpoint
GET /v1/hugging-face/spaces/{owner}/{name} returns space. The summary fields include id, url, author, likes, downloads, sdk, spaceStage and tags; the detail adds subdomain, appUrl, region, models, datasets, runtime and card.
runtime carries stage, hardware, requestedHardware, replicas, requestedReplicas and errorMessage. revision selects a branch, tag or commit. HTTP is 200 for every outcome, so check lookupStatus; a private Space returns not_found.
Hugging Face Space API FAQ
How do I get the URL of the running app?
Read space.appUrl. space.subdomain is the host label the app uses.
Why is runtime null?
Some Spaces have no runtime block, for example static Spaces. The repository fields are still present.
Which models and datasets does the Space use?
space.models and space.datasets list the repository ids. They are empty when the Space declares none.
How much does a Space lookup cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth.
Other Hugging Face endpoints
- Search modelsGET /v1/hugging-face/models
- Get modelGET /v1/hugging-face/models/{owner}/{name}
- Search datasetsGET /v1/hugging-face/datasets
- Get datasetGET /v1/hugging-face/datasets/{owner}/{name}
- Search SpacesGET /v1/hugging-face/spaces
- READMEGET /v1/hugging-face/repos/{repoType}/{owner}/{name}/readme
- FilesGET /v1/hugging-face/repos/{repoType}/{owner}/{name}/files
- CommitsGET /v1/hugging-face/repos/{repoType}/{owner}/{name}/commits