# 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Hugging Face API — Model Metadata Export",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "QQVjjY9B0LJMJXP6Z"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tugelbay~huggingface-governance-intelligence/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tugelbay-huggingface-governance-intelligence",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/tugelbay~huggingface-governance-intelligence/runs": {
            "post": {
                "operationId": "runs-sync-tugelbay-huggingface-governance-intelligence",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/tugelbay~huggingface-governance-intelligence/run-sync": {
            "post": {
                "operationId": "run-sync-tugelbay-huggingface-governance-intelligence",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "queries"
                ],
                "properties": {
                    "queries": {
                        "title": "Model search queries",
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "description": "Model names, tasks, authors, or other terms accepted by Hugging Face model search. Maximum 20.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Results per query",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum model records to store for each query.",
                        "default": 25
                    },
                    "canaryMode": {
                        "title": "No-network release canary",
                        "type": "boolean",
                        "description": "Return one release-status record without sending a source request.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
