# Hugging Face Scraper — Trending Models, Datasets & Spaces (`mersetti/huggingface-hub-trends`) Actor

Scrape trending, most downloaded, most liked and newest Hugging Face models, datasets and Spaces: downloads, likes, trending score, task, library, license, model size, Space runtime and model cards. Monitor new releases and likes/downloads growth.

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

## Pricing

Pay per event

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?

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 Scraper — Trending Models, Datasets & Spaces

Scrape **trending Hugging Face models, datasets and Spaces** in seconds: downloads, likes, trending score, task
(pipeline tag), library, license, model size (parameters), base model, Space SDK and runtime status, plus the full
**model card / dataset card** as Markdown. No Hugging Face account, token or browser needed.

Sort by **trending**, **most downloaded**, **most liked**, **recently updated** or **newest**, filter by author,
task, library, minimum downloads/likes and release date, and turn on **monitor mode** to get only **new trending
models** or **likes & downloads growth** since the last run. Schedule it daily and you have an AI trend feed.

### Why this Hugging Face scraper

- **All three Hub types**: models, datasets and Spaces in one run, each with its own type-specific fields.
- **Trending like on huggingface.co**: the same `trendingScore` the Hub uses for its Trending pages.
- **Rich model data**: pipeline task, library (transformers, diffusers, gguf, mlx...), license, languages,
  base model, parameter count (`12B`, `744.4M`) from safetensors/GGUF metadata, GGUF architecture and context length,
  downloads in the last 30 days **and all time**, gated status, commit sha, file count.
- **Datasets**: task categories, modalities, formats, size category, license, short description.
- **Spaces**: SDK (gradio, streamlit, docker, static), runtime stage (RUNNING, SLEEPING, RUNTIME_ERROR...),
  hardware, app URL, models and datasets used.
- **Model cards for AI / RAG**: optional README text with the YAML header removed, ready for LLMs and embeddings.
- **Monitor mode**: only new items, or only items whose likes/downloads grew, with growth numbers and percentages.
- **Fast and polite**: official public Hub API, 100 items per request, cursor pagination, respects the Hub's
  rate-limit headers and retries with backoff on HTTP 429.
- **Pay per item**: no monthly rental. In monitor mode you pay only for new or growing items.

### Use cases

- **AI market research**: which tasks, model families, licenses and libraries are rising; who publishes the most
  downloaded open-weight models; how fast new releases get adopted.
- **Model discovery**: find the best trending text-generation, text-to-image, speech or embedding models,
  filtered by library (e.g. `gguf` or `mlx` for local inference) and minimum downloads.
- **Investor / VC tracking**: watch AI labs and startups (`authors`) for new releases and traction (likes and
  download growth) before it shows up in the news.
- **AI newsletters & social posts**: a daily or weekly list of newly trending models, datasets and Spaces with
  descriptions from their model cards.
- **AI agents & RAG**: feed model cards and metadata to an LLM agent that recommends models, writes summaries or
  answers "what is the best open model for X?".
- **Competitive intelligence**: track your own and competitors' models and Spaces (likes, downloads, Space status).
- **Dataset sourcing**: find trending datasets by task category with license and size information.

### Input

| Field | Description |
|---|---|
| `resourceTypes` | `models`, `datasets` and/or `spaces` (default `["models"]`). |
| `sort` | `trendingScore` (default), `downloads`, `likes`, `lastModified`, `createdAt`. Always descending. Spaces have no downloads, so `downloads` sorts Spaces by likes. |
| `maxItems` | Max items per resource type (default 50, up to 10,000). |
| `search` | Keyword in the repo name, e.g. `llama`, `whisper`, `flux`. |
| `authors` | Users/organizations, e.g. `google`, `meta-llama`, `Qwen`. |
| `pipelineTags` | Tasks, e.g. `text-generation`, `text-to-image`. For datasets this is the task category. Ignored for Spaces. |
| `libraries` | Model libraries, e.g. `transformers`, `diffusers`, `gguf`, `mlx`. Models only. |
| `minDownloads` | Minimum downloads in the last 30 days (models and datasets). |
| `minLikes` | Minimum likes. |
| `createdWithinDays` | Only repos created in the last N days. |
| `itemIds` | Specific repos by id or URL: `meta-llama/Llama-3.1-8B-Instruct`, `datasets/openai/gsm8k`, `spaces/enzostvs/deepsite`, `https://huggingface.co/...`. |
| `includeCard` | Add the README / model card text (Markdown, YAML header removed). |
| `cardMaxChars` | Max card length (default 20,000 characters). |
| `monitorMode` | `off` (default), `new`, `growth` or `newAndGrowth`. |
| `monitorId` | Separate saved state per watchlist (default `default`). |
| `baselineOnFirstRun` | First monitored run saves items silently (no output, no cost). Default on. |
| `minLikesGrowth` | Growth mode: minimum likes gained since the previous run (default 1). |
| `minDownloadsGrowth` | Growth mode: minimum downloads gained (all-time downloads when available). 0 = ignore downloads. |

Several authors, tasks and libraries are combined (every combination is one Hub query, the results are merged,
de-duplicated and re-sorted, at most 100 combinations).

#### Example input: today's trending models, datasets and Spaces

```json
{
  "resourceTypes": ["models", "datasets", "spaces"],
  "sort": "trendingScore",
  "maxItems": 20,
  "includeCard": true
}
```

#### Example input: new local-inference LLMs from the last 7 days

```json
{
  "resourceTypes": ["models"],
  "sort": "trendingScore",
  "pipelineTags": ["text-generation"],
  "libraries": ["gguf", "mlx"],
  "createdWithinDays": 7,
  "minDownloads": 1000,
  "maxItems": 100
}
```

#### Example input: daily monitor of AI labs (new releases + traction)

```json
{
  "resourceTypes": ["models", "spaces"],
  "sort": "createdAt",
  "authors": ["google", "meta-llama", "Qwen", "mistralai", "deepseek-ai"],
  "maxItems": 200,
  "monitorMode": "newAndGrowth",
  "monitorId": "ai-labs",
  "minLikesGrowth": 25
}
```

### Output

One row per model, dataset or Space. Real example (model, from a test run on 2026-10-14; `tags` and `card` shortened for readability):

```json
{
  "type": "model",
  "id": "jialinyyzz/humanizer",
  "name": "humanizer",
  "author": "jialinyyzz",
  "url": "https://huggingface.co/jialinyyzz/humanizer",
  "title": null,
  "pipelineTag": "text-generation",
  "library": "gguf",
  "tags": ["gguf", "safetensors", "gemma4_unified", "image-text-to-text", "humanizer", "transformers", "text-rewriting", "llama.cpp", "gemma4", "text-generation", "en", "zh", "base_model:google/gemma-4-12B", "base_model:finetune:google/gemma-4-12B", "license:apache-2.0", "endpoints_compatible", "region:us", "conversational"],
  "license": "apache-2.0",
  "languages": ["en", "zh"],
  "downloads": 65616,
  "downloadsAllTime": 67722,
  "likes": 1571,
  "trendingScore": 1072,
  "createdAt": "2026-09-11T05:00:16.000Z",
  "lastModified": "2026-10-08T20:13:31.000Z",
  "gated": false,
  "private": false,
  "disabled": false,
  "sha": "7232532cb8466bd393544e97826e12e6b5e471ac",
  "baseModels": ["google/gemma-4-12B"],
  "datasets": [],
  "parameters": 11959730224,
  "parametersHuman": "12B",
  "parameterDtypes": ["BF16"],
  "ggufArchitecture": "gemma4",
  "contextLength": 262144,
  "filesCount": 38,
  "card": "<img src=\"assets/banner-en.png\" alt=\"humanizer: rewrites AI drafts so they read like a person wrote them\" width=\"100%\">\n\n...\n\n# humanizer\n\n**A 12B model that rewrites AI-written drafts (emails, essays, reports, forum posts; English and Chinese) so they read like a person wrote them.** It is trained to keep every number, unit, date",
  "cardError": null,
  "cardTruncated": true,
  "scrapedAt": "2026-10-14T09:53:31.950Z"
}
```

Space (same run):

```json
{
  "type": "space",
  "id": "Pepe104/MiniMax-H3-Turbo-Lora-UNCENSORED",
  "author": "Pepe104",
  "url": "https://huggingface.co/spaces/Pepe104/MiniMax-H3-Turbo-Lora-UNCENSORED",
  "title": "MiniMax H3 Turbo LoRA",
  "likes": 1526,
  "trendingScore": 239,
  "createdAt": "2026-08-14T23:23:19.000Z",
  "emoji": "🎬",
  "shortDescription": "Video generation with a synchronized soundtrack",
  "sdk": "gradio",
  "sdkVersion": "6.20.0",
  "runtimeStage": "RUNNING",
  "hardware": "zero-a10g",
  "appUrl": "https://pepe104-minimax-h3-turbo-lora-uncensored.hf.space",
  "models": ["hfmlsoc/ncii-light-guard-v01", "larryvrh/MiniMax-H3-Turbo-Lora", "lightx2v/Minimax-h3-Turbo", "MiniMaxAI/MiniMax-H3", "multimodalart/minimax-h3-aoti"]
}
```

Datasets add `title` (pretty name), `taskCategories`, `modalities`, `formats`, `sizeCategory` and `description`.
Fields that do not apply to a type are `null` (e.g. `downloads` for Spaces).

In monitor mode each row also has:

```json
{
  "changeType": "growth",
  "likesGrowth": 7,
  "likesGrowthPercent": 0.3,
  "downloadsGrowth": 5000,
  "downloadsGrowthBasis": "allTime",
  "previousLikes": 2150,
  "previousDownloads": 124930,
  "previousDownloadsAllTime": 119930,
  "previousSeenAt": "2026-10-13T08:00:00.000Z",
  "firstSeenAt": "2026-10-01T08:00:00.000Z"
}
```

`changeType` is `new` (not seen in previous runs) or `growth`. A run report (queries, items scanned and matched,
warnings, errors, not-found repos) is saved to the `SUMMARY` record of the run's key-value store.

### How monitoring works

- State is saved in the named key-value store `huggingface-monitor` under `state-<monitorId>` (gzipped JSON).
- With `baselineOnFirstRun` (default), the first run of a list (resource type + sort + filters) saves its items
  silently. Later runs report items that are new to the list (e.g. **newly trending**) or that gained likes/downloads.
- Growth is measured since the previous run that saw the item. Downloads growth uses **all-time downloads** when the
  Hub provides them (models and datasets), because the 30-day figure can go down.
- If the run's cost limit is reached, unreported items stay pending and are reported in the next run.
- Items not seen for 180 days are dropped from the state.

### Pricing

**Pay per item**: you pay a small fee for each model, dataset or Space in the dataset (event `item`). Model cards are
included at no extra charge. In monitor mode you pay only for new or growing items, so a daily trending watch usually
costs cents. Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached.

### FAQ

**Do I need a Hugging Face account or API token?**
No. The Actor uses the public Hugging Face Hub API and only reads public repos.

**What is the trending score?**
The Hub's own popularity score for recent activity (likes and usage over the last days). It is what
huggingface.co uses for its Trending sort. `trendingScore` is the value at scraping time.

**Why are `downloads` empty for Spaces?**
The Hub does not count downloads for Spaces. Use `likes`, `trendingScore` and `runtimeStage` instead.
`minDownloads` is ignored for Spaces and `sort: downloads` sorts them by likes.

**Why is `card` empty for some models?**
Gated models (e.g. Llama, Gemma with license acceptance) do not publish their README to anonymous users:
`cardError` is `gated or private`. Repos without README get `no README`, repos with only a YAML header get `empty`.

**How are `minDownloads`, `minLikes` and `createdWithinDays` applied?**
The Hub API cannot filter on them, so the Actor reads the sorted list and skips items that do not match. With a
matching sort (`downloads`, `likes` or `createdAt`) it stops at the first item below the threshold. With another
sort it scans up to 10,000 items per query, so very strict filters may return fewer items (see `SUMMARY`).

**Can I scrape one specific model?**
Yes, put its id or URL in `itemIds` (for example `Qwen/Qwen-Image-2.1` or
`https://huggingface.co/datasets/openai/gsm8k`). You can leave `resourceTypes` empty to scrape only those repos.

**How fresh is the data?**
Live: every run calls the Hub API. Download counts are the Hub's own (updated by the Hub about daily).

### Limitations

- Only public repos. Private repos are not visible; gated repos are listed but their cards are not readable.
- The Hub API combines filters with AND per query, so several authors/tasks/libraries are queried one by one
  (max 100 combinations per run).
- `pipelineTags` and `libraries` do not apply to Spaces; `libraries` does not apply to datasets.
- The Hub limits anonymous API use (about 500 requests per 5 minutes). The Actor pauses when the limit is near,
  so very large runs (tens of thousands of items) take longer.

### Legal

The Actor reads only public metadata and README files that Hugging Face shows to every visitor through its public
API. It does not log in, bypass gating or collect personal data beyond public usernames of repo owners. Model
cards, datasets and code remain the property of their authors and are subject to their licenses (see `license`).
Make sure your use of the data complies with the Hugging Face Terms of Service and applicable laws.

### Related tools

- [Substack to Markdown for AI & RAG](https://apify.com/mersetti/substack-to-markdown)
- [Career Sites Jobs Feed (11 ATS)](https://apify.com/mersetti/ats-jobs-feed)
- [Shopify Store Products & Price Change Monitor](https://apify.com/mersetti/shopify-products-monitor)

# Actor input Schema

## `resourceTypes` (type: `array`):

What to scrape from the Hugging Face Hub: "models", "datasets" and/or "spaces". Each type is listed separately and gets its own maxItems.

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

Order of the list (always descending). "trendingScore" = what is trending on huggingface.co right now. Spaces have no downloads, so "downloads" sorts Spaces by likes.

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

Maximum number of models, datasets and Spaces (each) to output after filtering.

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

Keyword matched against repo names, e.g. "llama", "whisper", "flux". Empty = no keyword filter.

## `authors` (type: `array`):

Only repos owned by these users or organizations, e.g. "google", "meta-llama", "Qwen". Several authors are queried separately and merged.

## `pipelineTags` (type: `array`):

Only models with these tasks, e.g. "text-generation", "text-to-image", "automatic-speech-recognition". For datasets this filters by task category. Ignored for Spaces.

## `libraries` (type: `array`):

Only models tagged with these libraries, e.g. "transformers", "diffusers", "gguf", "mlx", "sentence-transformers". Models only.

## `minDownloads` (type: `integer`):

Skip models and datasets with fewer downloads in the last 30 days. 0 = no minimum. Ignored for Spaces.

## `minLikes` (type: `integer`):

Skip repos with fewer likes. 0 = no minimum.

## `createdWithinDays` (type: `integer`):

Only repos created in the last N days (e.g. 7 for new trending releases). 0 = any age. Tip: combine with sort "createdAt" or "trendingScore".

## `itemIds` (type: `array`):

Scrape these exact repos instead of (or in addition to) lists. Use ids or URLs: "meta-llama/Llama-3.1-8B-Instruct" (model), "datasets/openai/gsm8k", "spaces/enzostvs/deepsite" or https://huggingface.co/... links. List filters do not apply to them.

## `includeCard` (type: `boolean`):

Adds the README text (model card, dataset card or Space README) without its YAML header, as Markdown in the "card" field. One extra request per item. Gated repos return cardError "gated or private".

## `cardMaxChars` (type: `integer`):

Longer cards are cut to this length (cardTruncated = true).

## `monitorMode` (type: `string`):

"off": output every matching item. "new": only items not seen in previous runs (e.g. newly trending models). "growth": only items whose likes or downloads grew since the previous run. "newAndGrowth": both. Schedule the Actor (e.g. daily) to get a change feed; you pay only for output items.

## `monitorId` (type: `string`):

Name of the saved state. Use different IDs for different watchlists.

## `baselineOnFirstRun` (type: `boolean`):

The first time a list (resource type + filters) is monitored, only save its items (no output, no cost), so later runs report real changes.

## `minLikesGrowth` (type: `integer`):

Growth mode: report an item when its likes grew by at least this many since the previous run. 0 = any growth (likes or downloads).

## `minDownloadsGrowth` (type: `integer`):

Growth mode: also report an item when its downloads grew by at least this many since the previous run (all-time downloads when available). 0 = do not use downloads.

## Actor input object example

```json
{
  "resourceTypes": [
    "models",
    "datasets",
    "spaces"
  ],
  "sort": "trendingScore",
  "maxItems": 20,
  "minDownloads": 0,
  "minLikes": 0,
  "createdWithinDays": 0,
  "includeCard": false,
  "cardMaxChars": 20000,
  "monitorMode": "off",
  "monitorId": "default",
  "baselineOnFirstRun": true,
  "minLikesGrowth": 1,
  "minDownloadsGrowth": 0
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "resourceTypes": [
        "models",
        "datasets",
        "spaces"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("mersetti/huggingface-hub-trends").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 = {
    "resourceTypes": [
        "models",
        "datasets",
        "spaces",
    ],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("mersetti/huggingface-hub-trends").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 '{
  "resourceTypes": [
    "models",
    "datasets",
    "spaces"
  ],
  "maxItems": 20
}' |
apify call mersetti/huggingface-hub-trends --silent --output-dataset

```

## MCP server setup

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

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/bpHJzkRrCPnztRR71/builds/woscj67cXXdaSVBlY/openapi.json
