# Hugging Face Hub Scraper (`real-estate-api/hugging-face-hub-scraper`) Actor

Hugging Face Hub Scraper is a Python tool designed to extract metadata on AI models, datasets, and Spaces from the Hugging Face Hub. Easily gather download counts, task tags, architectures, and author details into structured formats for machine learning research.

- **URL**: https://apify.com/real-estate-api/hugging-face-hub-scraper.md
- **Developed by:** [real-estate-api](https://apify.com/real-estate-api) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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

## Hugging Face Scraper: Export Models, Datasets, Spaces and Trending AI Repositories (Free)

<p align="center">
  <img src="https://imgur.com/LMd8n3h.png" alt="Hugging Face Scraper" width="800" />
</p>

Collect structured information about public Hugging Face Hub models, datasets, Spaces, trending repositories, and user or organization profiles. Export repository metadata, download counts, likes, tags, licenses, pipeline tasks, libraries, and author statistics into a dataset.

No token is required for anonymous access. You can schedule runs and export the results as CSV or JSON.

### Use Cases

- **AI market research:** Discover models and compare their recent download counts and popularity.
- **Analytics dashboards:** Track downloads, likes, and trending scores for topics such as Llama.
- **Developer ecosystem research:** Explore public author and organization profiles, follower counts, plans, and biographies.
- **Dataset discovery:** Find datasets by search term, license, or language.
- **Competitive monitoring:** Track an organization's repositories and compare engagement over time.
- **AI newsletters:** Collect trending models, datasets, and Spaces for regular research updates.

### What Data Does This Actor Extract?

The actor supports repository lists and details for models, datasets, and Spaces, as well as trending repositories and author profiles.

Example model record:

```json
{
  "repoType": "model",
  "id": "meta-llama/Llama-3.2-1B-Instruct",
  "url": "SOURCE_URL",
  "author": "meta-llama",
  "downloads": 6882090,
  "likes": 1812,
  "pipelineTag": "text-generation",
  "libraryName": "transformers",
  "license": "llama3.2",
  "languages": ["en"],
  "arxivIds": ["2204.05149", "2405.16406"],
  "createdAt": "2024-09-18T15:12:47.000Z",
  "rank": 1
}
```

Dataset descriptions are available as `repoDescription`. Author profile types are available as `profileKind` and `type`. Download counts represent the Hub's reported last-30-days figure, not all-time downloads.

Schedule runs to refresh trending lists or monitor repository statistics. Each run saves its results to the default dataset.

### Input

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `models` | Operation: `models`, `datasets`, `spaces`, `repo_details`, `trending`, or `authors`. |
| `search` | string | `llama` | Search text for list modes. |
| `author` | string | Empty | Restrict a list to a user or organization. |
| `filterTags` | string\[] | Empty | Filter by tags, such as `text-classification` or `license:mit`. |
| `pipelineTag` | string | Empty | Filter by task, such as `text-generation` or `text-to-image`. |
| `sort` | string | `downloads` | Sort by `downloads`, `likes`, `trendingScore`, `lastModified`, or `createdAt`. The latter two options were not rechecked in the live test. |
| `full` | boolean | `false` | Request author, card, and trending-score data in list results. |
| `includeFiles` | boolean | `false` | Include file names in repository details. Leave disabled for large datasets. |
| `repoIds` | string\[] | Empty | Repository IDs or Hugging Face repository URLs for details mode. |
| `authors` | string\[] | Empty | Usernames or organization names for authors mode. |
| `trendingType` | string | `all` | Trending category: `all`, `model`, `dataset`, or `space`. Filtering is applied after retrieval. |
| `maxItems` | integer | `200` | Maximum number of output rows, including error rows. Maximum: 10,000. |
| `timeoutSecs` | integer | `300` | Stop after this many seconds while retaining saved rows. |
| `requestTimeoutSecs` | integer | `30` | Timeout for an individual request. |
| `hfToken` | string | Empty | Optional Hugging Face access token. Leave empty for anonymous access. |

### Examples

#### Search Models

```json
{
  "mode": "models",
  "search": "llama",
  "sort": "downloads",
  "pipelineTag": "text-generation",
  "maxItems": 100
}
```

#### Get Repository Details

```json
{
  "mode": "repo_details",
  "repoIds": [
    "meta-llama/Llama-3.1-8B-Instruct",
    "HuggingFaceFW/fineweb",
    "spaces/black-forest-labs/FLUX.1-dev"
  ],
  "includeFiles": false
}
```

#### Get Trending Repositories

```json
{
  "mode": "trending",
  "trendingType": "model",
  "maxItems": 50
}
```

#### Get Author Profiles

```json
{
  "mode": "authors",
  "authors": ["meta-llama"]
}
```

### Output Fields

Repository records, trending records, and author records use different fields. Some fields are optional and appear only when the source provides them or when the selected mode requests additional details.

| Field | Type | Description |
|---|---|---|
| `repoType` | string | Repository category: `model`, `dataset`, or `space`. |
| `id` | string | Repository identifier, typically `org/name`. |
| `url` | string | Public repository or profile URL. |
| `author` | string | Repository owner. |
| `name` | string | Repository name or user/organization slug. |
| `downloads` | integer | Last-30-days download count, when available. |
| `likes` | integer | Number of likes. |
| `trendingScore` | number | Trending score, when available. |
| `pipelineTag` | string | Model task or pipeline category. |
| `libraryName` | string | Associated library, such as `transformers`. |
| `sdk` | string | Space SDK, such as `gradio`. |
| `tags` | array | Repository tags. |
| `license` | string | License from card metadata or a `license:` tag. |
| `languages` | array | Languages from tags and card metadata. |
| `arxivIds` | array | Paper identifiers extracted from `arxiv:` tags. |
| `baseModel` | string | Base model from card metadata or a `base_model:` tag. |
| `gated` | string | Gating status, such as `false` or `manual`. |
| `private` | boolean | Whether the repository is marked private. |
| `disabled` | boolean | Whether the repository is disabled. |
| `createdAt` | string | Repository creation timestamp. |
| `lastModified` | string | Last modification timestamp. List-mode Spaces may omit this unless full metadata is requested. |
| `usedStorageBytes` | integer | Storage usage reported in repository details. |
| `numParameters` | integer | Model parameter count, when present in trending records. |
| `repoDescription` | string | Dataset card excerpt. |
| `spacesUsing` | array | Spaces using a model, when available in model details. |
| `modelsUsed` | array | Models used by a Space, when available in Space details. |
| `files` | array | File names when `includeFiles` is enabled. |
| `rank` | integer | Position among repository rows in the current run. |
| `profileKind` | string | Author type: `user` or `org`; also available as `type`. |
| `fullname` | string | Author's display name. |
| `bio` | string | Public profile overview. These records do not include email addresses. |
| `isPro` | boolean | User Pro status, when available. |
| `isVerified` | boolean | Organization verification status, when available. |
| `plan` | string | Organization plan, when available. |
| `numModels` | integer | Number of models associated with an author. |
| `numDatasets` | integer | Number of datasets associated with an author. |
| `numSpaces` | integer | Number of Spaces associated with an author. |
| `numPapers` | integer | Number of papers associated with an author. |
| `numFollowers` | integer | Follower count. |
| `numFollowing` | integer | Number of accounts followed by a user. |
| `numUsers` | integer | Organization member count. |
| `orgs` | array | Organizations associated with a user. |
| `avatarUrl` | string | Avatar image URL. |
| `error` | string | Error information for a failed input. Processing continues where possible. |
| `statusCode` | integer | HTTP status code associated with a failed request. |

#### Missing or Private Repositories

A repository that is missing or inaccessible may produce a `NOT_FOUND_OR_PRIVATE` error row with status code `401` during anonymous access. The actor records the error and continues processing other inputs.

### How It Works

1. Select a mode and configure your search, filters, repository IDs, or author names.
2. List results are retrieved in pages of up to 1,000 rows. Additional pages are followed when available, subject to the configured row limit.
3. Repository detail mode retrieves metadata for individual models, datasets, or Spaces. Detail requests run at a maximum concurrency of five.
4. Trending mode retrieves trending repository records and applies the selected category filter.
5. Authors mode attempts to retrieve organization overview data and then user overview data.
6. If `hfToken` is supplied, it is used for authorization. Duplicate repository IDs are skipped.
7. Processing stops when `maxItems` or `timeoutSecs` is reached. Rows already saved are retained.

### Limits and Error Handling

- **Anonymous request allowance:** The Hub's documented allowance for the relevant resources is 500 requests per 300 seconds per IP.
- **Rate-limit handling:** The actor checks rate-limit information and waits when fewer than five requests remain. When a request receives a `429` response, it waits for the reset time indicated by the rate-limit headers and retries.
- **Concurrency:** Repository detail requests run at a maximum of five at a time.
- **Maximum output:** Up to 10,000 rows per run, including error rows.
- **Large repositories:** File names can be included, but model weights and dataset contents are not downloaded. Disable `includeFiles` for very large datasets.
- **Private and gated content:** The actor does not download private or gated files. Available gating metadata may still be recorded.
- **Sorting:** `lastModified` and `createdAt` are accepted options, but they were not included in the live check conducted on October 12, 2026.

### FAQ

#### How many repositories can one run export?

The default limit is 200 rows, and the maximum is 10,000. List modes continue through available pages until the row cap, timeout, or end of the available results.

#### Why does a missing repository return `NOT_FOUND_OR_PRIVATE`?

During anonymous access, the Hub may return status `401` for a missing or private repository. The actor records this condition as `NOT_FOUND_OR_PRIVATE` because the response does not reliably distinguish the two cases.

#### Are model download counts all-time?

No. The `downloads` field represents the Hub's reported download count for the last 30 days.

#### Does the actor download model weights or dataset files?

No. It collects metadata. When `includeFiles` is enabled, it records file names rather than downloading the files themselves.

#### Can I track trending AI models on a schedule?

Yes. Choose `trending` mode or sort a model search by `trendingScore`, then schedule runs in Apify to compare results over time.

### Trademark Notice

Hugging Face and related names, logos, and trademarks belong to their respective owners. Their use in this documentation is solely to identify the source of the data and does not imply affiliation, sponsorship, endorsement, or partnership.

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or otherwise officially associated with Hugging Face.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. Scraping is not the same thing as hacking, and there is no single law that bans it. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

Search models, datasets, or Spaces, open repos by id or URL, list what is trending, or load user and organization stats.

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

Text sent as the Hub search parameter for model, dataset, and Space lists. Leave blank to take the default listing.

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

Limit a model, dataset, or Space search to this user or organization, for example meta-llama.

## `filterTags` (type: `array`):

Hub tag filters such as text-classification, license:mit, language:en, or gguf. Each line is sent as a filter parameter.

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

Task filter, for example text-generation or text-to-image. Applied on model, dataset, and Space search.

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

Sort list results. downloads, likes, and trendingScore were checked against the Hub. lastModified and createdAt are documented by Hugging Face and were not rechecked.

## `full` (type: `boolean`):

Ask the list API for author, card data, gated flag, last modified, and trending score. File names are stored only when Include file list is on.

## `includeFiles` (type: `boolean`):

Store repository file names. Leave this off for large datasets such as fineweb, where the file list is huge. Weights and data files are never downloaded.

## `repoIds` (type: `array`):

Used in repo details mode. One model id, dataset URL, or spaces/org/name per line.

## `authors` (type: `array`):

Used in authors mode. Each line is a Hugging Face user or organization. The org overview is tried first, then the user overview.

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

Keep all trending repos, or only models, datasets, or Spaces. Filtering is done after download because a type query on the trending endpoint was not verified.

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

Stop after this many saved rows, including error rows. Free version cap is 10,000 per run.

## `timeoutSecs` (type: `integer`):

Stop the run after this many seconds and keep rows already saved.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for one Hub response before recording a request error.

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

Optional token sent as a Bearer header. It raises the Hub rate limit. Leave empty to use the anonymous allowance. The actor does not ship with a token.

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

Optional proxy for Hub requests. Leave this off unless your IP is rate limited. Anonymous calls allow 500 requests per 300 seconds.

## Actor input object example

```json
{
  "mode": "models",
  "search": "llama",
  "author": "meta-llama",
  "filterTags": [
    "text-classification",
    "license:mit"
  ],
  "pipelineTag": "text-generation",
  "sort": "downloads",
  "full": false,
  "includeFiles": false,
  "repoIds": [
    "meta-llama/Llama-3.1-8B-Instruct",
    "https://huggingface.co/datasets/HuggingFaceFW/fineweb",
    "spaces/black-forest-labs/FLUX.1-dev"
  ],
  "authors": [
    "meta-llama"
  ],
  "trendingType": "all",
  "maxItems": 200,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Model id, downloads, likes, task, and license.

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

Dataset id, downloads, likes, license, and card excerpt.

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

Space id, SDK, likes, and author.

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

User or organization name, followers, model count, and plan.

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

Inputs that failed, with the error code and HTTP status.

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

Every row from the run, without a table view applied.

# 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 = {
    "search": "llama",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("real-estate-api/hugging-face-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 = {
    "search": "llama",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("real-estate-api/hugging-face-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 '{
  "search": "llama",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call real-estate-api/hugging-face-hub-scraper --silent --output-dataset

```

## MCP server setup

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