# Hugging Face AI Models, Datasets & Spaces Scraper (`moneygain/huggingface-models-scraper`) Actor

Fast Pay-Per-Event scraper for Hugging Face Hub (huggingface.co). Extract trending AI models, LLMs, datasets, spaces, download statistics, stars/likes, licenses, pipeline tags, and library tags with zero browser overhead.

- **URL**: https://apify.com/moneygain/huggingface-models-scraper.md
- **Developed by:** [Artem Drozhdei](https://apify.com/moneygain) (community)
- **Categories:** AI, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 verified ai model / dataset records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🚀 Hugging Face AI Models, Datasets & Spaces Scraper

**Scrape Hugging Face AI models, open-source LLMs, datasets, and spaces to JSON, CSV, or Excel in seconds without browser overhead.** Extract verified AI model metadata, total download counts, community stars/likes, author organizations, AI pipeline tasks (text-generation, text-to-image, speech recognition), library types (Transformers, Diffusers, GGUF), license tags, gated weights flags, and update timestamps from **huggingface.co** — the premier global platform for open-source AI and machine learning.

Designed for AI engineers selecting optimal foundation models, venture capital scouts monitoring open-source AI traction, quantitative researchers, AI safety analysts, and autonomous AI agents. Built with direct lightweight HTTP requests with **zero browser overhead** and **100% Pay-Per-Event (PPE) pricing** — you only pay for verified AI records delivered ($0.005 / record).

***

### ⚡ Speed & Value Comparison

| Feature | Our Lightweight Hugging Face Scraper | Heavy Browser Scrapers (Playwright / Puppeteer) |
|---|---|---|
| **Memory Consumption** | **128 MB – 256 MB** | 2 GB – 4 GB |
| **Startup Cost** | **$0.00 (Zero Start Fee)** | $0.05 – $0.10 per run |
| **Extraction Speed** | **0.15s – 0.3s per 100 AI models** | 10s – 30s per page |
| **Pricing Model** | **Pay-Per-Event ($0.005 / AI record)** | Expensive Monthly Flat Rate ($30–$50/mo) |
| **Multi-Entity Support** | **Models, Datasets & Spaces** | Models only / limited card parsing |
| **AI & MCP Ready** | **Instant clean JSON for Claude / Cursor MCP** | Bulky payloads requiring heavy LLM cleanup |

***

### 📦 Sample JSON Output

```json
{
  "id": "deepseek-ai/DeepSeek-V3",
  "name": "DeepSeek-V3",
  "author": "deepseek-ai",
  "url": "https://huggingface.co/deepseek-ai/DeepSeek-V3",
  "entityType": "model",
  "pipelineTag": "text-generation",
  "downloads": 1541672,
  "likes": 5015,
  "libraryName": "transformers",
  "tags": [
    "transformers",
    "safetensors",
    "deepseek",
    "text-generation",
    "custom_code",
    "license:mit",
    "arxiv:2412.19437",
    "conversational"
  ],
  "isPrivate": false,
  "isGated": false,
  "createdAt": "2024-12-26T04:12:00.000Z",
  "lastModified": "2026-01-15T09:41:22.000Z"
}
```

***

### 🤖 AI & No-Code Integrations

#### Claude Desktop & Cursor IDE (Apify MCP Server)

Connect this scraper directly to your AI workflows using the official Apify Model Context Protocol (MCP) server. Run natural language research:

> *"Find the top 20 most downloaded text-to-image and diffusion models on Hugging Face created in the last 6 months, and return their IDs, downloads, and licenses."*

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/mcp-server"],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

#### Python SDK Quickstart

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run_input = {
    "search": "deepseek",
    "entityType": "models",
    "sortBy": "downloads",
    "maxItems": 25
}

run = client.actor("moneygain/huggingface-models-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"[{item['author']}] {item['name']} | Downloads: {item['downloads']:,} | Task: {item['pipelineTag']}")
```

#### n8n / Make.com / Clay Integration

1. Add an **Apify** node to your scenario.
2. Select **Run Actor** and enter `moneygain/huggingface-models-scraper`.
3. Map the dataset records to your Google Sheets, Airtable, Discord alerts (tracking new viral model releases), or custom AI model benchmarks.

***

### ⚙️ Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `search` | String | `"deepseek"` | Search keyword, model architecture, or family (e.g. `llama`, `deepseek`, `flux`, `whisper`, `qwen`). |
| `entityType` | String | `"models"` | Entity type to scrape: `models`, `datasets`, or `spaces`. |
| `author` | String | `""` | Filter by author or organization (e.g. `meta-llama`, `deepseek-ai`, `mistralai`, `black-forest-labs`). |
| `task` | String | `"all"` | Filter by pipeline task (e.g. `text-generation`, `text-to-image`, `automatic-speech-recognition`). |
| `sortBy` | String | `"downloads"` | Sort order: `downloads` (most popular), `likes` (trending), `lastModified`, `createdAt`. |
| `maxItems` | Integer | `10` | Maximum number of AI records to extract. Default is 10 for instant 5-second testing. |

***

### ❓ Frequently Asked Questions (FAQ)

#### 1. Is it legal to scrape Hugging Face model and dataset data?

Yes. All data retrieved by this scraper is publicly available on the official Hugging Face Hub (`huggingface.co`). Our scraper retrieves public repository metadata, download metrics, and tags in full compliance with public API fair-use principles and GDPR standards.

#### 2. Can I scrape Hugging Face Datasets and Spaces as well?

Yes. You can switch the `entityType` input from `models` to `datasets` or `spaces` to extract trending datasets (e.g., benchmark corpora, fine-tuning datasets) or interactive AI applications (Gradio and Streamlit Spaces).

#### 3. How much does it cost to scrape 1,000 AI models?

With our **Pay-Per-Event ($0.005 / AI record)** pricing model, extracting 1,000 verified AI model records costs exactly **$5.00** (with automatic volume discounts down to $4.00/1k). There are no compute unit (CU) markups, no proxy fees, and zero hidden costs.

#### 4. Can I export Hugging Face data to Excel or CSV?

Yes. From the Apify Console or API, you can export your scraped datasets in one click into CSV, Excel, JSON, XML, or RSS formats.

#### 5. Why is this scraper faster than browser-based scrapers?

Traditional scrapers launch heavy headless browsers (Chrome/Puppeteer) that consume 2 GB to 4 GB of RAM and load megabytes of redundant styles, fonts, and scripts. Our scraper queries the underlying optimized Hugging Face Hub REST API directly, returning clean structured JSON in less than 0.2 seconds on just 128 MB of memory.

***

### 🔗 Explore More High-Speed B2B Scrapers & Enrichers by Our Team

| Scraper | Data Source | Primary Use Case | Store Link |
|---|---|---|---|
| **Greenhouse ATS Jobs Scraper** | Greenhouse.io | Enterprise tech jobs from Figma, Stripe, Databricks & Airbnb | [Run on Apify](https://apify.com/moneygain/greenhouse-jobs-scraper) |
| **Y Combinator Startups Scraper** | YCombinator.com | Verified YC startups, founders, batches & hiring status | [Run on Apify](https://apify.com/moneygain/ycombinator-startups-scraper) |
| **TrustMRR Startups Scraper** | TrustMRR.com | Stripe-verified SaaS MRR, revenue & founder handles | [Run on Apify](https://apify.com/moneygain/trustmrr-startups-scraper) |
| **Ashby ATS Jobs Scraper** | AshbyHQ.com | High-growth tech vacancies & compensation | [Run on Apify](https://apify.com/moneygain/ashby-jobs-scraper) |
| **Clutch B2B Agencies Scraper** | Clutch.co | Top IT agencies, hourly rates & client reviews | [Run on Apify](https://apify.com/moneygain/clutch-agencies-scraper) |
| **Wellfound Jobs Scraper** | Wellfound.com | Startup equity benchmarks, tech talent & YC jobs | [Run on Apify](https://apify.com/moneygain/wellfound-jobs-scraper) |
| **TheProtocol.it Scraper** | TheProtocol.it | European IT salaries & tech stack benchmarks | [Run on Apify](https://apify.com/moneygain/theprotocol-scraper) |
| **Bulldogjob Scraper** | Bulldogjob.pl | Developer hiring trends & B2B compensation | [Run on Apify](https://apify.com/moneygain/bulldogjob-scraper) |

# Changelog

This Actor's version history is a separate document: https://apify.com/moneygain/huggingface-models-scraper/changelog.md

# Actor input Schema

## `search` (type: `string`):

Search keyword or model name (e.g. 'deepseek', 'llama', 'flux', 'whisper', 'qwen', 'bert').

## `entityType` (type: `string`):

What type of Hugging Face repository to scrape: 'models', 'datasets', or 'spaces'.

## `author` (type: `string`):

Filter by specific organization or user (e.g. 'deepseek-ai', 'meta-llama', 'mistralai', 'black-forest-labs'). Leave empty for all.

## `task` (type: `string`):

Filter by AI task (e.g. 'text-generation', 'text-to-image', 'automatic-speech-recognition', 'image-classification', 'all').

## `sortBy` (type: `string`):

Sort order: 'downloads' (most popular), 'likes' (trending/starred), 'lastModified' (recently updated), 'createdAt' (newest).

## `maxItems` (type: `integer`):

Maximum number of AI model, dataset, or space records to extract. Default is 10 for instant 5-second testing.

## Actor input object example

```json
{
  "search": "deepseek",
  "entityType": "models",
  "author": "",
  "task": "all",
  "sortBy": "downloads",
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "search": "deepseek",
    "entityType": "models",
    "author": "",
    "task": "all",
    "sortBy": "downloads",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("moneygain/huggingface-models-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "search": "deepseek",
    "entityType": "models",
    "author": "",
    "task": "all",
    "sortBy": "downloads",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("moneygain/huggingface-models-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "search": "deepseek",
  "entityType": "models",
  "author": "",
  "task": "all",
  "sortBy": "downloads",
  "maxItems": 10
}' |
apify call moneygain/huggingface-models-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moneygain/huggingface-models-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/e5MGfNcDYwhKfwusB/builds/oNACmFuCtFJXHgKdm/openapi.json
