Skip to content

Search Models

Search for models, datasets, and spaces on the HuggingFace Hub using quicksearch.

This example assumes using HuggingFace; is in scope and apiKey contains your HuggingFace API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
using var client = new HuggingFaceClient(apiKey);

var response = await client.RepoSearch.CreateQuicksearchAsync(
    request: new Request57
    {
        Q = "text-generation",
        Limit = 5,
        Exclude = [],
    });

Console.WriteLine($"Found {response.ModelsCount} models, {response.DatasetsCount} datasets");

foreach (var model in response.Models)
{
    Console.WriteLine($"  {model.Id} (weight={model.TrendingWeight:F2})");
}