# Hugging Face Scraper (`anyxsolutions/hugging-face-scraper`) Actor

Scrape AI models, datasets and Spaces from Hugging Face: downloads, likes, trending score, license, task, library, parameter count, base models, languages and Space status. Paste Hub URLs or search by keyword, get clean JSON. No login, no API key, no proxy.

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

## Pricing

from $2.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.
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

![banner](https://anyx.solutions/banners/hugging-face-scraper.png)

## Hugging Face Scraper

**Models, datasets and Spaces from the Hugging Face Hub, with downloads, likes, licenses, parameter counts and base models, as clean JSON.**

Hugging Face is where the open AI ecosystem publishes its work: over a million models, hundreds
of thousands of datasets, and the Spaces that demo them. This Actor scrapes AI models, datasets
and Spaces from Hugging Face: downloads, likes, trending score, license, task, library,
parameter count, base models, languages and Space status. Paste any Hub listing with its
filters, an organization page, or a single model, dataset or Space, or just search by keyword.
Each repo comes back with its last-30-day and all-time downloads, likes and trending score,
creation and update dates, gating, the papers it cites, and for Spaces the SDK, hardware and
whether the app is running. There is no login, no API key, and no proxy to configure. Built for
AI market research, model and vendor tracking, open-source analytics, investors watching what
developers adopt, and teams building model catalogs.

### ⚡ Quick start

```json
{
  "startUrls": [
    {
      "url": "https://huggingface.co/models?pipeline_tag=text-generation&sort=trending&search=llama"
    }
  ],
  "searchTerms": ["whisper"],
  "maxItems": 5
}
```

### 🧩 Input

| Field                | Type    | Required | Default                      | Description                                                                                                                                                                                     |
| -------------------- | ------- | -------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `startUrls`          | array   | no       | —                            | huggingface.co pages: a model, dataset or Space listing with its filters (`/models?…`, `/datasets?…`, `/spaces?…`), an organization or user (`/meta-llama`), or a model, dataset or Space page. |
| `searchTerms`        | array   | no       | —                            | Keywords to search the Hub for, one per line, for example `whisper` or `stable diffusion`.                                                                                                      |
| `repoType`           | string  | no       | `model`                      | What search terms look for: `model`, `dataset` or `space`.                                                                                                                                      |
| `sort`               | string  | no       | `trending`                   | Order of search results: `trending`, `downloads`, `likes`, `created` or `modified`. Spaces have no downloads, so for Spaces `downloads` sorts by likes.                                         |
| `task`               | string  | no       | —                            | Only return models or datasets for one task, such as `text-generation`, `automatic-speech-recognition` or `text-to-image`. Ignored for Spaces.                                                  |
| `maxItems`           | integer | no       | —                            | Maximum number of repos per start URL or search term. The input form starts at 5; leave it empty for every matching repo.                                                                       |
| `proxyConfiguration` | object  | no       | `{ "useApifyProxy": false }` | Proxy settings. The Hugging Face Hub needs no proxy.                                                                                                                                            |

Add URLs, search terms, or both. The easiest way to build a query is to filter on
[huggingface.co/models](https://huggingface.co/models) (task, library, language, license, size,
sort, search) and paste the address bar: the Actor keeps every one of those filters, and the same
goes for the datasets and Spaces pages. An organization or user page such as
`https://huggingface.co/google` returns that account's models, most downloaded first. The search
options (Search in, Sort by, Task) apply to search terms only.

### 📤 Output

Each model, dataset or Space is one dataset row, marked by `itemType`. Every row has the same
fields; a field that does not apply to that kind of repo (downloads on a Space, parameters on a
dataset) is `null`.

#### Fields

| Field               | Type    | Description                                                                                             |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| `itemType`          | string  | `model`, `dataset` or `space`.                                                                          |
| `id`                | string  | Repo ID, `owner/name`.                                                                                  |
| `author`            | string  | Owner: organization or user.                                                                            |
| `name`              | string  | Repo name without the owner.                                                                            |
| `url`               | string  | The repo's page on huggingface.co.                                                                      |
| `title`             | string  | Display title of a dataset or Space. `null` for models.                                                 |
| `description`       | string  | Dataset summary as plain text, or a Space's short description. `null` for models.                       |
| `pipelineTag`       | string  | A model's task, such as `text-generation`.                                                              |
| `taskCategories`    | array   | A dataset's task categories, such as `question-answering`.                                              |
| `library`           | string  | A model's library, such as `transformers`, `diffusers` or `gguf`.                                       |
| `tags`              | array   | Every tag on the repo.                                                                                  |
| `license`           | string  | License ID, such as `apache-2.0` or `llama3.1`.                                                         |
| `languages`         | array   | Languages declared on the repo card.                                                                    |
| `downloads`         | number  | Downloads over the last 30 days (models and datasets).                                                  |
| `downloadsAllTime`  | number  | Downloads since the repo was created (models and datasets).                                             |
| `likes`             | number  | Likes.                                                                                                  |
| `trendingScore`     | number  | Hugging Face's trending score: recent likes and activity.                                               |
| `createdAt`         | string  | When the repo was created (ISO 8601).                                                                   |
| `lastModified`      | string  | When the repo was last updated (ISO 8601).                                                              |
| `gated`             | boolean | Whether you must accept terms or be approved to download the files (models and datasets).               |
| `gatedMode`         | string  | `auto` (accept terms) or `manual` (owner approves) when gated.                                          |
| `parameterCount`    | number  | Total model parameters, from the safetensors or GGUF weights. `null` when the weights don't publish it. |
| `baseModels`        | array   | The model(s) this model was built from.                                                                 |
| `baseModelRelation` | string  | How it was built from them: `finetune`, `quantized`, `adapter` or `merge`.                              |
| `datasets`          | array   | Datasets a model was trained on (as declared on its card), or datasets a Space uses.                    |
| `models`            | array   | Models a Space uses.                                                                                    |
| `arxivIds`          | array   | arXiv IDs of the papers the repo cites.                                                                 |
| `sizeBytes`         | number  | Size of a dataset's main files in bytes.                                                                |
| `sdk`               | string  | A Space's SDK: `gradio`, `streamlit`, `docker` or `static`.                                             |
| `runtimeStage`      | string  | Whether a Space is up: `RUNNING`, `SLEEPING`, `BUILDING`, `RUNTIME_ERROR` and so on.                    |
| `hardware`          | string  | Hardware a Space runs on, such as `cpu-basic` or `zero-a10g`.                                           |
| `emoji`             | string  | A Space's emoji.                                                                                        |
| `appUrl`            | string  | The Space's app on its own domain (`*.hf.space`).                                                       |

<details><summary>Example output</summary>

```json
{
  "itemType": "model",
  "id": "meta-llama/Llama-3.1-8B-Instruct",
  "author": "meta-llama",
  "name": "Llama-3.1-8B-Instruct",
  "url": "https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct",
  "title": null,
  "description": null,
  "pipelineTag": "text-generation",
  "taskCategories": null,
  "library": "transformers",
  "tags": [
    "transformers",
    "safetensors",
    "llama",
    "text-generation",
    "facebook",
    "meta",
    "pytorch",
    "llama-3",
    "conversational",
    "en",
    "de",
    "fr",
    "it",
    "pt",
    "hi",
    "es",
    "th",
    "arxiv:2204.05149",
    "base_model:meta-llama/Llama-3.1-8B",
    "base_model:finetune:meta-llama/Llama-3.1-8B",
    "license:llama3.1",
    "eval-results",
    "text-generation-inference",
    "endpoints_compatible",
    "region:us",
    "deploy:sagemaker"
  ],
  "license": "llama3.1",
  "languages": ["en", "de", "fr", "it", "pt", "hi", "es", "th"],
  "downloads": 5858450,
  "downloadsAllTime": 189228296,
  "likes": 8375,
  "trendingScore": 62,
  "createdAt": "2024-07-18T08:56:00.000Z",
  "lastModified": "2024-09-25T17:00:57.000Z",
  "gated": true,
  "gatedMode": "manual",
  "parameterCount": 8030261248,
  "baseModels": ["meta-llama/Llama-3.1-8B"],
  "baseModelRelation": "finetune",
  "datasets": [],
  "models": null,
  "arxivIds": ["2204.05149"],
  "sizeBytes": null,
  "sdk": null,
  "runtimeStage": null,
  "hardware": null,
  "emoji": null,
  "appUrl": null
}
```

</details>

### 💡 Use cases

- **AI market research** — track which models, tasks and licenses are gaining downloads and likes, week over week.
- **Vendor and competitor tracking** — monitor every release from an organization such as `meta-llama`, `google` or `mistralai`, with parameter counts and licenses.
- **Model lineage** — map fine-tunes and quantizations back to their base models to measure a model family's reach.
- **Dataset discovery** — build catalogs of datasets by task, language, license and size.
- **Investment and partnership research** — spot fast-rising authors and Spaces by trending score.

### ❓ FAQ

- **Do I need a Hugging Face account or API token?** No. The Actor reads the same public pages anyone can browse without logging in.
- **Do I need a proxy?** No. It runs without one by default.
- **What do the download numbers mean?** `downloads` counts the last 30 days, the number Hugging Face shows on a model page; `downloadsAllTime` counts every download since the repo was created.
- **Why is `parameterCount` empty for some models?** It is read from the published weight files. Models without safetensors or GGUF weights (older PyTorch-only checkpoints, adapters, API-only models) don't publish it.
- **Can I get gated models like Llama?** Yes, their public details: downloads, likes, license and so on. `gated` tells you that downloading the weights needs approval; the Actor never downloads files.
- **How many repos can I get?** As many as the listing has. Leave `maxItems` empty to page through every match; each page holds 100 repos. Hugging Face limits how fast anonymous clients can browse, so very large runs pause briefly when they hit that limit and then continue.

### 🔗 More scrapers by Anyx

- [Hacker News Scraper](https://apify.com/anyxsolutions/hacker-news-scraper)
- [Web Content Scraper](https://apify.com/anyxsolutions/web-content-scraper)
- [Reddit Scraper](https://apify.com/anyxsolutions/reddit-scraper)
- [Google Search Scraper](https://apify.com/anyxsolutions/google-search-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

### 🖼 Image credit

Image credit: [huggingface.co](https://huggingface.co/)

# Actor input Schema

## `startUrls` (type: `array`):

huggingface.co pages: a model, dataset or Space listing with its filters (https://huggingface.co/models?pipeline_tag=text-generation\&sort=trending, /datasets?…, /spaces?…), an organization or user (https://huggingface.co/meta-llama) for its models, or a single model, dataset or Space page.

## `searchTerms` (type: `array`):

Keywords to search the Hub for, one per line, for example whisper or stable diffusion. Each term searches the repo type picked below, sorted and filtered by the options below.

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

Which kind of repository the search terms look for: models, datasets or Spaces (hosted demo apps).

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

Order of search results: trending (the Hub's default), most downloads, most likes, recently created or recently updated. Spaces have no downloads, so for Spaces most downloads sorts by likes.

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

Only return models (or datasets) for one task, using the Hub's task name, for example text-generation, automatic-speech-recognition or text-to-image. Ignored for Spaces.

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

Maximum number of models, datasets or Spaces to return per start URL or search term. Leave empty for every matching repo.

## `proxyConfiguration` (type: `object`):

Proxy settings. The Hugging Face Hub is public and needs no proxy.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://huggingface.co/models?pipeline_tag=text-generation&sort=trending&search=llama"
    }
  ],
  "searchTerms": [
    "whisper"
  ],
  "repoType": "model",
  "sort": "trending",
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://huggingface.co/models?pipeline_tag=text-generation&sort=trending&search=llama"
        }
    ],
    "searchTerms": [
        "whisper"
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/hugging-face-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 = {
    "startUrls": [{ "url": "https://huggingface.co/models?pipeline_tag=text-generation&sort=trending&search=llama" }],
    "searchTerms": ["whisper"],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/hugging-face-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 '{
  "startUrls": [
    {
      "url": "https://huggingface.co/models?pipeline_tag=text-generation&sort=trending&search=llama"
    }
  ],
  "searchTerms": [
    "whisper"
  ],
  "maxItems": 5
}' |
apify call anyxsolutions/hugging-face-scraper --silent --output-dataset

```

## MCP server setup

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