# Hugging Face Hub Models API

> Search Hugging Face models and datasets: downloads, likes, tags, task, library, author

- Vendor: `huggingfacehubmodelsapi` · version 1.0 · category Machine Learning · tags hugging face api, ai models api, ml models api, datasets api, llm models api, model hub api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/huggingfacehubmodelsapi
- This document: https://apiclay.com/docs/huggingfacehubmodelsapi.md
- OpenAPI 3.1: https://apiclay.com/api/huggingfacehubmodelsapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `huggingfacehubmodelsapi`
- Updated: 2026-11-18

## About

## Hugging Face Hub Models API

Search the Hugging Face Hub for AI models and datasets by name, author or task, sorted by downloads, likes or trend, and get a model's full card metadata: pipeline task, library, tags, downloads, likes, files and last update.

Data comes from **huggingface.co** (https://huggingface.co). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/models?search=llama&amp;sort=downloads&amp;limit=10`, then `/model?owner=meta-llama&amp;name=Llama-3.1-8B`.

### Routes

#### GET `/models` - Search models
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| search | query | string | no | Words in the model id. |
| author | query | string | no | Owner, e.g. `meta-llama`. |
| filter | query | string | no | Tag or task, e.g. `text-classification`. |
| sort | query | string | no | `downloads`, `likes`, `trendingScore`, `lastModified`. |
| limit | query | number | no | Max results. |

Returns: array of models with `id`, `downloads`, `likes`, `pipeline_tag`, `library_name`, `tags`, `createdAt`.

#### GET `/model` - Model details
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| owner | path | string | yes | e.g. `google-bert`. |
| name | path | string | yes | e.g. `bert-base-uncased`. |

Returns: `id`, `pipeline_tag`, `library_name`, `tags`, `downloads`, `likes`, `siblings` (files), `cardData`.

#### GET `/datasets` - Search datasets
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| search | query | string | no | Words in the dataset id. |
| author | query | string | no | Owner. |
| sort | query | string | no | Sort. |
| limit | query | number | no | Max results. |

Returns: array of datasets with `id`, `downloads`, `likes`, `tags`.

### Caveats

- Gated or private repos are not visible.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by huggingface.co.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /models — Search models
- Gateway: `GET https://api.apiclay.com/v1/api/huggingfacehubmodelsapi/models`
- Public query params: `search` (string), `author` (string), `filter` (string), `sort` (string), `limit` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /model — Model details
- Gateway: `GET https://api.apiclay.com/v1/api/huggingfacehubmodelsapi/model`
- Public query params: `owner` (string, required), `name` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /datasets — Search datasets
- Gateway: `GET https://api.apiclay.com/v1/api/huggingfacehubmodelsapi/datasets`
- Public query params: `search` (string), `author` (string), `sort` (string), `limit` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/huggingfacehubmodelsapi/models" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
