# Hugging Face Hub Scraper (`gogumaa/huggingface-hub-scraper`) Actor

Models, datasets and Spaces from the Hugging Face Hub: search, filter by tag / author, sort by downloads, likes or trending, or look up exact IDs. Public JSON API, no login, no browser.

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

## Pricing

$2.00 / 1,000 item scrapeds

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 Hub Scraper

**Hugging Face Hub scraper for models, datasets and Spaces as clean JSON, no login or API key.** Search the Hugging Face Hub, filter by task / library / license / author, sort by downloads, likes or trending score, or look up exact repo IDs. It uses the Hub's public JSON API, so runs are fast and you pay per result.

### What you can do with it

- **Model & dataset discovery** — `search: "llama"`, `filter: ["text-generation", "gguf"]`, sort by downloads to find what the community actually uses.
- **Trend tracking** — schedule `sort: trendingScore` daily and diff new entries to spot rising models and Spaces before they hit the news.
- **Competitor / org monitoring** — `author: "meta-llama"` lists every repo an org publishes with downloads, likes and last-modified dates.
- **Portfolio watch** — pass `ids` for the exact repos you depend on and track downloads, likes, gating and license over time.
- **Automation** — Schedule it on Apify and pipe results to Google Sheets, Slack, n8n or Make via the Apify integration.
- **Model selection for a project** — `filter: ["license:apache-2.0", "text-generation"]` sorted by likes gives a shortlist of permissively licensed models with their base model and library.

### Output example

```json
{
  "type": "model",
  "id": "meta-llama/Llama-3.1-8B-Instruct",
  "author": "meta-llama",
  "url": "https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct",
  "downloads": 4501381,
  "likes": 8729,
  "trending_score": null,
  "pipeline_tag": "text-generation",
  "library_name": "transformers",
  "tags": ["transformers", "safetensors", "llama", "text-generation", "license:llama3.1", "…"],
  "created_at": "2024-07-18T08:56:00.000Z",
  "last_modified": "2024-09-25T17:00:57.000Z",
  "gated": "manual",
  "private": false,
  "sha": "0e9e39f249a16976918f6564b8830bc894c89659",
  "sdk": null,
  "card_data": { "license": "llama3.1", "language": null, "base_model": "meta-llama/Llama-3.1-8B" }
}
```

`type` is `model`, `dataset` or `space`. `sdk` (gradio, streamlit, docker …) is set for Spaces. `gated` is `false`, `"auto"` or `"manual"`.

### Input

| Field | Description |
|---|---|
| `mode` | `models` (default), `datasets`, `spaces` |
| `search` | Keyword matched against repo names. |
| `author` | User or org name, e.g. `google`. |
| `filter` | List of Hub tags, all must match: task (`text-generation`), library (`pytorch`, `gguf`), `license:mit`, language (`en`) … |
| `sort` | `downloads` (default), `likes`, `lastModified`, `trendingScore`. Always descending. |
| `ids` | Exact repo IDs (or Hub URLs). When set, `search` / `author` / `filter` / `sort` are ignored. Unknown or private IDs are skipped with a warning. |
| `maxItems` | Stop after N rows. Default 100. |

### Pricing

Pay per item: one event per dataset row (model, dataset or Space). Nothing is charged for rows that are never produced.

### Notes

- `downloads` is the Hub's rolling 30-day count; `trending_score` is only filled when the Hub reports one.
- `card_data` comes from the repo card when listed, otherwise from `license:` / `base_model:` tags; `language` only from the card.
- Anonymous requests see public repos only.

### FAQ

#### Do I need an API key or account?

No. Anonymous access to the public Hub API is enough. The Hub applies its usual anonymous rate limits; normal runs of a few hundred rows stay well inside them.

#### How much does it cost?

$0.002 per result and nothing else: with pay-per-event pricing you are not billed for Apify compute. 100 results cost $0.20, and the Apify free plan's $5 monthly credit covers about 2,500 results. Rows that are never produced are never charged.

#### How do I get the data into Google Sheets / my app?

Every run writes to an Apify dataset you can download as CSV, JSON or Excel, or read from the dataset API endpoint. For ongoing feeds, use Apify integrations (Google Sheets, Slack, Zapier, Make, n8n) or call the Actor from your own code with the Apify API.

#### Is it legal / allowed?

It only reads public data via the platform's public API and respects rate limits. You are responsible for complying with Hugging Face's terms and applicable law.

#### Why is one of my `ids` missing from the results?

Anonymous requests can only see public repos. The Hub answers 401 for both private and non-existent repos, so the Actor skips those IDs with a warning in the log and charges nothing for them. Gated repos (`gated: "manual"` or `"auto"`) are public metadata and are returned normally.

### Related Actors

- [npm / PyPI Package Checker](https://apify.com/gogumaa/npm-pypi-package-checker)
- [DEV Community Articles Scraper](https://apify.com/gogumaa/devto-articles-scraper)
- [Wikipedia Scraper](https://apify.com/gogumaa/wikipedia-scraper)

# Actor input Schema

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

What to list: models, datasets or Spaces.

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

Keyword matched against repo names. Leave empty to list everything.

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

Only repos owned by this user or org, e.g. meta-llama, google.

## `filter` (type: `array`):

Hub tags, all must match: pipeline task (text-generation), library (pytorch, gguf), license:mit, language (en) …

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

Descending order.

## `ids` (type: `array`):

Exact IDs like meta-llama/Llama-3.1-8B. When set, search / author / filter / sort are ignored and each ID is fetched directly.

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

Stop after this many rows.

## Actor input object example

```json
{
  "mode": "models",
  "search": "llama",
  "author": "",
  "filter": [],
  "sort": "downloads",
  "ids": [],
  "maxItems": 100
}
```

# Actor output Schema

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

One record per model / dataset / Space: id, url, downloads, likes, trending score, tags, pipeline, library, dates and license info.

# 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 = {
    "filter": [],
    "ids": []
};

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

# Run the Actor and wait for it to finish
run = client.actor("gogumaa/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 '{
  "filter": [],
  "ids": []
}' |
apify call gogumaa/huggingface-hub-scraper --silent --output-dataset

```

## MCP server setup

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