# Hugging Face Scraper — Trending Models, Datasets & Spaces (`agentdataco/huggingface-trending`) Actor

Scrape Hugging Face models, datasets and Spaces sorted by trending score, likes or downloads: task, library, license, likes, downloads and dates. Official Hub API, no login. Filter by org, task or search term.

- **URL**: https://apify.com/agentdataco/huggingface-trending.md
- **Developed by:** [Agent Data Co](https://apify.com/agentdataco) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 70.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 **Hugging Face models**, **datasets** and **Spaces**, sorted by **trending score**, likes, downloads or recency. Each row has the repo id and URL, **likes**, **downloads**, trending score, task (pipeline tag), library, license and created/modified dates. Filter by organisation (e.g. `google`, `meta-llama`), model task (e.g. `text-generation`) or a search term. It uses the official Hugging Face Hub API: no login, browser or proxy.

### What does this Hugging Face scraper do?

It calls the Hub's public `/api/models`, `/api/spaces` and `/api/datasets` endpoints with your sort and filters and returns tidy rows, all three types in one run if you want. The default input returns the current top trending models and Spaces in a few seconds. A Hugging Face token is optional.

### Why use it?

- Official public Hub API — no scraping
- Models, Spaces and datasets in one run
- Filter by task (e.g. text-generation) or org
- Fail-loudly empty-result guard

### Data source

Hugging Face Hub public REST API (https://huggingface.co/docs/hub/api).

### Input

- **types**: models / spaces / datasets
- **sort**: trendingScore, likes, downloads, createdAt, lastModified
- **search**: Name search
- **author**: Org filter
- **pipelineTag**: Model task
- **limitPerType**: Rows per type
- **hfToken**: Optional token

Example input:

```json
{
  "types": [
    "models"
  ],
  "sort": "trendingScore",
  "pipelineTag": "text-generation",
  "limitPerType": 50
}
```

### Output

Each dataset item looks like this:

```json
{
  "type": "model",
  "id": "google/embeddinggemma-2",
  "url": "https://huggingface.co/google/embeddinggemma-2",
  "likes": 2189,
  "downloads": 135175,
  "trendingScore": 1223,
  "license": "apache-2.0"
}
```

Export as JSON, CSV, Excel or HTML, or pull via the Apify API, webhooks, Make, Zapier, n8n or the Apify MCP server.

### How much does it cost?

Pay per event: **$0.001 per run** + **$0.001 per result** (≈ $1.00 per 1,000 results). You are never charged for results on a failed run: if no data is found, the run fails loudly with an explanation instead of returning an empty "success".

### Use cases

- AI newsletters and directories sourcing what's hot
- Investors tracking open-model momentum
- MLOps teams watching new releases from key orgs
- Daily trending dashboards

### Scheduling & monitoring

Schedule it daily or weekly in Apify Console and connect a webhook/Slack/email integration to get new items automatically.

### FAQ

**Is this legal?** It uses the official public Hugging Face Hub API. Only public repo metadata is returned. No personal data is collected.

**Something broke?** Open an issue on the Issues tab; the actor is tested daily.

### Tips

**Tip: track model momentum.** Schedule a daily run and keep each dataset; comparing likes and downloads across days shows which models and Spaces are gaining fastest, not just which are big.

***

### More AI-ecosystem Actors from Agent Data Co

Built and maintained by **Agent Data Co**. Our Actors collect public AI-ecosystem data and work well together on a daily schedule:

- [GitHub Trending AI Repos Scraper](https://apify.com/agentdataco/github-ai-agent-tracker): AI agent, MCP and LLM repos with stars and topics
- [Show HN Scraper (Hacker News AI launches)](https://apify.com/agentdataco/hn-show-hn-ai-launches): new AI launches on Hacker News with points and comments
- [MCP Servers Scraper (official MCP registry)](https://apify.com/agentdataco/mcp-registry-exporter): every server in the official MCP registry
- [LLM Pricing Scraper (OpenRouter)](https://apify.com/agentdataco/llm-model-pricing-feed): 400+ LLM prices with price-change detection
- [SaaS Pricing Page Monitor](https://apify.com/agentdataco/ai-pricing-page-monitor): plan and price changes on any pricing page
- [App Store Reviews Scraper](https://apify.com/agentdataco/ai-app-reviews): iOS reviews for any app, by country

# Actor input Schema

## `types` (type: `array`):

Any of: models, spaces, datasets.

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

Sort order (descending).

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

Optional name search, e.g. 'agent' or 'llama'.

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

Optional org filter, e.g. 'google'.

## `pipelineTag` (type: `string`):

Models only, e.g. text-generation, text-to-image.

## `limitPerType` (type: `integer`):

Max rows per type.

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

Optional read token for higher rate limits.

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

Cap on results.

## `allowEmpty` (type: `boolean`):

Do not fail on zero results.

## Actor input object example

```json
{
  "types": [
    "models",
    "spaces"
  ],
  "sort": "trendingScore",
  "limitPerType": 50,
  "maxItems": 150,
  "allowEmpty": false
}
```

# Actor output Schema

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

Dataset items produced by this run (one item per charged result).

## `runSummary` (type: `string`):

Count of results, duration and whether the charge limit was hit.

# 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("agentdataco/huggingface-trending").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("agentdataco/huggingface-trending").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 agentdataco/huggingface-trending --silent --output-dataset

```

## MCP server setup

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

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/TifmDnsHyV3SvJN7t/builds/DE49VEeU5T6inPAEQ/openapi.json
