# Hugging Face Space API

Get Hugging Face Space data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as id, output, and retrieve structured data including full Space identifier, sdk, stage, configured compute hardware tier, and direct hosted application URL to monitor live demo availability, audit space dependencies, and explore space source files.

Documentation: https://openany.si/hugging-face/hugging-face-space-api/854a634c-c048-4d25-98be-668cb450541b/
API ID: 854a634c-c048-4d25-98be-668cb450541b
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/huggingface/v1/space
Page update time: 2026-12-03T02:43:38.276Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:43:37.548Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Hugging Face Space API

Pass required id as a Space owner/name slug (such as open-llm-leaderboard/open\_llm\_leaderboard) or a huggingface.co/spaces URL. The JSON response returns app\_url, sdk, stage, hardware, runtime, card\_data, linked models\[\] and datasets\[\], likes and files\_count.

## What You Can Build

- **Monitor live demo availability**: Check stage, runtime and hardware to see whether a hosted Space is running or sleeping.
- **Audit Space dependencies**: Inspect sdk, models\[\], datasets\[\] and license before embedding or duplicating a demo.
- **Explore Space source files**: Combine with the Repo File Tree API (type=space) to inspect app.py, requirements or Dockerfiles.

## Returned Data

| Field | Meaning |
| --- | --- |
| `id` | Full Space identifier (owner/name) |
| `author` | Space owner username or organization |
| `title` | Display title of the Space application |
| `sdk` | App framework such as gradio, streamlit or docker |
| `stage` | Observed runtime stage such as RUNNING or SLEEPING |
| `hardware` | Configured compute hardware tier |
| `app_url` | Direct hosted application URL |
| `likes` | Community like count on the Hub |
| `files_count` | Total number of files in the Space repository |
| `url` | Canonical Hugging Face Space page URL |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hugging Face Space API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The Space id (owner/name) or its huggingface.co link."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      },
      "required": [
        "id"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "app_url": {
      "type": "string"
    },
    "arxiv": {
      "type": "array",
      "items": {}
    },
    "author": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "card_data": {
      "type": "object",
      "properties": {
        "colorFrom": {
          "type": "string"
        },
        "colorTo": {
          "type": "string"
        },
        "duplicated_from": {
          "type": "string"
        },
        "emoji": {
          "type": "string"
        },
        "hf_oauth": {
          "type": "boolean"
        },
        "license": {
          "type": "string"
        },
        "pinned": {
          "type": "boolean"
        },
        "sdk": {
          "type": "string"
        },
        "short_description": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "title": {
          "type": "string"
        }
      }
    },
    "created_at": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "datasets": {
      "type": "array",
      "items": {}
    },
    "disabled": {
      "type": "boolean"
    },
    "emoji": {
      "type": "string"
    },
    "files": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "files_count": {
      "type": "integer"
    },
    "gated": {
      "type": "null"
    },
    "hardware": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "last_modified": {
      "type": "string"
    },
    "license": {
      "type": "string"
    },
    "licenses": {
      "type": "array",
      "items": {}
    },
    "likes": {
      "type": "integer"
    },
    "models": {
      "type": "array",
      "items": {}
    },
    "name": {
      "type": "string"
    },
    "pinned": {
      "type": "boolean"
    },
    "private": {
      "type": "boolean"
    },
    "regions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "runtime": {
      "type": "object",
      "properties": {
        "hardware": {
          "type": "object",
          "properties": {
            "current": {
              "type": "string"
            },
            "requested": {
              "type": "string"
            }
          }
        },
        "replicas": {
          "type": "object",
          "properties": {
            "current": {
              "type": "integer"
            },
            "requested": {
              "type": "integer"
            }
          }
        },
        "sleep_time_seconds": {
          "type": "integer"
        },
        "stage": {
          "type": "string"
        },
        "storage": {
          "type": "null"
        }
      }
    },
    "sdk": {
      "type": "string"
    },
    "sha": {
      "type": "string"
    },
    "short_description": {
      "type": "string"
    },
    "stage": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "title": {
      "type": "string"
    },
    "trending_score": {
      "type": "integer"
    },
    "url": {
      "type": "string"
    },
    "used_storage_bytes": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/huggingface/v1/space?id=open-llm-leaderboard%2Fopen_llm_leaderboard&output=json' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "app_url": "https://open-llm-leaderboard-open-llm-leaderboard.hf.space",
  "arxiv": [],
  "author": "open-llm-leaderboard",
  "cached": false,
  "card_data": {
    "colorFrom": "blue",
    "colorTo": "red",
    "duplicated_from": "open-llm-leaderboard/open_llm_leaderboard",
    "emoji": "🏆",
    "hf_oauth": true,
    "license": "apache-2.0",
    "pinned": true,
    "sdk": "docker",
    "short_description": "Track, rank and evaluate open LLMs and chatbots",
    "tags": [
      "leaderboard",
      "modality:text",
      "… 5 more"
    ],
    "title": "Open LLM Leaderboard"
  },
  "created_at": "2023-04-17T11:40:06.000Z",
  "credits_used": 1,
  "datasets": [],
  "disabled": false,
  "emoji": "🏆",
  "files": [
    ".env.example",
    ".gitignore",
    "… 92 more"
  ],
  "files_count": 94,
  "gated": null,
  "hardware": "cpu-upgrade",
  "id": "open-llm-leaderboard/open_llm_leaderboard",
  "languages": [
    "english"
  ],
  "last_modified": "2026-05-27T08:54:50.000Z",
  "license": "apache-2.0",
  "licenses": [],
  "likes": 14153,
  "models": [],
  "name": "open_llm_leaderboard",
  "pinned": true,
  "private": false,
  "regions": [
    "us"
  ],
  "runtime": {
    "hardware": {
      "current": "cpu-upgrade",
      "requested": "cpu-upgrade"
    },
    "replicas": {
      "current": 1,
      "requested": 1
    },
    "sleep_time_seconds": 172800,
    "stage": "RUNNING",
    "storage": null
  },
  "sdk": "docker",
  "sha": "0ca4edb66d48a3cc9ea8090bb09bd39d846ecc5d",
  "short_description": "Track, rank and evaluate open LLMs and chatbots",
  "stage": "RUNNING",
  "tags": [
    "docker",
    "leaderboard",
    "… 7 more"
  ],
  "title": "Open LLM Leaderboard",
  "trending_score": 4,
  "url": "https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard",
  "used_storage_bytes": 180996299
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Does this endpoint execute or interact with the Space UI?
No. It returns Space metadata, runtime status, configuration and linked resource references in JSON.

### What formats are accepted for the id parameter?
Pass an owner/name Space identifier such as open-llm-leaderboard/open_llm_leaderboard or a full huggingface.co/spaces URL.

### How can I check whether a Space is currently running and on what hardware?
Read the stage, runtime and hardware fields; pass fresh=1 if you need live status instead of a cached snapshot.

### Does it show which models and datasets a Space uses?
Yes. The response includes models[] and datasets[] arrays as declared on the Space record.

### How do I inspect the code files inside the Space?
Call the Hugging Face Repo File Tree API with type=space and the same Space ID.

### How do caching and field selection work?
Output is JSON only. Pass fresh=1 to skip the 24-hour cache, raw=0 to omit bulky raw blocks, or fields to select specific keys.

## Available implementations
- apish: https://openany.si/hugging-face/hugging-face-space-api/854a634c-c048-4d25-98be-668cb450541b/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
