# Hugging Face API — Model Metadata Export (`tugelbay/huggingface-governance-intelligence`) Actor

Use the Hugging Face API to search public models and export IDs, tasks, licenses, gated status, downloads, likes, SHA, and update dates as JSON or CSV.

- **URL**: https://apify.com/tugelbay/huggingface-governance-intelligence.md
- **Developed by:** [Tugelbay Konabayev](https://apify.com/tugelbay) (community)
- **Categories:** AI, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 hugging face model records

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 API for model metadata.** Search public models and export clean records through the Apify API, schedules, webhooks, or one-click dataset downloads. This Actor uses the official Hub API and never mirrors model files, private repositories, or gated files.

Actor ID `huggingface-governance-intelligence` is a stable legacy identifier. The product scope is public model metadata search and export only, not governance scoring or compliance certification.

![Hugging Face model metadata flowing through an API into structured records](https://konabayev.com/images/apify-actors/hugging-face-model-metadata-api.webp)

### Why use this Actor

- Model ID, title, task, library, and Hugging Face URL
- License tags and public or gated status
- Downloads, likes, repository SHA, and update dates
- One normalized row per matching public model
- JSON, CSV, Excel, XML, RSS, and API access through Apify datasets

Use it for model catalog research, license reviews, public-model inventories, and scheduled metadata snapshots. It is a search-and-export API, not a model inference service or a persistent change-history database.

### Quick start

1. Add one or more public model-search terms.
2. Choose a per-query result limit from 1 to 100.
3. Run the Actor and download the dataset or read it through the Apify API.

```json
{
  "queries": ["text-generation"],
  "maxItems": 5
}
```

The query is sent to the official Hugging Face model search endpoint. Add up to 20 queries and request 1–100 records per query.

### Example output

```json
{
  "recordType": "result",
  "query": "text-generation",
  "sourceId": "daotthuanSE/cv_anytext_text_generation_editing",
  "title": "daotthuanSE/cv_anytext_text_generation_editing",
  "status": "public",
  "url": "https://huggingface.co/daotthuanSE/cv_anytext_text_generation_editing",
  "updatedAt": "2026-07-08T10:44:55.000Z",
  "metrics": {
    "downloads": 0,
    "likes": 0
  },
  "metadata": {
    "pipelineTag": "text-generation",
    "licenses": ["apache-2.0"],
    "gated": false
  },
  "sourceName": "Hugging Face Hub"
}
```

Fields can be absent when the source record does not publish them. The Actor preserves that uncertainty instead of inventing values.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `queries` | string\[] | Yes | Model names, tasks, authors, or other Hugging Face model-search terms. Up to 20. |
| `maxItems` | integer | No | Results stored per query, from 1 to 100. Default: 25. |
| `canaryMode` | boolean | No | Returns one no-network release-status row for deterministic platform QA. |

### Output data contract

Each row uses the stable fields `recordType`, `query`, `sourceId`, `title`, `description`, `status`, `url`, `publishedAt`, `updatedAt`, `metrics`, `metadata`, `sourceName`, `sourceUrl`, `retrievedAt`, and `releaseState`.

The `OUTPUT` record in the default key-value store reports the item count, empty-query count, network use, release state, and any mandatory notice.

### Automate it

- Run scheduled model metadata snapshots with Apify Schedules
- Trigger downstream work with webhooks
- Read the dataset from the Apify API
- Export to JSON, CSV, Excel, or another supported dataset format

For a buyer-focused guide and integration examples, see the [Hugging Face Model Metadata API page](https://konabayev.com/tools/hugging-face-model-metadata-api/?utm_source=apify\&utm_medium=store-readme\&utm_campaign=hugging-face-model-metadata-api).

### Limitations and responsible use

- Source: [official Hugging Face Hub model API](https://huggingface.co/api/models)
- API documentation: [Hugging Face Hub API](https://huggingface.co/docs/hub/api)
- Rate limits: [Hugging Face Hub rate limits](https://huggingface.co/docs/hub/rate-limits)
- Terms: [Hugging Face Terms of Service](https://huggingface.co/terms-of-service)
- Independent product; not affiliated with, endorsed by, or sponsored by Hugging Face
- Public metadata only
- No model weights, binaries, model-card mirroring, or private repositories
- Gated model metadata can be returned, but the Actor cannot access or download gated files
- This is not a Hugging Face scraper for repository files or model artifacts
- HTTPS source hosts are allowlisted; redirects are refused
- Responses, retries, and timeouts are bounded
- Empty searches produce an explicit `emptyResult` row and are not charged

### API comparison

| Option | Best for | Important boundary |
| --- | --- | --- |
| Official Hugging Face API | Direct source integration and custom clients | You own normalization, storage, retries, and downstream exports |
| This Actor | Bounded model searches with normalized Apify datasets and automation | Snapshot export only; it does not store a historical diff database |

### Validation evidence

On 2026-07-23, the bounded source canary returned 100 complete public model metadata records, including 95 declared license tags and 12 models marked gated by the source. On 2026-07-24, actor-specific live QA returned five non-empty records from the deployed build.

### Pricing

The primary pay-per-event charge is `result-item`.

- List price: **$0.002 per successfully stored source record**
- Apify plan tiers: $0.0018, $0.0016, or $0.0014 per record
- Canary, empty-result, and failed rows are not charged
- Maximum valid input: 20 queries × 100 records = 2,000 source records, or **$4.00 maximum list-price PPE charge per run**
- Duplicate query strings are removed before requests; if the same source record matches two different queries, each stored row is charged

Apify platform compute charges and plan credits are shown separately by Apify.

### Support

For a reproducible issue, include the public query, expected behavior, run ID, and the relevant source URL. Never send private model tokens or gated repository credentials.

### FAQ

#### Does this run Hugging Face models?

No. It searches public model metadata. It does not perform inference.

#### Does it download model files?

No. It returns metadata and source URLs only.

#### Can it monitor changes?

You can schedule repeated snapshots and compare datasets downstream. The Actor itself does not maintain a historical diff database.

# Actor input Schema

## `queries` (type: `array`):

Model names, tasks, authors, or other terms accepted by Hugging Face model search. Maximum 20.

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

Maximum model records to store for each query.

## `canaryMode` (type: `boolean`):

Return one release-status record without sending a source request.

## Actor input object example

```json
{
  "queries": [
    "text-generation"
  ],
  "maxItems": 5,
  "canaryMode": false
}
```

# Actor output Schema

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

Dataset containing normalized results and explicit empty or release-gate rows.

## `summary` (type: `string`):

Key-value-store record containing source, release, item, empty-query, and network metrics.

# 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 = {
    "queries": [
        "text-generation"
    ],
    "maxItems": 5,
    "canaryMode": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("tugelbay/huggingface-governance-intelligence").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 = {
    "queries": ["text-generation"],
    "maxItems": 5,
    "canaryMode": False,
}

# Run the Actor and wait for it to finish
run = client.actor("tugelbay/huggingface-governance-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "text-generation"
  ],
  "maxItems": 5,
  "canaryMode": false
}' |
apify call tugelbay/huggingface-governance-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=tugelbay/huggingface-governance-intelligence",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KIy36NH3jAkxDQtON/builds/QQVjjY9B0LJMJXP6Z/openapi.json
