# Hugging Face Scraper — Models, Datasets, Spaces Stats (`ponderable_hydrometer/huggingface-models`) Actor

HuggingFace scraper and API for the Hub: search and rank models, datasets or Spaces by downloads, likes or trending score. Filter by task, author or name. Returns library, license, tags and dates. Public Hugging Face Hub API, no token needed.

- **URL**: https://apify.com/ponderable_hydrometer/huggingface-models.md
- **Developed by:** [Ponderable Hydrometer](https://apify.com/ponderable_hydrometer) (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 $0.50 / 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/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 — Models, Datasets, Spaces Stats

**Which models, datasets and Spaces people actually use.** Rank the Hugging Face Hub (HuggingFace) by downloads, likes or trending score, filter by task, organization or name, and track adoption over time. Data comes from the public Hub API, with no token.

### What you can do with it

- **Find the most downloaded models** for a task such as `text-generation` or `automatic-speech-recognition`.
- **Track an organization**: list everything one author publishes with downloads and likes.
- **Spot what is trending** by sorting on `trendingScore`.
- **Compare licenses and libraries** across popular models.
- **Build a download history**: schedule the Actor and store each run to see adoption over time.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `type` | string | `models` | `models`, `datasets` or `spaces`. |
| `search` | string | — | Words in the name. |
| `author` | string | — | Organization or user. |
| `task` | string | — | Pipeline tag (models). |
| `sort` | string | `downloads` | downloads, likes, trendingScore, lastModified, createdAt. |
| `maxResults` | integer | `500` | Cap. |

Example: `{"type": "models", "task": "text-generation", "sort": "downloads", "maxResults": 100}`

### What you get

One row per repo: `type`, `id`, `author`, `downloads` (last 30 days), `likes`, `trendingScore`, `task`, `library`, `license`, `sdk` (Spaces), `gated`, `tags`, `createdAt`, `lastModified`, `url`.

### Output sample

```json
{
  "type": "models",
  "id": "meta-llama/Llama-3.1-8B-Instruct",
  "author": "meta-llama",
  "downloads": 5321876,
  "likes": 4210,
  "trendingScore": 35,
  "task": "text-generation",
  "library": "transformers",
  "license": "llama3.1",
  "sdk": null,
  "gated": "manual",
  "tags": [
    "transformers",
    "safetensors",
    "llama",
    "text-generation"
  ],
  "createdAt": "2024-07-18T08:56:00.000Z",
  "lastModified": "2024-09-25T17:00:57.000Z",
  "url": "https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct"
}
```

### Use it from the API or an AI agent

Start a run and read the rows back in one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/ponderable_hydrometer~huggingface-models/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"type": "models", "task": "text-generation", "maxResults": 20}'
```

AI agents can call it through the Apify MCP server: `https://mcp.apify.com?tools=ponderable_hydrometer/huggingface-models`.

### Limits and good to know

- `downloads` is the Hub's rolling 30-day count. It is `null` for Spaces, which the Hub does not count.
- `trendingScore` is filled on every row, whatever the `sort`. `task` and `library` apply to models only and are `null` for datasets and Spaces; `sdk` is filled for Spaces only.
- Datasets and Spaces: the `task` filter applies to models only. Spaces have no meaningful download ranking, so sort them by `likes` or `trendingScore`.
- Private repos are not visible; gated repos are listed with their access mode.
- `search` matches words in the repo name, not in model cards or descriptions.
- Model cards, files and README text are not downloaded; this Actor returns Hub metadata only.
- Schedule it to build a download history for the models you follow.

### FAQ

**Do I need a Hugging Face token?** No. It uses the public Hub API, so only public repos are returned.

**Is it HuggingFace or Hugging Face?** Same site. Both spellings find this Actor.

**Can it list papers or leaderboards?** No. It covers models, datasets and Spaces.

### Pricing

Pay per result — **$0.50 per 1,000 results** (one repo = one result), plus Apify's standard per-run start event ($0.00005 per GB of memory, so a fraction of a cent per run). No subscription.

# Actor input Schema

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

Models, datasets or Spaces.

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

Words in the repo name, e.g. "llama" or "whisper". Empty = all.

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

Optional, e.g. meta-llama, google, mistralai.

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

Pipeline tag, e.g. text-generation, automatic-speech-recognition.

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

Order of results.

## `maxResults` (type: `integer`):

Stop after this many repos.

## Actor input object example

```json
{
  "type": "models",
  "search": "",
  "author": "",
  "task": "",
  "sort": "downloads",
  "maxResults": 25
}
```

# Actor output Schema

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

All rows produced by this run, as JSON.

# 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 = {
    "maxResults": 25
};

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

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

```

## MCP server setup

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

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/72mM2cqm4dQrmj8am/builds/bCVUbfNvX9pcsnf7x/openapi.json
