# Hugging Face Scraper — Models, Datasets & Spaces (`hipersoft/huggingface-scraper`) Actor

Scrape the Hugging Face Hub: search models, datasets and spaces by keyword, task, library or author. Get downloads, likes, tags, pipeline task, files and dates. No API key. For ML research, model discovery and monitoring.

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

## Pricing

from $0.001 / item scraped

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/platform/actors/running/actors-in-store#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 — Models, Datasets & Spaces

Search and export the **Hugging Face Hub** at scale. Pull **models**, **datasets** and **Spaces** by keyword, task, library, language or author — with **downloads, likes, tags, task, files and dates** — into clean JSON, CSV or Excel. No API key needed for public repos.

Perfect for **model discovery, competitive/landscape research, tracking trending models, building ML dashboards, dataset sourcing and market monitoring**.

### What you can do

- 🔎 **Search models, datasets or Spaces** by keyword (`llama`, `whisper`, `stable diffusion`)
- 🏷️ **Filter by tag** — task (`text-generation`, `text-to-image`, `automatic-speech-recognition`), library (`transformers`, `pytorch`), language (`en`, `fr`) or license
- 👤 **Filter by author/org** — `meta-llama`, `google`, `openai`, `mistralai`…
- 📊 **Sort** by downloads, likes, trending, recently updated or recently created
- 📥 **Bulk export** — thousands of rows per run via automatic pagination
- 🔓 **No key required** for public data (add an optional read token for gated repos you can access)

### Example input

```json
{
  "contentType": "models",
  "searches": ["llama"],
  "filters": ["text-generation", "pytorch"],
  "author": "",
  "sort": "downloads",
  "maxResultsPerSearch": 500
}
```

Leave `searches` empty to browse the **top items by your chosen sort** (e.g. the 1,000 most-downloaded text-to-image models).

### Output

Each row is one repo:

```json
{
  "type": "model",
  "id": "meta-llama/Llama-3.2-1B-Instruct",
  "author": "meta-llama",
  "name": "Llama-3.2-1B-Instruct",
  "downloads": 10449365,
  "likes": 1548,
  "pipelineTag": "text-generation",
  "library": "transformers",
  "tags": ["transformers", "safetensors", "llama", "conversational", "en", "…"],
  "filesCount": 14,
  "gated": true,
  "createdAt": "2024-09-18T…",
  "lastModified": "2024-10-24T…",
  "url": "https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct"
}
```

Datasets add `description`; Spaces add `sdk`, `emoji` and `runtimeStage`. The `url` always links straight to the repo page.

### Input fields

| Field | Description |
|-------|-------------|
| `contentType` | `models`, `datasets` or `spaces`. |
| `searches` | Keywords to search. Empty = browse top items by sort. |
| `author` | Restrict to one user/org (e.g. `google`). |
| `filters` | Tags to AND together — task, library, language, license. |
| `sort` | `downloads`, `likes`, `lastModified`, `createdAt` or `trendingScore`. |
| `maxResultsPerSearch` | Max rows per search term (up to 50,000). |
| `hfToken` | Optional read token for gated/private repos you can access. |

### Use cases

- **Model discovery & benchmarking** — find the top models for a task, ranked by real downloads/likes
- **Trend monitoring** — track what's trending on the Hub over time
- **Dataset sourcing** — surface the best datasets for a domain (`medical`, `finance`, `code`)
- **Competitive research** — audit an org's full catalog of models/datasets/Spaces
- **ML dashboards & alerts** — feed clean Hub metadata into your own tooling

### FAQ

**Do I need a Hugging Face API key?**
No. All public models, datasets and Spaces are scraped without a key. Add a read token only if you want gated/private repos you already have access to.

**How many results can I get?**
Up to 50,000 per search term. Results are paginated automatically — leave `searches` empty and set a high limit to pull the entire top-of-catalog for a task.

**Which tasks/filters are supported?**
Any Hub tag — tasks like `text-generation`, `text-to-image`, `image-classification`, `automatic-speech-recognition`; libraries like `transformers`, `diffusers`, `pytorch`; languages; and licenses. Combine several to narrow results.

**How does billing work?**
Pay per item scraped plus a small per-request charge — you only pay for what you pull.

### Related Actors

- [arXiv Papers Scraper](https://apify.com/hipersoft/arxiv-scraper) — research papers behind the models
- [GitHub Repo Scraper](https://apify.com/hipersoft/github-scraper) — code repositories and stars
- [PyPI Scraper](https://apify.com/hipersoft/pypi-scraper) — Python packages and metadata
- [OpenAlex Scholarly Works Scraper](https://apify.com/hipersoft/openalex-scraper) — 250M+ academic works

### Notes

Original clean-room implementation using Hugging Face's public Hub API. You are responsible for how you use the scraped data and for complying with the Hub's terms and each repo's license. This is an independent tool and is not affiliated with or endorsed by Hugging Face.

# Actor input Schema

## `contentType` (type: `string`):

Which Hugging Face Hub catalog to search.

## `searches` (type: `array`):

Keywords to search (e.g. "llama", "whisper"). Leave empty to browse the top items by the chosen sort.

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

Only items owned by this user or org (e.g. meta-llama, google, openai). Empty = any.

## `filters` (type: `array`):

Tags to filter by — task (text-generation, text-to-image, automatic-speech-recognition), library (pytorch, transformers), language (en, fr) or license. Multiple = AND.

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

Order results.

## `maxResultsPerSearch` (type: `integer`):

Maximum items to collect per search term.

## `hfToken` (type: `string`):

Optional read token to include gated/private repos you have access to. Public data needs no token.

## Actor input object example

```json
{
  "contentType": "models",
  "searches": [
    "stable diffusion",
    "bert"
  ],
  "author": "",
  "filters": [
    "text-generation",
    "pytorch"
  ],
  "sort": "downloads",
  "maxResultsPerSearch": 100
}
```

# 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 = {
    "searches": [
        "llama"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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 = { "searches": ["llama"] }

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

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

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

```

## CLI example

```bash
echo '{
  "searches": [
    "llama"
  ]
}' |
apify call hipersoft/huggingface-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hipersoft/huggingface-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Wo0KXdyYWlNZAkfOG/builds/P2XEm0fTUJyQO5w0A/openapi.json
