# Hugging Face Scraper - Models Datasets Spaces (`openclawmara/huggingface-scraper`) Actor

Scrape Hugging Face models, datasets, and Spaces. Extracts metadata, downloads, likes, tags, and usage stats. Ideal for AI model discovery, competitive analysis, and tracking trending ML resources.

- **URL**: https://apify.com/openclawmara/huggingface-scraper.md
- **Developed by:** [OpenClaw Mara](https://apify.com/openclawmara) (community)
- **Categories:** AI
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 model scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🤗 Hugging Face Scraper — AI Models, Datasets & Spaces

**Structured data from the world's largest open-source AI hub. $0.005 per item.**

Scrape Hugging Face for models, datasets, and Spaces. Search by task, library, author, or keyword. Extract model cards, download counts, likes, tags, pipeline tags, library info, and full metadata. No authentication required — powered by Hugging Face's public API.

Perfect for AI market research, competitive intelligence on open-source AI, RAG pipelines over model cards, and monitoring the ML ecosystem in real time.

### 🚀 What does this Actor do?

Hugging Face has become **the** registry for open-source AI. This Actor turns it into a structured data source you can automate in four modes:

- **models** — Browse the full model registry. Filter by task (`text-generation`, `image-classification`, `automatic-speech-recognition` and 16 more), author, search query, and sort order (`trending`, `downloads`, `likes`, `lastModified`, `created`).
- **datasets** — Discover ML datasets with metadata: size, downloads, tags, likes.
- **spaces** — List deployed ML demos and apps on HF Spaces.
- **model\_details** — Deep-dive into specific models by ID. Returns full model cards, pipeline tag, library info, tensor types, and download statistics.

Everything comes back as clean JSON, ready to drop into a vector DB, a dashboard, or a fine-tuning pipeline.

### 💡 Use Cases

#### 1. AI market research & trend tracking

Track which open-source models are gaining traction week-over-week. Run weekly against `sort: "trending"` and compare deltas.

```json
{
  "mode": "models",
  "task": "text-generation",
  "sort": "trending",
  "limit": 100
}
```

#### 2. Competitive monitoring of AI labs

Watch specific organizations — Meta, Google, Mistral, Stability AI, Alibaba, DeepSeek — for new releases.

```json
{
  "mode": "models",
  "author": "meta-llama",
  "sort": "lastModified",
  "limit": 50
}
```

#### 3. RAG / fine-tuning corpus from model cards

Pull full model cards for a curated list of models and feed them into a vector store as an "AI knowledge assistant."

```json
{
  "mode": "model_details",
  "modelIds": [
    "meta-llama/Llama-3.1-8B",
    "mistralai/Mistral-7B-v0.3",
    "google/gemma-2-9b"
  ]
}
```

#### 4. ML dataset discovery for training pipelines

Find datasets by task and download volume — great for auto-selecting candidates for fine-tuning or evaluation.

```json
{
  "mode": "datasets",
  "search": "instruction",
  "sort": "downloads",
  "limit": 50
}
```

### 📊 Output Example

```json
{
  "id": "meta-llama/Llama-3.1-8B",
  "author": "meta-llama",
  "pipeline_tag": "text-generation",
  "downloads": 4523891,
  "likes": 1253,
  "tags": ["pytorch", "safetensors", "llama", "text-generation", "en"],
  "created": "2024-06-18T00:00:00.000Z",
  "lastModified": "2025-01-15T12:30:00.000Z",
  "library_name": "transformers",
  "modelCard": "Llama 3.1 is a family of large language models...",
  "task": "text-generation"
}
```

### ⚙️ Input Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `mode` | enum | `models`, `datasets`, `spaces`, or `model_details` (required) |
| `search` | string | Keyword search — e.g. `"llama"`, `"sentiment"`, `"bert"` |
| `author` | string | Filter by org/user — `"meta-llama"`, `"google"`, `"mistralai"`, `"openai-community"` |
| `task` | enum | 19 ML tasks: `text-generation`, `image-classification`, `translation`, `summarization`, `fill-mask`, `text-to-image`, `automatic-speech-recognition`, and more |
| `sort` | enum | `trending`, `downloads`, `likes`, `lastModified`, `created` |
| `limit` | int | 1–1000 (default 50) |
| `modelIds` | array | For `model_details` mode: `["meta-llama/Llama-3-8B", "google/gemma-7b"]` |

### 📤 Output Fields

| Field | Description |
|-------|-------------|
| `id` | Full model/dataset/space ID (`author/name`) |
| `author` | Organization or user that published it |
| `pipeline_tag` | Primary ML task |
| `downloads` | Total download count |
| `likes` | Community likes |
| `tags` | Array of framework, license, language, and architecture tags |
| `library_name` | Primary library (`transformers`, `diffusers`, `sentence-transformers`, etc.) |
| `created` / `lastModified` | ISO timestamps for monitoring freshness |
| `modelCard` | Full README content (in `model_details` mode) |

### 💰 Pricing & Performance

- **Pay-per-event:** **$0.005 per item** scraped (model, dataset, space, or model detail).
- **Typical monthly cost:** $1.50–$5 for weekly tracking of 100–250 top models.
- **Speed:** ~100 items/minute in list modes, ~30 items/minute in `model_details` (each call fetches the full model card).
- **No HF account / token required** — uses the public API.

### 🔌 Integrations

- **Zapier / Make / n8n** — schedule weekly trend scans and push deltas to Slack, Notion, or Airtable.
- **LangChain / LlamaIndex** — feed `model_details` output straight into a RAG pipeline to build an "AI model advisor."
- **Vector DBs (Pinecone, Weaviate, Qdrant, pgvector)** — embed `modelCard` content for semantic search over the open-source AI landscape.
- **Apify SDK / webhooks** — run on a schedule and POST new trending entries to your own endpoint.
- **Google Sheets / BigQuery** — export to CSV via Apify's dataset export and build dashboards on top.

### ❓ FAQ

**Do I need a Hugging Face account or token?**
No. The Actor uses the public HF API — no auth, no rate-limit headaches from token scoping.

**How fresh is the data?**
Real-time. Every run hits the HF API live. Trending rankings, download counts, and new releases appear as soon as HF publishes them.

**Can I get the full model card text?**
Yes — use `mode: "model_details"` with `modelIds`. The Actor fetches each model's full README/model card.

**What's the difference between `downloads` and `trending`?**
`downloads` = all-time cumulative. `trending` = HF's internal momentum signal (recent downloads + likes velocity). Use `trending` to catch rising stars before they hit top-downloads lists.

**Can I filter by license (Apache, MIT, Llama-license)?**
Not directly in input, but license shows up in the `tags` array of each result — you can filter client-side.

**Why are some model cards empty?**
A small fraction of models on HF don't ship a README. Those come back with `modelCard: ""`. Everything else is populated.

### 🔑 Keywords

Hugging Face scraper, AI model database, ML model tracker, open source AI data, LLM directory, Hugging Face API alternative, model cards extraction, AI trending models, Hugging Face datasets scraper, Hugging Face Spaces scraper, transformer models data, AI ecosystem monitoring, ML model comparison, fine-tuning dataset discovery, AI competitive intelligence, RAG over model cards.

### 📝 Changelog

- **v1.0** — Initial release. 4 modes (models, datasets, spaces, model\_details), 19 task filters, 5 sort options, up to 1000 results per run.

# Actor input Schema

## `mode` (type: `string`):

What to scrape from Hugging Face

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

Search query to filter results (e.g., 'text-generation', 'llama', 'sentiment')

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

Filter by author or organization (e.g., 'meta-llama', 'google', 'openai')

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

Filter models by ML task

## `sort` (type: `string`):

Sort results by

## `limit` (type: `integer`):

Maximum number of results to return

## `modelIds` (type: `array`):

Specific model IDs to fetch details for (e.g., \['meta-llama/Llama-3-8B'])

## Actor input object example

```json
{
  "mode": "models",
  "task": "",
  "sort": "downloads",
  "limit": 50
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("openclawmara/huggingface-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("openclawmara/huggingface-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 '{}' |
apify call openclawmara/huggingface-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,openclawmara/huggingface-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/5TK7ajdd3AKNvpEWe/builds/9n4I8GPAmRoH0ydgx/openapi.json
