Hugging Face Spaces API

Operations for managing and querying Spaces on the Hub

Operations 2

GET /spaces List Spaces on the Hub #
GET /spaces/{repo_id} Get Space Information #

Documentation

Specifications

SDKs

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hugging-face-spaces-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hugging-face-spaces-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hugging Face Hub Spaces API
  description: Programmatically interact with the Hugging Face Hub to manage models, datasets, spaces, and repositories. Provides endpoints for listing, searching, creating, and managing resources on the Hub.
  version: 1.0.0
  termsOfService: https://huggingface.co/terms-of-service
  contact:
    name: Hugging Face Support
    url: https://huggingface.co/support
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://huggingface.co/api
  description: Hugging Face Hub API production server
security:
- bearerAuth: []
tags:
- name: Spaces
  description: Operations for managing and querying Spaces on the Hub
paths:
  /spaces:
    get:
      summary: List Spaces on the Hub
      description: List and search Spaces hosted on the Hugging Face Hub. Supports filtering by author, SDK, and full-text search.
      operationId: listSpaces
      tags:
      - Spaces
      security: []
      parameters:
      - name: search
        in: query
        description: Full-text search query
        schema:
          type: string
        example: example_value
      - name: author
        in: query
        description: Filter by Space author or organization
        schema:
          type: string
        example: example_value
      - name: filter
        in: query
        description: Filter by tags
        schema:
          type: string
        example: example_value
      - name: sort
        in: query
        description: Property to sort results by
        schema:
          type: string
          enum:
          - lastModified
          - likes
          - createdAt
        example: lastModified
      - name: direction
        in: query
        description: Sort direction
        schema:
          type: string
          enum:
          - '-1'
          - '1'
        example: '-1'
      - name: limit
        in: query
        description: Number of results to return
        schema:
          type: integer
          default: 30
          maximum: 1000
        example: 10
      responses:
        '200':
          description: List of Spaces matching the query
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SpaceSummary'
              examples:
                Listspaces200Example:
                  summary: Default listSpaces 200 response
                  x-microcks-default: true
                  value:
                  - _id: '500123'
                    id: abc123
                    author: example_value
                    sha: example_value
                    lastModified: '2026-01-15T10:30:00Z'
                    private: true
                    tags:
                    - example_value
                    likes: 10
                    sdk: gradio
                    runtime:
                      stage: RUNNING
                      hardware:
                        current: example_value
                        requested: example_value
                    createdAt: '2026-01-15T10:30:00Z'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /spaces/{repo_id}:
    get:
      summary: Get Space Information
      description: Get detailed information about a specific Space.
      operationId: getSpace
      tags:
      - Spaces
      security: []
      parameters:
      - name: repo_id
        in: path
        required: true
        description: The Space repository ID
        schema:
          type: string
        example: '500123'
      responses:
        '200':
          description: Detailed Space information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceInfo'
              examples:
                Getspace200Example:
                  summary: Default getSpace 200 response
                  x-microcks-default: true
                  value: {}
        '404':
          description: Space not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getspace404Example:
                  summary: Default getSpace 404 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: example_value
        statusCode:
          type: integer
          description: HTTP status code
          example: 10
    SpaceInfo:
      allOf:
      - $ref: '#/components/schemas/SpaceSummary'
      - type: object
        properties:
          siblings:
            type: array
            items:
              type: object
              properties:
                rfilename:
                  type: string
                size:
                  type: integer
          cardData:
            type: object
            description: Parsed Space card metadata
    SpaceSummary:
      type: object
      properties:
        _id:
          type: string
          example: '500123'
        id:
          type: string
          description: Space repository ID
          example: abc123
        author:
          type: string
          example: example_value
        sha:
          type: string
          example: example_value
        lastModified:
          type: string
          format: date-time
          example: '2026-01-15T10:30:00Z'
        private:
          type: boolean
          example: true
        tags:
          type: array
          items:
            type: string
          example: []
        likes:
          type: integer
          example: 10
        sdk:
          type: string
          description: SDK used by the Space
          enum:
          - gradio
          - streamlit
          - docker
          - static
          example: gradio
        runtime:
          type: object
          properties:
            stage:
              type: string
              enum:
              - RUNNING
              - STOPPED
              - BUILDING
              - PAUSED
              - ERROR
            hardware:
              type: object
              properties:
                current:
                  type: string
                requested:
                  type: string
          example: example_value
        createdAt:
          type: string
          format: date-time
          example: '2026-01-15T10:30:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: HF Token
      description: Hugging Face user access token. Generate from https://huggingface.co/settings/tokens