# Hugging Face API: Search models

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

Unofficial. Not affiliated with or endorsed by Hugging Face.

- Page: https://fous.com/methods/huggingface.co/search-models
- Method: `huggingface.co/search_models`, version 1
- Website: huggingface.co
- Returns: model name, author, task, downloads last 30 days, likes, last updated date, license, model 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 |  | Order of results; for example "trending". Defaults to most_downloaded. One of "most_downloaded", "most_liked", "trending", "recently_updated". Default "most_downloaded". |
| `task` | string | no |  | Task in plain words, such as "text generation", "image classification", or "sentiment analysis". Defaults to all tasks. Default "all tasks". |
| `query` | string | yes | `"llama"` | Search words for model names, such as "whisper" or "sentiment analysis". |
| `max_results` | integer | no | `100` | Maximum models to return, for example 20; at most 100. Default 20. |

## Output

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

```json
{
  "query": "llama",
  "max_results": 100
}
```

Its output:

```json
{
  "models": [
    {
      "task": "Text Generation",
      "likes": 8563,
      "author": "meta-llama",
      "license": "llama3.1",
      "model_name": "Llama-3.1-8B-Instruct",
      "repository_id": "meta-llama/Llama-3.1-8B-Instruct",
      "model_page_link": "https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct",
      "last_updated_date": "2024-09-25",
      "downloads_last_30_days": 4864172
    },
    {
      "task": "Text Generation",
      "likes": 1883,
      "author": "meta-llama",
      "license": "llama3.2",
      "model_name": "Llama-3.2-1B-Instruct",
      "repository_id": "meta-llama/Llama-3.2-1B-Instruct",
      "model_page_link": "https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct",
      "last_updated_date": "2024-10-24",
      "downloads_last_30_days": 3970913
    },
    {
      "task": "Text Classification",
      "likes": 428,
      "author": "meta-llama",
      "license": "llama3.1",
      "model_name": "Prompt-Guard-86M",
      "repository_id": "meta-llama/Prompt-Guard-86M",
      "model_page_link": "https://huggingface.co/meta-llama/Prompt-Guard-86M",
      "last_updated_date": "2025-11-12",
      "downloads_last_30_days": 2376548
    }
  ]
}
```

## 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_models","input":{"query":"llama","max_results":100}}'
```

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 most downloaded speech recognition models on Hugging Face, top 10 please
- Which open models for image classification are trending right now?
- I need text generation models with an Apache license, sorted by likes
- Show me recently updated sentiment analysis models on huggingface.co
- List 50 models matching whisper, ordered by most liked

## Input schema

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "sort": {
      "enum": [
        "most_downloaded",
        "most_liked",
        "trending",
        "recently_updated"
      ],
      "type": "string",
      "default": "most_downloaded",
      "examples": [
        "trending"
      ],
      "description": "Order of results; for example \"trending\". Defaults to most_downloaded."
    },
    "task": {
      "type": "string",
      "default": "all tasks",
      "examples": [
        "text generation"
      ],
      "description": "Task in plain words, such as \"text generation\", \"image classification\", or \"sentiment analysis\". Defaults to all tasks."
    },
    "query": {
      "type": "string",
      "examples": [
        "whisper"
      ],
      "minLength": 1,
      "description": "Search words for model names, such as \"whisper\" or \"sentiment analysis\"."
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "examples": [
        20
      ],
      "description": "Maximum models to return, for example 20; at most 100.",
      "x-fous-developer": true
    }
  },
  "additionalProperties": false
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "models"
  ],
  "properties": {
    "models": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "model_name",
          "author",
          "task",
          "downloads_last_30_days",
          "likes",
          "last_updated_date",
          "license",
          "model_page_link",
          "repository_id"
        ],
        "properties": {
          "task": {
            "type": [
              "string",
              "null"
            ],
            "description": "Model task in words."
          },
          "likes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total likes."
          },
          "author": {
            "type": [
              "string",
              "null"
            ],
            "description": "Publisher or organization."
          },
          "license": {
            "type": [
              "string",
              "null"
            ],
            "description": "License as stated by the model publisher."
          },
          "model_name": {
            "type": "string",
            "description": "Model repository name."
          },
          "repository_id": {
            "type": "string",
            "description": "Repository ID (author/name).",
            "x-fous-developer": true
          },
          "model_page_link": {
            "type": "string",
            "format": "uri",
            "description": "Hugging Face model page."
          },
          "last_updated_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Most recent update date."
          },
          "downloads_last_30_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Downloads over the last 30 days."
          }
        },
        "additionalProperties": false
      },
      "description": "Matching models in the requested order."
    }
  },
  "additionalProperties": false
}
```

## See more

- [Hugging Face API: Search datasets](https://fous.com/methods/huggingface.co/search-datasets.md): Finds public Hugging Face datasets by name or topic, ordered by downloads, likes, trending score or last update.
- [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: 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: 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.
- [OpenRouter API: List models](https://fous.com/methods/openrouter.ai/list-models.md): Lists public OpenRouter models with per-million-token prices, context size, input types, release date and model page. Results can be sorted by newest, input price or popularity.
- [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.
- [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.
- [Bluesky API: Search posts](https://fous.com/methods/bsky.app/search-posts.md): Searches public Bluesky posts for words, optionally ordered by latest or top and filtered by date, author or language. Search indexing may lag behind new posts.
- [All Hugging Face methods](https://fous.com/methods/huggingface.co.md)
