Skip to content

Search Papers

Search for papers and collections on the HuggingFace Hub.

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
17
18
19
20
21
using var client = new HuggingFaceClient(apiKey);

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

Console.WriteLine($"Papers: {response.PapersCount}, Collections: {response.CollectionsCount}");

foreach (var paper in response.Papers)
{
    Console.WriteLine($"  Paper: {paper.Id}");
}

foreach (var collection in response.Collections)
{
    Console.WriteLine($"  Collection: {collection.Title} - {collection.Description}");
}