{
  "openapi": "3.0.1",
  "info": {
    "title": "Hugging Face Scraper: Models, Datasets & Spaces",
    "description": "Scrape Hugging Face Hub models, datasets and Spaces by keyword, author or task: downloads, likes, trending score, gated status, plus license, parameter count and file lists. Export CSV, Excel, JSON, XML. No login or API key. Pay per record from $0.015.",
    "version": "0.1",
    "x-build-id": "bYdgujhHL8PXwWH6b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~huggingface-hub-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-huggingface-hub-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/recordsdata~huggingface-hub-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-huggingface-hub-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/recordsdata~huggingface-hub-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-huggingface-hub-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search on the Hugging Face Hub, one search per term (for example \"llama\", \"sentiment analysis\", \"stable diffusion\"). Applies to models, datasets, Spaces, papers (full-text paper search, up to 100 per term) and collections. Leave empty to browse by author, task or filters only; with no terms and no author the Hub's top results for the chosen sort order are returned.",
            "items": {
              "type": "string"
            }
          },
          "author": {
            "title": "Author / organization",
            "type": "string",
            "description": "Only return records published by this Hugging Face author or organization, for example meta-llama, google or mistralai. For collections it is the collection owner. Leave empty for all authors.",
            "default": ""
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of records to return across all surfaces. Surfaces are read in the order Models, Datasets, Spaces, Papers, Collections until this limit is reached. Free users are limited to 10 records (preview); paid users can go up to 1,000,000. Each record is billed per event, so this also caps your cost.",
            "default": 10
          },
          "includeModels": {
            "title": "Models",
            "type": "boolean",
            "description": "Scrape model records (downloads, likes, trending score, pipeline task, tags).",
            "default": true
          },
          "includeDatasets": {
            "title": "Datasets",
            "type": "boolean",
            "description": "Scrape dataset records for the same search terms.",
            "default": false
          },
          "includeSpaces": {
            "title": "Spaces",
            "type": "boolean",
            "description": "Scrape Space records (demo apps) for the same search terms.",
            "default": false
          },
          "includePapers": {
            "title": "Papers",
            "type": "boolean",
            "description": "Scrape Hugging Face papers: title, abstract, authors, upvotes, comments, GitHub repository and stars, project page, organization and AI summary. With search terms it searches all papers; otherwise it reads the daily papers feed (set the date range below for a period).",
            "default": false
          },
          "includeCollections": {
            "title": "Collections",
            "type": "boolean",
            "description": "Scrape Hugging Face collections (curated lists of models, datasets, Spaces and papers): title, owner, upvotes, last update and the first items. Search terms match collection titles and descriptions; Author / organization selects the owner.",
            "default": false
          },
          "pipelineTag": {
            "title": "Task (pipeline tag)",
            "enum": [
              "",
              "text-generation",
              "text-classification",
              "token-classification",
              "question-answering",
              "zero-shot-classification",
              "translation",
              "summarization",
              "feature-extraction",
              "text2text-generation",
              "fill-mask",
              "sentence-similarity",
              "text-to-speech",
              "text-to-audio",
              "automatic-speech-recognition",
              "audio-to-audio",
              "audio-classification",
              "text-to-image",
              "image-to-text",
              "image-to-image",
              "image-text-to-text",
              "text-to-video",
              "image-classification",
              "object-detection",
              "image-segmentation",
              "depth-estimation",
              "video-classification",
              "visual-question-answering",
              "document-question-answering",
              "zero-shot-image-classification",
              "mask-generation",
              "text-ranking",
              "reinforcement-learning",
              "robotics",
              "tabular-classification",
              "tabular-regression",
              "time-series-forecasting",
              "any-to-any"
            ],
            "type": "string",
            "description": "Only return models for this Hugging Face task (pipeline tag), such as text-generation or text-to-image. Applies to models only. Leave on Any task for no filter.",
            "default": ""
          },
          "library": {
            "title": "Library",
            "type": "string",
            "description": "Only models (or datasets) tagged with this library or file format, for example transformers, diffusers, gguf, peft, sentence-transformers or llama.cpp. It is an exact Hub tag; a name that does not exist returns no records. Does not apply to Spaces.",
            "default": ""
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Only models (or datasets) tagged with this language code, for example en, fr, es, de, zh or pt. Use the ISO 639 code the Hub uses as a tag. Does not apply to Spaces.",
            "default": ""
          },
          "license": {
            "title": "License",
            "type": "string",
            "description": "Only models (or datasets) with this license id, for example apache-2.0, mit, cc-by-4.0, openrail or llama3. Use the id the Hub shows on the license badge. Does not apply to Spaces.",
            "default": ""
          },
          "filterTags": {
            "title": "Tags (all must match)",
            "type": "array",
            "description": "Extra Hub tags every record must carry, one per line, for example text-generation, gguf, license:mit, task_categories:text-classification, size_categories:1K<n<10K or gradio (Spaces SDK). Models use plain tags; datasets use prefixed tags such as language:fr. A tag that does not exist returns no records.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minDownloads": {
            "title": "Minimum downloads (30 days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only models and datasets with at least this many downloads in the last 30 days. Applied after reading each page; when Sort by is Downloads the run stops reading as soon as the downloads fall below the minimum. Leave 0 for no minimum. Not used for Spaces, papers or collections.",
            "default": 0
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only records with at least this many likes (upvotes for papers and collections). Applied after reading each page; when Sort by is Likes the run stops reading as soon as likes fall below the minimum. Leave 0 for no minimum.",
            "default": 0
          },
          "modifiedFrom": {
            "title": "Modified since",
            "type": "string",
            "description": "Only models, datasets, Spaces and collections last modified on or after this date. Use YYYY-MM-DD (for example 2026-09-01) or a relative value: 7d, 4w, 3m, 1y, today, yesterday. When Sort by is Last modified the run stops reading as soon as it passes the date. Leave empty for no date filter.",
            "default": ""
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "trendingScore",
              "downloads",
              "likes",
              "lastModified",
              "createdAt"
            ],
            "type": "string",
            "description": "Sort order of the Hub results: trending score, downloads, likes, last modified date or creation date. Spaces have no downloads and use likes instead; collections can be sorted by trending, likes (upvotes) or last modified.",
            "default": "trendingScore"
          },
          "sortDirection": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Descending returns the highest or newest first. Ascending (oldest first) is only supported by the Hub when Sort by is Created at; any other combination stops the run before any request with a clear message.",
            "default": "desc"
          },
          "includeModelDetails": {
            "title": "Full model details",
            "type": "boolean",
            "description": "Adds license, parameter count, base model (with its relation: finetune, quantized, adapter or merge) and the file list (first 50 files and the total count) to each model. Billed as a separate event per model.",
            "default": false
          },
          "includeReadme": {
            "title": "README / model card text",
            "type": "boolean",
            "description": "Adds the full README text (the model, dataset or Space card, including its YAML header, up to 100,000 characters) as the readme field. One extra request per record. Gated or private repositories return no README unless your Hugging Face token has access; records without a README are delivered without the field. May be billed as a separate event, see the Pricing tab.",
            "default": false
          },
          "includeCollectionItems": {
            "title": "Collection items",
            "type": "boolean",
            "description": "Adds every item of each collection (type and id, up to 200), the total item count and the count per type (model, dataset, space, paper). One extra request per collection. Without it each collection row carries the first 4 items only.",
            "default": false
          },
          "papersStartDate": {
            "title": "Papers: from date",
            "type": "string",
            "description": "First day of the daily papers to read, for example 2026-09-01, or relative: 7d, 4w, 3m. The Hub publishes daily papers on working days; weekends return nothing. Papers are read from the newest day backwards. Needs Papers switched on and no search terms; with search terms the range filters the papers by publication date. Leave empty to read the latest feed.",
            "default": ""
          },
          "papersEndDate": {
            "title": "Papers: to date",
            "type": "string",
            "description": "Last day of the daily papers to read, for example 2026-09-30, or relative (yesterday, 3d). Daily papers exist up to yesterday. If only a start date is set the range ends yesterday; if only an end date is set the range covers the 7 days before it. At most 200 days per run.",
            "default": ""
          },
          "papersSortBy": {
            "title": "Papers: sort by",
            "enum": [
              "upvotes",
              "publishedAt",
              "trending"
            ],
            "type": "string",
            "description": "Order of the daily papers within each day or feed page: most upvoted first, newest publication first, or the Hub trending order. Search results keep the relevance order of the Hub.",
            "default": "upvotes"
          },
          "hfToken": {
            "title": "Hugging Face token (optional)",
            "type": "string",
            "description": "Optional read token from huggingface.co/settings/tokens. It raises the Hub rate limits and lets README text load for gated repositories you have access to. Leave empty for public data only. The token is stored as a secret and never printed in the log."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}