# 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.

- Page: https://fous.com/methods/huggingface.co/search-datasets
- Method: `huggingface.co/search_datasets`, version 1
- Website: huggingface.co
- Returns: dataset name, author, tasks, rows, size, languages, downloads, likes, last update, license, page link, repository id
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `sort` | string | no |  | Result order, for example most_downloaded. One of "most_downloaded", "most_liked", "trending", "recently_updated". Default "most_downloaded". |
| `query` | string | yes | `"squad"` | Topic or dataset name, for example medical questions. |
| `max_results` | integer | no |  | Maximum number of datasets, for example 20. Default 20. |

## Output

From a run on Oct 23, 2026, shortened. Its input:

```json
{
  "query": "squad"
}
```

Its output:

```json
{
  "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
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
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"}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## 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

## Input schema

```json
{
  "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

```json
{
  "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
}
```

## See more

- [Hugging Face API: Search models](https://fous.com/methods/huggingface.co/search-models.md): Finds public Hugging Face models by search words, with an optional task and sort order. License is null when the model does not publish one.
- [Hugging Face API: Search Hugging Face Spaces](https://fous.com/methods/huggingface.co/search-spaces.md): Finds public Hugging Face Spaces demos for a task, with descriptions, likes, running status and update dates.
- [Hugging Face API: List trending models](https://fous.com/methods/huggingface.co/list-trending-models.md): Lists Hugging Face models in trending order this week, optionally filtered to one task. Downloads cover the last 30 days.
- [Hugging Face API: Get model details](https://fous.com/methods/huggingface.co/get-model.md): Looks 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.
- [Kaggle API: Search datasets](https://fous.com/methods/kaggle.com/search-datasets.md): Finds 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.
- [GitHub API: Search repositories](https://fous.com/methods/github.com/search-repositories.md): Finds public GitHub repositories by keywords, with an optional language filter and sort order. Returns up to 100 matches.
- [crates.io API: Search crates](https://fous.com/methods/crates.io/search-crates.md): Finds Rust crates on crates.io by keywords, sorted by relevance, total downloads, recent downloads, or newest creation.
- [PyPI API: Search packages](https://fous.com/methods/pypi.org/search-packages.md): Searches 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.
- [All Hugging Face methods](https://fous.com/methods/huggingface.co.md)
