Hugging Face dataset search
Datasets on the Hugging Face Hub: id, link, author, likes, trending score, downloads in the last month, short description, task categories, modalities, formats, size category, languages, licenses, libraries, Papers with Code id, arXiv ids, gated flag and dates. 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 dataset id. Example: squad |
author | string | Only datasets of this user or organization. |
task | string | Task categories, comma-separated, e.g. question-answering, text-classification. |
language | string | Language codes, comma-separated. |
license | string | License ids, comma-separated. |
modality | string | Modalities, e.g. text, image, audio, tabular. |
format | string | Formats, e.g. parquet, json, csv, imagefolder. |
size | string | Size categories, e.g. 1K<n<10K, 1M<n<10M. |
library | string | Libraries, e.g. datasets, pandas, polars. |
tags | string | Any other Hub tags, comma-separated. |
gated | true | false | true or false. |
sort | trending | downloads | likes | created | modified | Order: trending (default), downloads, likes, created or modified (newest first). |
limit | integer | Results per page (default 20, max 100). |
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/datasets?q=squad" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/huggingface/v1/datasets",
params={"q": "squad"},
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/datasets");
url.searchParams.set("q", "squad");
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).