# Hugging Face Scraper - Models, Datasets, Spaces & Leads (`scrapesage/hugging-face-scraper`) Actor

Scrape the Hugging Face Hub via its official API: models, datasets and Spaces with downloads, likes, trending score, license, tags, parameters, eval results and linked Spaces — plus author/org profiles with a creator-lead wedge and a new-release monitor. Keyless, no browser.

- **URL**: https://apify.com/scrapesage/hugging-face-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** AI, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.20 / 1,000 model scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Hugging Face Scraper — Models, Datasets, Spaces & Creator Leads

Export the **richest Hugging Face Hub dataset on Apify**. Pull **models, datasets and Spaces** with the metrics that matter — **downloads, likes, trending score, license, task, library, parameter count, evaluation results, linked Spaces and file/storage sizes** — and resolve every repo's **author or organization to a profile with website, socials and a contact lead**. Built on the **official Hugging Face Hub API**: keyless, no browser, no login.

### Why this Hugging Face scraper?

Other Hub scrapers do one thing — models *or* datasets *or* papers — and stop at the listing fields. This actor unifies the whole Hub, reads each repo's full detail record, and adds the creator-lead layer none of them have.

| Data | Typical scrapers | This actor |
|---|---|---|
| Models | ✅ | ✅ |
| Datasets & Spaces in the same run | ❌ | ✅ |
| Downloads, likes & trending score | ✅ | ✅ |
| License, task, library, languages, base models | partial | ✅ |
| Parameter count, file count & storage size | ❌ | ✅ |
| Evaluation results (model-index) | ❌ | ✅ |
| Linked Spaces / models | ❌ | ✅ |
| Author / org profile (stats, website, socials) | ❌ | ✅ opt-in |
| Contact email lead (website crawl) | ❌ | ✅ opt-in |
| Popularity & lead scores (0–100) | ❌ | ✅ |
| Monitor mode — only new releases | ❌ | ✅ |
| Start fee | sometimes | ❌ never |

### Use cases

- **AI/ML competitive intelligence** — track a competitor's or organization's models, datasets and Spaces: how many downloads and likes, which tasks and licenses, how fast they ship. Schedule recurring runs to watch momentum.
- **Model & dataset discovery** — find the top models for a task (`text-generation`, `text-to-image`, `automatic-speech-recognition`), filter by library, license, language or minimum downloads, and rank by popularity.
- **Lead generation for AI infra & MLOps** — turn on author profiles to collect the org/lab behind each model, with website, socials and a contact email — ideal for selling GPUs, inference, eval, data-labeling and tooling into AI builders.
- **Recruiting & talent sourcing** — surface the authors publishing the most-downloaded models in a domain, with their profile and links.
- **Trend & release monitoring** — monitor mode emits only newly released models/datasets/Spaces, so you get a clean feed of what just dropped in a field or from an org.

### How to use

1. [Sign up for Apify](https://console.apify.com/sign-up) — the free plan is enough to try this actor.
2. Open the **Hugging Face Scraper**, enter search queries, repo URLs or author names (or leave them empty to pull the most-downloaded models), pick your content types, and click **Start**.
3. Watch results stream into the dataset table as each repo is parsed.
4. **Export** as JSON, CSV, Excel, XML, or RSS — or pull results programmatically via the [Apify API](https://docs.apify.com/api/v2).

### Input

```json
{
    "searchQueries": ["llm", "text-to-image"],
    "contentTypes": ["models", "datasets"],
    "sortBy": "downloads",
    "pipelineTag": "text-generation",
    "minDownloads": 1000,
    "includeFullMetadata": true,
    "includeAuthorProfiles": true,
    "enrichContactEmails": true,
    "maxResults": 100,
    "maxResultsPerQuery": 60,
    "monitorMode": false
}
```

- **searchQueries** — free-text searches run against each selected content type.
- **contentTypes** — any of `models`, `datasets`, `spaces` (default `models`).
- **repoUrls** — direct model/dataset/Space pages or bare ids (e.g. `meta-llama/Llama-3.1-8B-Instruct`).
- **authors** — usernames or organizations to pull a profile + lead (e.g. `meta-llama`, `stabilityai`).
- **startUrls** — optional mixed list of huggingface.co URLs, auto-classified.
- **browseHub** *(default false)* — also browse the top of the Hub; auto-enabled when no other input is given.
- **sortBy** *(default downloads)* — `downloads`, `likes`, `trendingScore`, `lastModified` or `createdAt`.
- **pipelineTag / libraryName / language / license / authorFilter / minDownloads / minLikes / excludeGated** — filters.
- **includeFullMetadata** *(default true)* — fetch each repo's detail (params, files, eval results, linked Spaces). Turn OFF for a fast, cheap listing-only crawl.
- **includeAuthorProfiles** *(default false)* — resolve each repo's author/org to a profile and attach a lead.
- **enrichContactEmails** *(default false)* — crawl the author's website for a contact email.
- **hfToken** *(optional)* — a read-only Hugging Face token for higher rate limits; never required.
- **monitorMode** *(default false)* — emit only repos/authors not seen in previous runs (see Monitoring).

### Output

One record per repo (`type: "model"`, `"dataset"` or `"space"`), plus optional `author` records:

```json
{
    "type": "model",
    "source": "huggingface",
    "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",
    "pipelineTag": "text-generation",
    "libraryName": "transformers",
    "tags": ["facebook", "llama", "conversational"],
    "languages": ["en", "de", "fr"],
    "license": "llama3.1",
    "baseModels": ["meta-llama/Llama-3.1-8B"],
    "downloads": 6562137,
    "likes": 6090,
    "trendingScore": 12,
    "parameters": 8030261248,
    "filesCount": 17,
    "storageBytes": 16060549824,
    "linkedSpaces": ["huggingface-projects/llama-3.1-8b-instruct"],
    "evalResults": [{ "task": "text-generation", "dataset": "MMLU", "metric": "acc", "value": 0.73 }],
    "createdAt": "2024-07-18T16:54:00.000Z",
    "lastModified": "2024-09-25T17:00:00.000Z",
    "authorProfile": {
        "name": "meta-llama",
        "url": "https://huggingface.co/meta-llama",
        "website": "https://ai.meta.com",
        "socials": { "github": "https://github.com/meta-llama" },
        "contactEmails": null,
        "leadScore": 47
    },
    "popularityScore": 90,
    "scrapedAt": "2026-06-16T12:00:00.000Z"
}
```

Fields are `null` only when the data genuinely doesn't exist. Empty results are reported as a successful run.

### Monitoring — get only new releases

Turn on **monitorMode** and the actor remembers the repo/author ids it has already returned (in a named key-value store) and emits only **new** ones next time. Point it at a search, an organization, or the whole Hub sorted by `createdAt` and you get a clean feed of newly released models, datasets and Spaces.

It is orthogonal to [Apify Schedules](https://docs.apify.com/platform/schedules): the schedule decides *when* a run happens, monitor mode decides *what's new*, so the two compose cleanly. Use a distinct `monitorStoreName` per watch to track them independently.

### Automate & schedule

Run this actor on autopilot and pull results into your own stack:

- **[Apify API](https://docs.apify.com/api/v2)** — start runs, fetch datasets, and manage schedules over REST.
- **[apify-client for JavaScript](https://docs.apify.com/api/client/js/)** and **[apify-client for Python](https://docs.apify.com/api/client/python/)** — official SDKs.
- **[Schedules](https://docs.apify.com/platform/schedules)** — run it hourly/daily/weekly to keep downloads, likes and release data fresh.
- **[Webhooks](https://docs.apify.com/platform/integrations/webhooks)** — trigger downstream actions the moment a run finishes.

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });

const run = await client.actor('scrapesage/hugging-face-scraper').call({
    searchQueries: ['text-to-image'],
    contentTypes: ['models'],
    sortBy: 'trendingScore',
    includeAuthorProfiles: true,
    maxResults: 200,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} repos`);
```

### Integrate with any app

Connect the dataset to 5,000+ apps — no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** — multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** — push new models or leads straight into your CRM or sheet.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** — get notified when a monitored org ships a new model.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** — auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** — pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** — trigger runs from commits or releases.

### Use with AI assistants (MCP)

The output is clean, LLM-ready JSON. Call this actor from Claude, ChatGPT, or any agent framework through the **[Apify MCP server](https://docs.apify.com/platform/integrations/mcp)** — ask your assistant to "find the top 20 text-to-image models by downloads, with their license and the org behind each" and let it run this scraper for you.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** — AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** — an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) — no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** — agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### More scrapers from scrapesage

Build a complete **AI, product & competitive-intelligence stack**:

- **[Product Hunt Scraper](https://apify.com/scrapesage/product-hunt-scraper)** — product launches, makers and leads.
- **[Google Ads Transparency Scraper](https://apify.com/scrapesage/google-ads-transparency-scraper)** — who's advertising what on Google.
- **[Facebook Ad Library Scraper](https://apify.com/scrapesage/facebook-ad-library-scraper)** — Meta & Instagram competitor ad intelligence.
- **[LinkedIn Ad Library Scraper](https://apify.com/scrapesage/linkedin-ad-library-scraper)** — B2B competitor ads & creatives.
- **[Multi-ATS Job Scraper](https://apify.com/scrapesage/multi-ats-job-scraper)** — jobs from Greenhouse, Lever, Ashby, Workday & more (source AI/ML talent).
- **[Eventbrite Scraper](https://apify.com/scrapesage/eventbrite-scraper)** — events, ticket prices and organizer leads.
- **[SAM.gov Scraper](https://apify.com/scrapesage/sam-gov-scraper)** — US federal contract opportunities & contacts.

### Tips

- **Default run**: leave all source inputs empty to pull the most-downloaded models — or set `sortBy: "createdAt"` with `monitorMode` for a "what just launched" feed.
- **Multiple types at once**: set `contentTypes: ["models", "datasets", "spaces"]` and each search/browse runs across all three.
- **Cost control**: turn `includeFullMetadata` OFF for a fast, cheap listing-only crawl (still includes downloads, likes, license and tags), then run full metadata only on the repos you keep.
- **Leads**: `includeAuthorProfiles` + `enrichContactEmails` resolves the org/lab behind each model and crawls its site for a contact email.
- **Rate limits**: the Hub limits anonymous traffic per IP; a fresh proxy session is used per request, and you can add a free `hfToken` for extra headroom on big runs.

### FAQ

**Where does the data come from?** The official [Hugging Face Hub API](https://huggingface.co) (`huggingface.co/api/*`) — no API key required. An optional read-only token just raises rate limits.

**Can I scrape models, datasets and Spaces together?** Yes — set `contentTypes` to any combination and each search or browse runs across all of them.

**How do I get the organization behind a model?** Turn on `includeAuthorProfiles` to resolve each repo's author/org to a profile (stats, website, socials), and `enrichContactEmails` to crawl that site for a contact email.

**Can I monitor new model releases?** Yes — turn on `monitorMode` (optionally with a [Schedule](https://docs.apify.com/platform/schedules)) and sort by `createdAt` to emit only repos you haven't seen before.

**Can I export to Google Sheets, CSV, or Excel?** Yes — one click in the dataset view, or automatically on every run via the [Google Drive integration](https://docs.apify.com/platform/integrations/drive).

**Is scraping this legal?** This actor uses Hugging Face's public API and collects publicly available data only. You are responsible for using the data in compliance with applicable laws (GDPR/CCPA for personal data) and Hugging Face's terms.

### Need help?

Open an issue on the actor's **Issues** tab, or visit the [Apify help center](https://help.apify.com/). Feature requests are welcome — this actor is actively maintained.

# Actor input Schema

## `searchQueries` (type: `array`):

Free-text searches run against the Hub for each selected content type (e.g. "llama", "text-to-image", "medical"). Each query is paginated up to the per-query limit.

## `contentTypes` (type: `array`):

Which Hub content the searches, filters and browse apply to.

## `repoUrls` (type: `array`):

Direct model, dataset or Space pages (e.g. https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct, https://huggingface.co/datasets/HuggingFaceFW/fineweb) or bare ids. Each is fetched for the full record.

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

Hugging Face usernames or organizations (e.g. "meta-llama", "stabilityai") to pull a profile with stats, website, socials and a contact lead.

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

Optional mixed list of huggingface.co URLs — models, datasets, Spaces or author/org profiles. Each is auto-classified.

## `browseHub` (type: `boolean`):

Also browse the top of the Hub for each selected content type in the chosen sort order. Automatically enabled when no search, repo or author input is given (so the actor returns the most-downloaded models by default).

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

Sort order for searches and browsing.

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

Filter models by task, e.g. text-generation, text-to-image, automatic-speech-recognition, feature-extraction.

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

Filter models by library, e.g. transformers, diffusers, gguf, sentence-transformers.

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

Filter by language tag, e.g. en, zh, es, code.

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

Filter by license, e.g. apache-2.0, mit, llama3.1.

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

Restrict a search or browse to a single author or organization (e.g. "google", "openai").

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

Only keep repos with at least this many recent downloads. 0 = no filter.

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

Only keep repos with at least this many likes. 0 = no filter.

## `excludeGated` (type: `boolean`):

Skip repos that require accepting terms / requesting access.

## `includeFullMetadata` (type: `boolean`):

Fetch each repo's detail endpoint for the rich record — file count, storage size, model parameters, evaluation results (model-index) and linked Spaces/models. Turn OFF for a fast, cheap listing-only crawl.

## `includeAuthorProfiles` (type: `boolean`):

Resolve each repo's author/organization to a profile (stats, website, socials) and attach a lead. Emits one author record per unique author seen.

## `enrichContactEmails` (type: `boolean`):

Crawl each author/org's linked website (home + /contact + /about) for a contact email. Requires author profiles ON.

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

Global cap on the number of repos scraped across all searches, browses and direct URLs.

## `maxResultsPerQuery` (type: `integer`):

Cap on repos pulled from each individual search query or browse.

## `monitorMode` (type: `boolean`):

Remember repo/author ids returned in previous runs (in a named key-value store) and emit only NEW ones next time. Pair with an Apify Schedule to watch the Hub, a search, or an org for newly released models/datasets/Spaces. The schedule decides WHEN to run; monitor mode decides WHAT is new.

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

Name of the key-value store that holds the monitor's memory. Use different names to track different watches independently. Lowercase letters, digits and hyphens only.

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

Optional Hugging Face access token (https://huggingface.co/settings/tokens) for higher rate limits. Read-only is enough; never required.

## `maxConcurrency` (type: `integer`):

How many requests to run in parallel.

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

Proxy settings. Apify Proxy (default) is recommended — a fresh session is used per request to spread the Hub's per-IP rate limit. The official API has no anti-bot, so the automatic datacenter pool works well.

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

Paste a list of URLs (one per line), OR one link to a .txt/.csv file, Google Sheet or Google Drive file containing them. Lets you import many Start URLs at once instead of typing each. Google Sheet/Drive share links are handled automatically.

## Actor input object example

```json
{
  "searchQueries": [
    "llm",
    "text-to-image"
  ],
  "contentTypes": [
    "models"
  ],
  "repoUrls": [
    "meta-llama/Llama-3.1-8B-Instruct"
  ],
  "authors": [
    "meta-llama"
  ],
  "browseHub": false,
  "sortBy": "downloads",
  "minDownloads": 0,
  "minLikes": 0,
  "excludeGated": false,
  "includeFullMetadata": true,
  "includeAuthorProfiles": false,
  "enrichContactEmails": false,
  "maxResults": 100,
  "maxResultsPerQuery": 60,
  "monitorMode": false,
  "monitorStoreName": "hugging-face-monitor",
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All scraped records in the default dataset.

# 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 = {
    "searchQueries": [
        "llm"
    ],
    "urlsFromFile": ""
};

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

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/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 '{
  "searchQueries": [
    "llm"
  ],
  "urlsFromFile": ""
}' |
apify call scrapesage/hugging-face-scraper --silent --output-dataset

```

## MCP server setup

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