# HuggingFace Scraper: Hugging Face Models, Datasets & Spaces (`best_celerytop/huggingface-hub-scraper`) Actor

HuggingFace Hub scraper. Search Hugging Face models, datasets and Spaces by name, author, task, library, license, language and tags. One row per repository: downloads, likes, trending, license, base model, parameters, architecture, files, storage, inference status. Official Hub API, no key.

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

## Pricing

from $0.70 / 1,000 repositories

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: Models, Datasets & Spaces

Search the [Hugging Face Hub](https://huggingface.co), the largest registry of open AI models (2M+), datasets and demo apps, and get every matching repository as one clean row: downloads in the last 30 days, likes, trending score, task, library, license, languages, base model, parameter count and precision, architecture, file list with sizes, storage used, inference status, how many Spaces use the model, and optionally the full README (model card).

The Actor uses the official Hugging Face Hub API. No login, no browser, no proxies, no API key.

### What you can do with it

- **AI market research and investing**: which models, authors and licenses are gaining downloads; new releases by an organization; trending repositories per task.
- **Model selection**: every text-generation model under Apache-2.0 with 7 billion parameters or less, sorted by downloads, with file sizes to judge the download.
- **Dataset discovery**: datasets by task, language and size category with licenses and descriptions.
- **Compliance and due diligence**: licenses, gated status, base models and training datasets of the models a team uses.
- **Monitoring**: schedule a run sorted by "Recently created" for an author or task to catch new releases.

### Input

| Field | Type | Description |
|---|---|---|
| `type` | string | `models` (default), `datasets` or `spaces`. |
| `queries` | array | Words searched in repository names, one search per line. Empty means browse by filters. |
| `author` | string | User or organization, for example `meta-llama`, `google`. |
| `task` | string | Pipeline tag (`text-generation`, `text-to-image`, `automatic-speech-recognition`...) or dataset task category. |
| `library` | string | Models: `transformers`, `diffusers`, `gguf`, `onnx`, `sentence-transformers`... |
| `license` | string | `apache-2.0`, `mit`, `llama3.1`, `cc-by-4.0`... |
| `language` | string | Two-letter code: `en`, `de`, `zh`, `vi`... |
| `tags` | array | Any other Hub tags, for example `conversational`, `safetensors`. |
| `sortBy` | string | `downloads` (default, last 30 days), `likes`, `trending`, `lastModified`, `createdAt`. |
| `minDownloads`, `minLikes` | integer | Skip repositories below these counts. |
| `ids` | array | Specific repositories, for example `meta-llama/Llama-3.1-8B-Instruct`. |
| `includeDetails` | boolean | Add license, base model, parameters, architecture, files, storage, inference status. Default `true`. |
| `includeReadme` | boolean | Add the full README text. Default `false`. |
| `maxFilesPerItem` | integer | Cap on the file list. Default `100`. |
| `maxItems` | integer | Maximum number of repositories saved. Default `100`. |

#### Example input

```json
{
    "type": "models",
    "task": "text-generation",
    "license": "apache-2.0",
    "library": "transformers",
    "sortBy": "downloads",
    "minDownloads": 10000,
    "maxItems": 200
}
```

### Output

One dataset item per repository.

```json
{
    "type": "model",
    "id": "meta-llama/Llama-3.1-8B-Instruct",
    "url": "https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct",
    "author": "meta-llama",
    "name": "Llama-3.1-8B-Instruct",
    "downloads": 4538631,
    "likes": 8892,
    "trendingScore": 12,
    "license": "llama3.1",
    "languages": ["en", "de", "fr", "it", "pt", "hi", "es", "th"],
    "tags": ["transformers", "safetensors", "llama", "text-generation", "conversational", "arxiv:2204.05149", "license:llama3.1"],
    "gated": true,
    "private": false,
    "createdAt": "2024-07-18T08:56:00.000Z",
    "lastModified": "2024-09-25T17:00:57.000Z",
    "sha": "0e9e39f249a16976918f6564b8830bc894c89659",
    "task": "text-generation",
    "library": "transformers",
    "baseModels": ["meta-llama/Meta-Llama-3.1-8B"],
    "datasetsUsed": [],
    "arxivIds": ["2204.05149"],
    "licenseName": null,
    "filesCount": 17,
    "files": [{ "name": "model-00001-of-00004.safetensors", "sizeBytes": 4976698672 }],
    "usedStorageBytes": 32123357950,
    "downloadsAllTime": null,
    "parameters": 8030261248,
    "parameterDtypes": ["BF16"],
    "architectures": ["LlamaForCausalLM"],
    "modelType": "llama",
    "inferenceStatus": "warm",
    "spacesUsingCount": 100,
    "evalResultsCount": 0,
    "disabled": false,
    "scrapedAt": "2026-11-12T08:30:00.000Z"
}
```

Dataset rows add `description`, `taskCategories`, `sizeCategory`, `formats`, `modalities`, `configs` and `prettyName`. Space rows add `title`, `emoji`, `sdk`, `appUrl`, `runtimeStage`, `hardware` and the `models` and `datasets` the Space uses. Fields the Hub does not have for a repository are `null` or empty lists.

A `RUN_SUMMARY` record in the key-value store lists how many repositories each search returned.

### Good to know

- **Scale.** Lists come 1,000 repositories per request, so browsing a whole task or author is quick. With `includeDetails` on, one extra request per repository runs five in parallel: about 1,000 repositories in three to four minutes.
- **Downloads** are the Hub's rolling 30-day count, the same number shown on the website.
- **Parameters** come from the safetensors metadata and are `null` for models stored in other formats (GGUF, older PyTorch files).
- **Gated repositories** (Llama, Gemma and similar) return all metadata but no README, because the card requires accepting a license.
- **Spaces** have no download count; they are sorted by likes unless you choose another order.
- **Polite by design.** Requests go to the public API with small pauses and a plain user agent.
- **Price.** $1 per 1,000 repositories, no start fee; platform usage is included.
- **Works with n8n, Make, Zapier and AI agents.** The official Apify node for n8n runs this Actor and returns the rows inside a workflow, Make and Zapier use the Apify integration, and AI agents call it as a tool through the Apify MCP server.

### FAQ

**Can I get a model's files?**
Every file row has a name and size; download it from `https://huggingface.co/{id}/resolve/main/{file}` for public repositories.

**Does it cover private repositories?**
No. Only public repositories are listed by the Hub API without authentication.

**How do I get download counts for Hugging Face models?**
Filter by task, author or keyword and run. Every row has `downloads` (last 30 days), `likes` and the trending score.

**Does Hugging Face have a public API?**
Yes, the Hub API. Public models, datasets and Spaces need no token, and the Actor uses it directly.

**How do I export a list of Hugging Face models to CSV?**
Download the run's dataset as CSV, Excel or JSON, or read it through the Apify API.

**Can I use it from n8n or an AI agent?**
Yes. Start it through the official Apify node for n8n, the Make or Zapier integration, or the Apify MCP server, and read the rows back from the dataset.

**Something is missing or broken?**
Open an issue on the Issues tab and include the input you used.

### Disclaimer

This Actor is an independent tool. It is not affiliated with, endorsed by or sponsored by Hugging Face. Repository metadata belongs to the respective authors.

# Actor input Schema

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

Models, datasets or Spaces (hosted demo apps).

## `queries` (type: `array`):

Words searched in repository names, one search per line, for example `llama`, `whisper`, `stable diffusion`. Leave empty to browse by the filters below.

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

Only repositories of this user or organization, for example `meta-llama`, `google`, `openai`.

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

Pipeline tag for models (`text-generation`, `image-classification`, `automatic-speech-recognition`...) or task category for datasets (`question-answering`, `text-classification`...).

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

Models only: `transformers`, `diffusers`, `gguf`, `onnx`, `sentence-transformers`, `pytorch`...

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

For example `apache-2.0`, `mit`, `llama3.1`, `cc-by-4.0`.

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

Two-letter language code, for example `en`, `de`, `zh`, `vi`.

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

Any further Hub tags, for example `conversational`, `safetensors`, `region:us`, `arxiv:2307.09288`.

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

Order of the results, highest first. Downloads count the last 30 days.

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

Skip repositories with fewer downloads in the last 30 days.

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

Skip repositories with fewer likes.

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

Specific repositories, for example `meta-llama/Llama-3.1-8B-Instruct`. Can be combined with a search.

## `includeDetails` (type: `boolean`):

Add license, languages, base model, parameter count and dtypes, architecture, file list with sizes, storage used, inference status and the number of Spaces using the model. One extra request per repository.

## `includeReadme` (type: `boolean`):

Add the full README text. One more request per repository; gated repositories return no README.

## `maxFilesPerItem` (type: `integer`):

Cap on the file list length.

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

Maximum number of repositories saved in the run.

## Actor input object example

```json
{
  "type": "models",
  "queries": [
    "llama"
  ],
  "sortBy": "downloads",
  "includeDetails": true,
  "includeReadme": false,
  "maxFilesPerItem": 100,
  "maxItems": 20
}
```

# Actor output Schema

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

Models, datasets or Spaces with their metadata, statistics and files.

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

How many repositories each search returned.

# 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 = {
    "type": "models",
    "queries": [
        "llama"
    ],
    "sortBy": "downloads",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("best_celerytop/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 = {
    "type": "models",
    "queries": ["llama"],
    "sortBy": "downloads",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("best_celerytop/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 '{
  "type": "models",
  "queries": [
    "llama"
  ],
  "sortBy": "downloads",
  "maxItems": 20
}' |
apify call best_celerytop/huggingface-hub-scraper --silent --output-dataset

```

## MCP server setup

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