# Huggingface Models (`david_flagg/huggingface-models`) Actor

Scrape model metadata from HuggingFace Hub — the largest open-source ML model
registry. Get downloads, likes, trending scores, licenses, tags, and\
architecture info for 1M+ models. Filter by task type, ML library, or author.
Uses the official HF API — no auth required.

- **URL**: https://apify.com/david\_flagg/huggingface-models.md
- **Developed by:** [David Flagg](https://apify.com/david_flagg) (community)
- **Categories:** AI, Automation, Developer tools
- **Stats:** 9 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

## HuggingFace Models Scraper

Scrape model metadata from [HuggingFace Hub](https://huggingface.co/models) — the largest open-source ML model registry with 1M+ models.

### What it does

Fetches model data from the HuggingFace API including:

- **Identifiers**: model ID, author/org, model name
- **Popularity**: download count, likes, trending score
- **Metadata**: task type (text-generation, image-classification, etc.), ML library, model architecture, license
- **Timestamps**: creation date, last modified
- **Tags**: filtered model tags (framework, task, format markers)
- **Access**: public/private, gated status

### Use cases

- **Track trending AI models** — monitor what's gaining traction on HuggingFace
- **Compare model popularity** — downloads, likes, and trending scores across models
- **Filter by task** — find all text-generation, text-to-image, speech recognition models, etc.
- **Monitor organizations** — track new releases from Meta, Google, Mistral, Qwen, etc.
- **License auditing** — filter models by license for commercial use
- **Market research** — understand which ML frameworks and architectures are most popular

### Input options

| Parameter | Description | Default |
|-----------|-------------|---------|
| Search Query | Search model names and descriptions | (empty) |
| Author / Organization | Filter by HuggingFace username or org | (empty) |
| Task Type | Filter by ML task (text-generation, image-classification, etc.) | Any |
| ML Library | Filter by framework (transformers, diffusers, gguf, etc.) | (empty) |
| Sort By | Trending, Most Downloads, Most Likes, Recently Updated, or Newest | Trending |
| Max Results | Maximum number of models to return (0 = unlimited) | 100 |

### Example output

```json
{
  "model_id": "meta-llama/Llama-4-Scout-17B-16E-Instruct",
  "author": "meta-llama",
  "model_name": "meta-llama/Llama-4-Scout-17B-16E-Instruct",
  "pipeline_tag": "text-generation",
  "library_name": "transformers",
  "model_type": "llama4",
  "tags": ["safetensors", "llama4", "text-generation", "conversational", "en", "de", "fr", "..."],
  "downloads": 2847291,
  "likes": 1205,
  "trending_score": 482,
  "license": "llama4",
  "created_at": "2026-02-05T18:01:22.000Z",
  "last_modified": "2026-03-10T15:22:47.000Z",
  "private": false,
  "gated": false,
  "url": "https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct",
  "fetched_at": "2026-03-13T12:00:00.000000+00:00"
}
```

### Notes

- Uses the official HuggingFace Hub API (no scraping or authentication required)
- Paginates automatically for large result sets
- All sort orders are descending (most popular / newest first)
- Tags are filtered to remove internal metadata (region, dataset references, arxiv links)

# Actor input Schema

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

Search model names and descriptions (e.g. 'llama', 'diffusion', 'whisper')

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

Filter by HuggingFace username or organization (e.g. 'meta-llama', 'mistralai', 'google')

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

Filter by ML task

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

Filter by framework (e.g. 'transformers', 'diffusers', 'gguf')

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

How to sort results (all sorted descending — most popular/recent first)

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

Maximum number of models to return. Set to 0 for unlimited (use with caution — HuggingFace has 1M+ models).

## Actor input object example

```json
{
  "search": "",
  "author": "",
  "pipelineTag": "",
  "libraryName": "",
  "sortBy": "trending",
  "maxResults": 100
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("david_flagg/huggingface-models").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("david_flagg/huggingface-models").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 '{}' |
apify call david_flagg/huggingface-models --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,david_flagg/huggingface-models"
        }
    }
}

```

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/mwqDXkAC5gLXKAxCV/builds/geb4mnpKbPjUrnDV9/openapi.json
