Question about using nuget API to query a package

sacheu 1 Reputation point Microsoft Employee

I have a nuget package in

When I query it using the query REST API, like:

I only get this:

{"@Георгий Георгиевский ":{"@vocab":"","@BASE ":""},"totalHits":0,"data":[]}

Can you please tell me why i don't see any result in the reponse?

Thank you.

Microsoft Technologies based on the .NET software framework.
3,346 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Dylan Zhu-MSFT 6,406 Reputation points

    Hi sacheu,

    Please have a try this code to search your package:

            ILogger logger = NullLogger.Instance;  
            CancellationToken cancellationToken = CancellationToken.None;  
            SourceRepository repository = Repository.Factory.GetCoreV3("");  
            PackageSearchResource resource = await repository.GetResourceAsync<PackageSearchResource>();  
            SearchFilter searchFilter = new SearchFilter(includePrerelease: true);  
            IEnumerable<IPackageSearchMetadata> results = await resource.SearchAsync(  
                skip: 0,  
                take: 10,  
            foreach (IPackageSearchMetadata result in results)  
                Console.WriteLine($"Found package {result.Identity.Id} {result.Identity.Version}");  

    Best Regards, Dylan

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our * *documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**

    0 comments No comments

  2. sacheu 1 Reputation point Microsoft Employee

    Thanks. But how can I achieve the same using REST API?

  3. sacheu 1 Reputation point Microsoft Employee

    I tried this url but it only gives me versions, not other information, like download statistics.