{
  "openapi": "3.0.1",
  "info": {
    "title": "Hugging Face Scraper - Models, Datasets, Spaces & Leads",
    "description": "Scrape the Hugging Face Hub via its official API: models, datasets and Spaces with downloads, likes, trending score, license, tags, parameters, eval results and linked Spaces — plus author/org profiles with a creator-lead wedge and a new-release monitor. Keyless, no browser.",
    "version": "0.1",
    "x-build-id": "fnVzECb679hMEbOeu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~hugging-face-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-hugging-face-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/scrapesage~hugging-face-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-hugging-face-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/scrapesage~hugging-face-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-hugging-face-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Free-text searches run against the Hub for each selected content type (e.g. \"llama\", \"text-to-image\", \"medical\"). Each query is paginated up to the per-query limit.",
            "items": {
              "type": "string"
            }
          },
          "contentTypes": {
            "title": "Content types",
            "type": "array",
            "description": "Which Hub content the searches, filters and browse apply to.",
            "items": {
              "type": "string",
              "enum": [
                "models",
                "datasets",
                "spaces"
              ],
              "enumTitles": [
                "Models",
                "Datasets",
                "Spaces"
              ]
            },
            "default": [
              "models"
            ]
          },
          "repoUrls": {
            "title": "Repo URLs / ids",
            "type": "array",
            "description": "Direct model, dataset or Space pages (e.g. https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct, https://huggingface.co/datasets/HuggingFaceFW/fineweb) or bare ids. Each is fetched for the full record.",
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "title": "Authors / organizations",
            "type": "array",
            "description": "Hugging Face usernames or organizations (e.g. \"meta-llama\", \"stabilityai\") to pull a profile with stats, website, socials and a contact lead.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (mixed)",
            "type": "array",
            "description": "Optional mixed list of huggingface.co URLs — models, datasets, Spaces or author/org profiles. Each is auto-classified.",
            "items": {
              "type": "string"
            }
          },
          "browseHub": {
            "title": "Browse the Hub",
            "type": "boolean",
            "description": "Also browse the top of the Hub for each selected content type in the chosen sort order. Automatically enabled when no search, repo or author input is given (so the actor returns the most-downloaded models by default).",
            "default": false
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "downloads",
              "likes",
              "trendingScore",
              "lastModified",
              "createdAt"
            ],
            "type": "string",
            "description": "Sort order for searches and browsing.",
            "default": "downloads"
          },
          "pipelineTag": {
            "title": "Task / pipeline (models)",
            "type": "string",
            "description": "Filter models by task, e.g. text-generation, text-to-image, automatic-speech-recognition, feature-extraction."
          },
          "libraryName": {
            "title": "Library (models)",
            "type": "string",
            "description": "Filter models by library, e.g. transformers, diffusers, gguf, sentence-transformers."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Filter by language tag, e.g. en, zh, es, code."
          },
          "license": {
            "title": "License",
            "type": "string",
            "description": "Filter by license, e.g. apache-2.0, mit, llama3.1."
          },
          "authorFilter": {
            "title": "Author / org filter",
            "type": "string",
            "description": "Restrict a search or browse to a single author or organization (e.g. \"google\", \"openai\")."
          },
          "minDownloads": {
            "title": "Minimum downloads",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep repos with at least this many recent downloads. 0 = no filter.",
            "default": 0
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep repos with at least this many likes. 0 = no filter.",
            "default": 0
          },
          "excludeGated": {
            "title": "Exclude gated repos",
            "type": "boolean",
            "description": "Skip repos that require accepting terms / requesting access.",
            "default": false
          },
          "includeFullMetadata": {
            "title": "Include full metadata",
            "type": "boolean",
            "description": "Fetch each repo's detail endpoint for the rich record — file count, storage size, model parameters, evaluation results (model-index) and linked Spaces/models. Turn OFF for a fast, cheap listing-only crawl.",
            "default": true
          },
          "includeAuthorProfiles": {
            "title": "Include author / org leads",
            "type": "boolean",
            "description": "Resolve each repo's author/organization to a profile (stats, website, socials) and attach a lead. Emits one author record per unique author seen.",
            "default": false
          },
          "enrichContactEmails": {
            "title": "Enrich contact emails (lead wedge)",
            "type": "boolean",
            "description": "Crawl each author/org's linked website (home + /contact + /about) for a contact email. Requires author profiles ON.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap on the number of repos scraped across all searches, browses and direct URLs.",
            "default": 100
          },
          "maxResultsPerQuery": {
            "title": "Max results per search / browse",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on repos pulled from each individual search query or browse.",
            "default": 60
          },
          "monitorMode": {
            "title": "Monitor mode (only new repos)",
            "type": "boolean",
            "description": "Remember repo/author ids returned in previous runs (in a named key-value store) and emit only NEW ones next time. Pair with an Apify Schedule to watch the Hub, a search, or an org for newly released models/datasets/Spaces. The schedule decides WHEN to run; monitor mode decides WHAT is new.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Name of the key-value store that holds the monitor's memory. Use different names to track different watches independently. Lowercase letters, digits and hyphens only.",
            "default": "hugging-face-monitor"
          },
          "hfToken": {
            "title": "Hugging Face token (optional)",
            "type": "string",
            "description": "Optional Hugging Face access token (https://huggingface.co/settings/tokens) for higher rate limits. Read-only is enough; never required."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many requests to run in parallel.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Apify Proxy (default) is recommended — a fresh session is used per request to spread the Hub's per-IP rate limit. The official API has no anti-bot, so the automatic datacenter pool works well.",
            "default": {
              "useApifyProxy": true
            }
          },
          "urlsFromFile": {
            "title": "Import URLs from a file",
            "type": "string",
            "description": "Paste a list of URLs (one per line), OR one link to a .txt/.csv file, Google Sheet or Google Drive file containing them. Lets you import many Start URLs at once instead of typing each. Google Sheet/Drive share links are handled automatically."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}