Hugging Face API: Search datasets
Finds public Hugging Face datasets by name or topic, ordered by downloads, likes, trending score or last update.
Unofficial. Not affiliated with or endorsed by Hugging Face.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Sort optional
sort Result order, for example most_downloaded.
most_downloaded (default)
One of
most_downloaded,most_liked,trending,recently_updated.- Query, required
query Topic or dataset name, for example medical questions.
squad
- Max Results optional
max_results Maximum number of datasets, for example 20.
20 (default)
Whole number from 1 to 100.
Input as JSON
{ "query": "squad"}Output
{ "datasets": [ { "rows": 98169, "size": "16.3 MB", "likes": 877, "tasks": [ "Question answering" ], "author": "rajpurkar", "license": "cc-by-sa-4.0", "languages": [ "English" ], "page_link": "https://huggingface.co/datasets/rajpurkar/squad" , "dataset_name": "SQuAD", "last_updated": "2024-03-04", "repository_id": "rajpurkar/squad" , "downloads_last_30_days": 183587 }, { "rows": null, "size": "1.9 GB", "likes": 3, "tasks": [ "Question answering" ], "author": "lmqg", "license": "cc-by-4.0", "languages": [ "English" ], "page_link": "https://huggingface.co/datasets/lmqg/qa_squadshifts_synthetic" , "dataset_name": "Synthetic QA dataset on SQuADShifts.", "last_updated": "2023-01-15", "repository_id": "lmqg/qa_squadshifts_synthetic" , "downloads_last_30_days": 64743 }, { "rows": 142192, "size": "17.7 MB", "likes": 272, "tasks": [ "Question answering" ], "author": "rajpurkar", "license": "cc-by-sa-4.0", "languages": [ "English" ], "page_link": "https://huggingface.co/datasets/rajpurkar/squad_v2" , "dataset_name": "SQuAD2.0", "last_updated": "2024-03-04", "repository_id": "rajpurkar/squad_v2" , "downloads_last_30_days": 48171 } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"huggingface.co/search_datasets","input":{"query":"squad"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "huggingface.co/search_datasets" , "input": { "query": "squad" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "huggingface.co/search_datasets" , "input": { "query": "squad" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run huggingface.co/search_datasets# with {"query":"squad"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "query" ], "properties": { "sort": { "enum": [ "most_downloaded", "most_liked", "trending", "recently_updated" ], "type": "string", "default": "most_downloaded", "description": "Result order, for example most_downloaded." }, "query": { "type": "string", "minLength": 1, "description": "Topic or dataset name, for example medical questions." }, "max_results": { "type": "integer", "default": 20, "maximum": 100, "minimum": 1, "description": "Maximum number of datasets, for example 20." } }, "additionalProperties": false}Output schema
{ "type": "object", "required": [ "datasets" ], "properties": { "datasets": { "type": "array", "items": { "type": "object", "required": [ "dataset_name", "author", "tasks", "rows", "size", "languages", "downloads_last_30_days", "likes", "last_updated", "license", "page_link", "repository_id" ], "properties": { "rows": { "type": [ "integer", "null" ], "description": "Number of rows when published." }, "size": { "type": [ "string", "null" ], "description": "Total file size displayed in decimal units, such as 16.3 MB." }, "likes": { "type": [ "integer", "null" ], "description": "Number of likes." }, "tasks": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "Tasks in plain words." }, "author": { "type": [ "string", "null" ], "description": "Dataset author or organization." }, "license": { "type": [ "string", "null" ], "description": "Publisher-provided license." }, "languages": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "Languages in words when provided." }, "page_link": { "type": "string", "format": "uri", "description": "Dataset page link." }, "dataset_name": { "type": "string", "description": "Name displayed by the dataset publisher." }, "last_updated": { "type": [ "string", "null" ], "format": "date", "description": "Last update date." }, "repository_id": { "type": "string", "description": "Author and repository name." }, "downloads_last_30_days": { "type": [ "integer", "null" ], "description": "Downloads during the last month." } }, "additionalProperties": false } } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
huggingface.co/search_datasets- Returns
- dataset name, author, tasks, rows, size, languages, downloads, likes, last update, license, page link, repository id
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method huggingface.co/search_datasets with the inputs above.
Ask your agent
- Find the top 15 most downloaded datasets about sentiment analysis in English
- Which datasets on the Hub are trending right now for speech recognition?
- Show me recently updated datasets related to medical question answering, limit 30
- I need the most liked datasets for image captioning with their licenses and sizes
- List 10 datasets matching legal contract summarization sorted by last update
See more
All Hugging Face methodsFinds public Hugging Face models by search words, with an optional task and sort order. License is null when the model does not publish one.
huggingface.co/search_modelsFinds public Hugging Face Spaces demos for a task, with descriptions, likes, running status and update dates.
huggingface.co/search_spacesLists Hugging Face models in trending order this week, optionally filtered to one task. Downloads cover the last 30 days.
huggingface.co/list_trending_modelsLooks up one Hugging Face model by name, repository ID or link and returns its public details, model card summary and file sizes. For a name, the first matching model is returned.
huggingface.co/get_modelFinds public Kaggle datasets on a topic, with size, file formats, usability, popularity and license. Lists at most 100 results in Kaggle's order; files are not downloaded.
kaggle.com/search_datasetsFinds public GitHub repositories by keywords, with an optional language filter and sort order. Returns up to 100 matches.
github.com/search_repositoriesFinds Rust crates on crates.io by keywords, sorted by relevance, total downloads, recent downloads, or newest creation.
crates.io/search_cratesSearches PyPI by keywords and returns matching packages in relevance order, each with its latest version and that version's release date. Returns up to 100 results.
pypi.org/search_packages