# Hugging Face Hub Scraper: Models, Datasets, Spaces, Papers (`mohammedmohie/huggingface-hub-scraper`) Actor

Extract models, datasets, spaces, and daily papers from Hugging Face Hub using the official public API. Captures likes, downloads, licenses, tags, and metadata with pay-per-event pricing.

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

## Pricing

from $1.00 / 1,000 results

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/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 Hub Scraper: Models, Datasets, Spaces & Daily Papers

Extract structured metadata from Hugging Face Hub using the official public Hub API. Collect metrics, licensing, task types, framework tags, and research summaries for models, datasets, spaces, and daily papers.

### What It Extracts

This scraper queries Hugging Face's official public REST endpoints without requiring web scraping or browser emulation:

- Models: Repository ID, author, download metrics (period and all-time), likes, trending scores, task pipeline (such as `text-generation` or `sentence-similarity`), library tag (such as `transformers` or `sentence-transformers`), tags, license, gating status, and timestamps.
- Datasets: Repository ID, author, downloads, likes, trending score, description text, license, tags, and timestamps.
- Spaces: Space ID, author, likes, trending score, application SDK (such as `gradio`, `streamlit`, `docker`, `static`), runtime stage (such as `RUNNING`), title, short summary, license, and tags.
- Daily Papers: arXiv identifier, paper title, abstract summary, upvotes, comment count, author list, published date, and links to Hugging Face Papers and arXiv.

### Use Cases

- AI trend tracking: Track download spikes, like velocity, and trending score shifts across open architectures and domains.
- Model and dataset discovery: Scan for checkpoints and datasets matching specific licenses, framework compatibility, or task tags.
- Newsletter and content research: Retrieve top daily papers and community demo spaces to monitor active machine learning research.
- Competitive analysis: Benchmark repository adoption, release frequency, and developer interest across organizations.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | String | `"models"` | Entity type to scrape: `"models"`, `"datasets"`, `"spaces"`, or `"daily_papers"`. |
| `search` | String | `null` | Keyword query to filter records. |
| `author` | String | `null` | Organization or user username (for example: `google`, `meta-llama`). |
| `tags` | Array | `[]` | Filter tags (for example: `["text-generation", "safetensors"]`). |
| `sort` | String | `"downloads"` | Sort order: `"downloads"`, `"likes"`, `"trendingScore"`, `"lastModified"`, or `"createdAt"`. |
| `maxItems` | Integer | `100` | Maximum items to collect (1 to 10,000). |
| `includeCardData` | Boolean | `false` | When true, includes raw card metadata dictionary in `card_data`. |
| `hfToken` | String | `null` | Optional Hugging Face user access token for higher API rate limits. |
| `date` | String | `null` | Optional date in `YYYY-MM-DD` format for `daily_papers` mode. |
| `maxConcurrency` | Integer | `4` | Maximum parallel requests (1 to 4). |

#### Input Example

```json
{
  "mode": "models",
  "search": "bert",
  "author": "google-bert",
  "tags": ["fill-mask"],
  "sort": "downloads",
  "maxItems": 20
}
```

### Output Dataset

Each record is returned as a flat dictionary. Missing or mode-inapplicable fields are returned as `null`.

#### Output Example (Model Record)

```json
{
  "type": "model",
  "id": "sentence-transformers/all-MiniLM-L6-v2",
  "author": "sentence-transformers",
  "url": "https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2",
  "downloads": 165041501,
  "downloads_all_time": 4322842809,
  "likes": 6176,
  "trending_score": 27,
  "pipeline_tag": "sentence-similarity",
  "library_name": "sentence-transformers",
  "tags": [
    "sentence-transformers",
    "pytorch",
    "tf",
    "rust",
    "onnx",
    "safetensors",
    "openvino",
    "bert",
    "feature-extraction",
    "sentence-similarity",
    "transformers",
    "en",
    "license:apache-2.0"
  ],
  "license": "apache-2.0",
  "created_at": "2022-03-02T23:29:05.000Z",
  "last_modified": "2026-06-01T06:29:13.000Z",
  "gated": false,
  "private": false,
  "sdk": null,
  "runtime_stage": null,
  "title": null,
  "summary": null,
  "published_at": null,
  "upvotes": null,
  "num_comments": null,
  "authors": null,
  "arxiv_url": null,
  "card_data": null
}
```

#### Output Example (Paper Record)

```json
{
  "type": "paper",
  "id": "2611.31198",
  "author": "Rui Sun",
  "url": "https://huggingface.co/papers/2611.31198",
  "downloads": null,
  "downloads_all_time": null,
  "likes": 3,
  "trending_score": null,
  "pipeline_tag": null,
  "library_name": null,
  "tags": [],
  "license": null,
  "created_at": "2026-11-22T19:00:00.000Z",
  "last_modified": null,
  "gated": false,
  "private": false,
  "sdk": null,
  "runtime_stage": null,
  "title": "ToolSmith: An Automatic Tool-Generation Framework for Multimodal Search Agents",
  "summary": "Recent multimodal search agents use reasoning, vision, and live web search...",
  "published_at": "2026-11-22T19:00:00.000Z",
  "upvotes": 3,
  "num_comments": 1,
  "authors": [
    "Rui Sun",
    "Junhua Huang",
    "Luca Zancato",
    "Md Mofijul Islam",
    "Kai-Wei Chang"
  ],
  "arxiv_url": "https://arxiv.org/abs/2611.31198",
  "card_data": null
}
```

### Pricing

This actor uses Apify's Pay-Per-Event (PPE) model:

- **$1.00 per 1,000 results** ($0.001 per result item).
- You only pay for records delivered to your dataset. If a targeted query returns 85 items, you are billed for 85 events.
- Empty queries that yield zero records incur zero event charges.

### Frequently Asked Questions

#### Is it legal to scrape Hugging Face Hub?

Yes. This actor queries Hugging Face's official public REST API endpoints (`/api/models`, `/api/datasets`, `/api/spaces`, `/api/daily_papers`). It uses standard public API parameters, does not access private repositories, does not bypass authentication guards, and complies with Hugging Face terms of service.

#### Do I need a Hugging Face API token?

No. An API token is optional. The actor functions immediately without any credentials. Providing a personal access token in the `hfToken` field applies higher authenticated rate limits to your run.

#### What rate limits apply?

Unauthenticated API requests are subject to Hugging Face's public window of 500 requests per 300 seconds. The actor automatically throttles concurrent requests (maximum 4 concurrent connections) and uses exponential backoff retry logic that observes `Retry-After` headers if rate limits are reached.

# Actor input Schema

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

Choose which entity type to scrape from Hugging Face Hub.

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

Filter entities by keyword search (e.g. 'llama', 'whisper', 'squad').

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

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

## `tags` (type: `array`):

Filter by tags (e.g. \['text-generation', 'safetensors', 'pytorch']).

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

Sort order for models, datasets, and spaces.

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

Maximum number of items to scrape.

## `includeCardData` (type: `boolean`):

Include full cardData dictionary in output item.

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

Optional Hugging Face user access token for higher rate limits.

## `date` (type: `string`):

Target date in YYYY-MM-DD format for daily_papers mode.

## `maxConcurrency` (type: `integer`):

Maximum concurrent HTTP requests (1 to 4).

## `proxyConfiguration` (type: `object`):

Select proxies to be used by the crawler.

## Actor input object example

```json
{
  "mode": "models",
  "tags": [],
  "sort": "downloads",
  "maxItems": 100,
  "includeCardData": false,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All scraped Hugging Face Hub items (models, datasets, Spaces or daily papers).

# 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("mohammedmohie/huggingface-hub-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("mohammedmohie/huggingface-hub-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 mohammedmohie/huggingface-hub-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mohammedmohie/huggingface-hub-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/wu39djTwYyh4VgCKB/builds/hqd077pnrNe6xdGGI/openapi.json
