Hugging Face model search
Models on the Hugging Face Hub matching a search and any Hub filter: id, link, author, likes, trending score, downloads in the last month, task (pipeline tag), library, inference status, licenses, languages, base models, training datasets, arXiv ids, tags, gated flag and dates. Filter by parameter count with min_params/max_params. Pass next_cursor back as cursor; null on the last page.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
q | string | Words in the model id, e.g. llama, whisper. Example: llama |
author | string | Only models of this user or organization, e.g. meta-llama. |
task | string | Pipeline tag, e.g. text-generation, text-to-image, automatic-speech-recognition, feature-extraction. Also accepted as pipeline_tag. Example: text-generation |
library | string | Library, e.g. transformers, diffusers, gguf, mlx, sentence-transformers. |
language | string | Language codes, comma-separated, e.g. en,fr. |
license | string | License ids, comma-separated, e.g. apache-2.0, mit. |
dataset | string | Trained on this dataset id, e.g. HuggingFaceFW/fineweb. |
base_model | string | Derived from this model id (fine-tunes, quantizations, adapters). |
min_params | string | Only models with at least this many parameters, e.g. 1B, 500M, 7.5B. |
max_params | string | Only models with at most this many parameters, e.g. 3B, 70B. |
tags | string | Any other Hub tags, comma-separated, e.g. gguf,conversational. |
inference | warm | |
provider | string | Only models served by this inference provider, e.g. together, groq. |
gated | true | false | true or false: only gated or only open models. |
sort | trending | downloads | likes | created | modified | Order: trending (default), downloads, likes, created or modified (newest first). Example: downloads |
limit | integer | Results per page (default 20, max 100). Example: 20 |
cursor | string | next_cursor from the previous page; null on the last page. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/huggingface/v1/models?q=llama" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/huggingface/v1/models",
params={"q": "llama"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/huggingface/v1/models");
url.searchParams.set("q", "llama");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).