# Hugging Face Scraper (`zucchini_gopher_m2v/huggingface-scraper`) Actor

Search and extract Hugging Face model, dataset, and Space listings, full repo details (files, config, card metadata), and user/organization profiles -- no account or API key needed.

- **URL**: https://apify.com/zucchini\_gopher\_m2v/huggingface-scraper.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/zucchini_gopher_m2v) (community)
- **Categories:** AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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?

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

Search and extract Hugging Face model, dataset, and Space listings, full repo details (files, config, card metadata), and user/organization profiles — no account or API key needed.

### Why use this actor

- One actor covers all of Hugging Face's public surface: search models/datasets/Spaces, pull full download-ready details for a specific repo, and look up user or organization profiles
- Full repo detail includes the complete file manifest (`siblings`), parsed model/dataset card metadata, config, and (for Spaces) the live demo URL
- No account, login, or API key required — this actor talks to Hugging Face's own official public REST API
- Automatic retries on temporary network hiccups, including respecting the platform's own rate-limit headers
- Robust pagination — automatically follows the platform's `Link`-header pagination up to the limit you set
- Honest about limits: a nonexistent repo returns a clear `_error` record (even though the platform itself replies with a slightly confusing HTTP 401 instead of 404 — this actor normalizes that), and user vs. organization lookups are resolved automatically

### How it works

Pick a `mode`:

1. **`models`** / **`datasets`** / **`spaces`** — search/browse with filters for query text, author, tags, task (models), library (models), sort order.
2. **`model-detail`** / **`dataset-detail`** / **`space-detail`** — fetch full detail (every file, card metadata, config) for one or more specific repo IDs.
3. **`creator`** — look up a user or organization profile (auto-detects which type).

### Input

**Search models:**

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

**Model detail (by ID):**

```json
{
  "mode": "model-detail",
  "modelIds": ["google-bert/bert-base-uncased", "meta-llama/Llama-3.1-8B-Instruct"]
}
```

**Datasets / Spaces:**

```json
{ "mode": "datasets", "search": "squad", "maxItems": 20 }
```

```json
{ "mode": "spaces", "author": "huggingface", "sort": "likes", "maxItems": 20 }
```

**Creator profile:**

```json
{ "mode": "creator", "username": "openai" }
```

| Field | Type | Description |
|---|---|---|
| `mode` | string | `"models"` (default), `"model-detail"`, `"datasets"`, `"dataset-detail"`, `"spaces"`, `"space-detail"`, or `"creator"`. |
| `search` | string | `models`/`datasets`/`spaces` mode — free-text search term. |
| `author` | string | `models`/`datasets`/`spaces` mode — exact username/organization filter. |
| `filter` | array | `models`/`datasets`/`spaces` mode — tag filters, e.g. `["license:mit", "pytorch"]`. |
| `pipelineTag` | string | `models` mode — task filter, e.g. `"text-generation"`. |
| `library` | string | `models` mode — e.g. `"transformers"`, `"diffusers"`. |
| `sort` | string | `downloads`, `likes`, `createdAt`, `lastModified`, or `trendingScore`. |
| `direction` | string | `"-1"` (descending, default) or `"1"` (ascending — only supported for `createdAt`, see Known limits). |
| `modelId` / `modelIds` | string / array | `model-detail` mode — repo ID(s) in `namespace/name` form. |
| `datasetId` / `datasetIds` | string / array | `dataset-detail` mode. |
| `spaceId` / `spaceIds` | string / array | `space-detail` mode. |
| `username` / `usernames` | string / array | `creator` mode. |
| `accountType` | string | `creator` mode — `"auto"` (default), `"user"`, or `"organization"`. |
| `maxItems` | integer | Max results for list modes. Default 100, max 10,000. |
| `maxConcurrency` | integer | Detail/creator modes — how many IDs to fetch in parallel. Default 4. |
| `proxyConfiguration` | object | Apify Proxy settings. Residential is on by default (not required — Hugging Face's own official public API — kept for production robustness). |

### Output

**Models / model-detail mode** — one record per model (truncated for readability):

```json
{
  "_input": "google-bert/bert-base-uncased",
  "_source": "S1-api",
  "_scrapedAt": "2026-08-25T19:50:00Z",
  "id": "google-bert/bert-base-uncased",
  "author": "google-bert",
  "pipeline_tag": "fill-mask",
  "library_name": "transformers",
  "downloads": 93831528,
  "likes": 2740,
  "tags": ["transformers", "pytorch", "bert", "fill-mask", "license:apache-2.0"],
  "cardData": { "language": "en", "license": "apache-2.0" },
  "siblings": [{ "rfilename": "config.json" }, { "rfilename": "pytorch_model.bin" }]
}
```

**Datasets / Spaces mode** — analogous shape, upstream fields passed through as-is.

**Creator mode:**

```json
{
  "_input": "openai",
  "_source": "S1-api-organization",
  "_scrapedAt": "2026-08-25T19:50:00Z",
  "fullname": "OpenAI",
  "name": "openai",
  "isVerified": true,
  "numModels": 39,
  "numDatasets": 16,
  "numSpaces": 6,
  "numFollowers": 40018
}
```

A record with `_error` instead of the fields above means that item could not be processed (for example, `"_error": "model_not_found"` for a repo ID that doesn't exist).

### Known limits

- **Ascending sort only works for `createdAt`.** Requesting `direction: "1"` with any other `sort` value returns a structured `_error: "invalid_request"` record — this is a genuine Hugging Face platform restriction (confirmed live across all 5 sort fields), not a bug in this actor.
- **List-mode results don't include the full file list.** Only `model-detail`/`dataset-detail`/`space-detail` mode returns the complete `siblings` file manifest for a repo.
- **Gated/private repos** return their public metadata only (this actor never logs in, by design) — download-restricted file contents are out of scope.

# Actor input Schema

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

"models"/"datasets"/"spaces" search/list with filters. "model-detail"/"dataset-detail"/"space-detail" fetch full detail for specific repo ID(s). "creator" fetches a user or organization profile.

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

"models"/"datasets"/"spaces" mode only -- free-text search term.

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

"models"/"datasets"/"spaces" mode only -- only return repos published by this exact username or organization.

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

"models"/"datasets"/"spaces" mode only -- only return repos matching ALL of these tags (e.g. "license:mit", "dataset:squad", "pytorch").

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

"models" mode only -- filter by task, e.g. "text-generation", "text-classification", "image-classification".

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

"models" mode only -- filter by library, e.g. "transformers", "sentence-transformers", "diffusers".

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

"models"/"datasets"/"spaces" mode only -- field to sort results by.

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

"models"/"datasets"/"spaces" mode only -- descending (highest first) or ascending. Note: the platform only supports ascending order for "createdAt" -- other sort fields (downloads/likes/lastModified/trendingScore) are descending-only and will return a clear \_error record if you request ascending.

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

"model-detail" mode -- a single model ID in "namespace/name" form.

## `modelIds` (type: `array`):

"model-detail" mode only -- multiple model IDs to fetch full detail for in one run.

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

"dataset-detail" mode -- a single dataset ID in "namespace/name" form (or a bare name for legacy canonical datasets).

## `datasetIds` (type: `array`):

"dataset-detail" mode only -- multiple dataset IDs to fetch full detail for in one run.

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

"space-detail" mode -- a single Space ID in "namespace/name" form.

## `spaceIds` (type: `array`):

"space-detail" mode only -- multiple Space IDs to fetch full detail for in one run.

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

"creator" mode -- a single user or organization name.

## `usernames` (type: `array`):

"creator" mode only -- multiple user/organization names to fetch in one run.

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

"creator" mode only -- users and organizations are different endpoints on Hugging Face. "auto" tries user first, then falls back to organization.

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

"models"/"datasets"/"spaces" mode only -- maximum number of results to return. Pagination is followed automatically (via the platform's Link header) until this cap or the end of the result set.

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

"model-detail"/"dataset-detail"/"space-detail"/"creator" mode only -- how many IDs to fetch in parallel.

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

Apify Proxy configuration. Residential is on by default. Not required for this endpoint (no WAF was found -- it is Hugging Face's own official public API), but kept on for production robustness.

## Actor input object example

```json
{
  "mode": "models",
  "sort": "downloads",
  "direction": "-1",
  "modelId": "google-bert/bert-base-uncased",
  "datasetId": "rajpurkar/squad",
  "spaceId": "enzostvs/deepsite",
  "accountType": "auto",
  "maxItems": 100,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped model / dataset / space / creator records produced by this run.

# 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 = {
    "mode": "models",
    "sort": "downloads",
    "direction": "-1",
    "modelId": "google-bert/bert-base-uncased",
    "datasetId": "rajpurkar/squad",
    "spaceId": "enzostvs/deepsite",
    "accountType": "auto",
    "maxItems": 100,
    "maxConcurrency": 4,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zucchini_gopher_m2v/huggingface-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 = {
    "mode": "models",
    "sort": "downloads",
    "direction": "-1",
    "modelId": "google-bert/bert-base-uncased",
    "datasetId": "rajpurkar/squad",
    "spaceId": "enzostvs/deepsite",
    "accountType": "auto",
    "maxItems": 100,
    "maxConcurrency": 4,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("zucchini_gopher_m2v/huggingface-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 '{
  "mode": "models",
  "sort": "downloads",
  "direction": "-1",
  "modelId": "google-bert/bert-base-uncased",
  "datasetId": "rajpurkar/squad",
  "spaceId": "enzostvs/deepsite",
  "accountType": "auto",
  "maxItems": 100,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call zucchini_gopher_m2v/huggingface-scraper --silent --output-dataset

```

## MCP server setup

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