Package Search Results - Fetch Package Search Results

Provides a set of results for the search text.

POST https://almsearch.dev.azure.com/{organization}/_apis/search/packagesearchresults?api-version=7.1

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

api-version
query True

string

Version of the API to use. This should be set to '7.1' to use this version of the api.

Request Body

Name Type Description
$orderBy

SortOption[]

Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy.

$skip

integer

Number of results to be skipped.

$top

integer

Number of results to be returned.

filters

object

Filters to be applied. Set it to null if there are no filters to be applied.

includeFacets

boolean

Flag to opt for faceting in the result. Default behavior is false.

searchText

string

The search text.

Responses

Name Type Description
200 OK

PackageSearchResponseContent

successful operation

Headers

ActivityId: string

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.packaging Grants the ability to read feeds and packages. Also grants the ability to search packages.

Examples

Sample request

POST https://almsearch.dev.azure.com/{organization}/_apis/search/packagesearchresults?api-version=7.1

{
  "$skip": 0,
  "$top": 50,
  "$orderBy": null,
  "includeFacets": true,
  "searchText": "microsoft applicationinsight package",
  "filters": {
    "Feeds": [
      "ApplicationInsights-Team"
    ],
    "View": [
      "local"
    ],
    "ProtocolType": [
      "Nuget",
      "Npm"
    ]
  }
}

Sample response

{
  "count": 3,
  "results": [
    {
      "name": "@microsoft/applicationinsights-mezzurite",
      "id": "0adc5b40-8b48-4a42-ac5e-93da78206d27",
      "description": "Logging Extention for Mezzurtie Timing Package",
      "protocolType": "Npm",
      "feeds": [
        {
          "collectionId": "0efb4611-d565-4cd1-9a64-7d6cb6d7d5f0",
          "collectionName": "mseng",
          "feedId": "cd3f7228-b239-4ef5-8d3b-ee9c3bc79bc2",
          "feedName": "ApplicationInsights-Team",
          "packageUrl": "https://dev.azure.com/mseng/_packaging?feed=ApplicationInsights-Team&_a=package&package=@microsoft/applicationinsights-mezzurite&version=1.0.0&protocolType=Npm",
          "latestVersion": "1.0.0",
          "latestMatchedVersion": "1.0.0",
          "views": [
            "local"
          ]
        }
      ],
      "hits": [
        {
          "fieldReferenceName": "name",
          "highlights": [
            "@<highlighthit>microsoft</highlighthit>/<highlighthit>applicationinsights</highlighthit>-mezzurite"
          ]
        },
        {
          "fieldReferenceName": "description",
          "highlights": [
            "Logging Extention for Mezzurtie Timing <highlighthit>Package</highlighthit>"
          ]
        }
      ]
    },
    {
      "name": "Microsoft.ApplicationInsights.Masi.Tracing",
      "id": "5b709505-a14f-4d2c-b172-21f1e6fc0562",
      "description": "The MASI tracing package allowing you to send log messages with activity context to Application Insights and to Windows Azure Diagnostics easily",
      "protocolType": "NuGet",
      "feeds": [
        {
          "collectionId": "0efb4611-d565-4cd1-9a64-7d6cb6d7d5f0",
          "collectionName": "mseng",
          "feedId": "cd3f7228-b239-4ef5-8d3b-ee9c3bc79bc2",
          "feedName": "ApplicationInsights-Team",
          "packageUrl": "https://dev.azure.com/mseng/_packaging?feed=ApplicationInsights-Team&_a=package&package=Microsoft.ApplicationInsights.Masi.Tracing&version=1.0.13.2-build00132-2&protocolType=NuGet",
          "latestVersion": "1.0.13.2-build00132-2",
          "latestMatchedVersion": "1.0.13.2-build00132-2",
          "views": [
            "local"
          ]
        }
      ],
      "hits": [
        {
          "fieldReferenceName": "name",
          "highlights": [
            "<highlighthit>Microsoft</highlighthit>.<highlighthit>ApplicationInsights</highlighthit>.Masi.Tracing"
          ]
        },
        {
          "fieldReferenceName": "description",
          "highlights": [
            "The MASI tracing <highlighthit>package</highlighthit> allowing you to send log messages with activity context to Application"
          ]
        }
      ]
    },
    {
      "name": "Microsoft.ApplicationInsights.Agent.StartupTask",
      "id": "60c357c1-69bf-4c9b-8fe0-a8ad7e50a5f9",
      "description": "Application Insights Agent startup task. This package adds a startup task for installing Application Insights Agent to enable additional Application Insights Telemetry.",
      "protocolType": "NuGet",
      "feeds": [
        {
          "collectionId": "0efb4611-d565-4cd1-9a64-7d6cb6d7d5f0",
          "collectionName": "mseng",
          "feedId": "cd3f7228-b239-4ef5-8d3b-ee9c3bc79bc2",
          "feedName": "ApplicationInsights-Team",
          "packageUrl": "https://dev.azure.com/mseng/_packaging?feed=ApplicationInsights-Team&_a=package&package=Microsoft.ApplicationInsights.Agent.StartupTask&version=1.0.5&protocolType=NuGet",
          "latestVersion": "1.0.5",
          "latestMatchedVersion": "1.0.5",
          "views": [
            "local"
          ]
        }
      ],
      "hits": [
        {
          "fieldReferenceName": "name",
          "highlights": [
            "<highlighthit>Microsoft</highlighthit>.<highlighthit>ApplicationInsights</highlighthit>.Agent.StartupTask"
          ]
        },
        {
          "fieldReferenceName": "description",
          "highlights": [
            "This <highlighthit>package</highlighthit> adds a startup task for installing Application Insights Agent to enable additional"
          ]
        }
      ]
    }
  ],
  "infoCode": 0,
  "facets": {
    "ProtocolType": [
      {
        "name": "Npm",
        "id": "Npm",
        "resultCount": 1
      },
      {
        "name": "NuGet",
        "id": "NuGet",
        "resultCount": 2
      }
    ],
    "Feeds": [
      {
        "name": "ApexPreRelease",
        "id": "ApexPreRelease",
        "resultCount": 4
      },
      {
        "name": "ApplicationInsights-dotnet-develop",
        "id": "ApplicationInsights-dotnet-develop",
        "resultCount": 3
      },
      {
        "name": "ApplicationInsights-Team",
        "id": "ApplicationInsights-Team",
        "resultCount": 3
      },
      {
        "name": "ArtifactTool",
        "id": "ArtifactTool",
        "resultCount": 1
      },
      {
        "name": "Axon.Dependencies",
        "id": "Axon.Dependencies",
        "resultCount": 4
      },
      {
        "name": "CloudBuild",
        "id": "CloudBuild",
        "resultCount": 1
      },
      {
        "name": "CloudBuildTest",
        "id": "CloudBuildTest",
        "resultCount": 1
      },
      {
        "name": "CodeFlow",
        "id": "CodeFlow",
        "resultCount": 3
      },
      {
        "name": "Codex-Deps",
        "id": "Codex-Deps",
        "resultCount": 4
      },
      {
        "name": "Kusto-Internal",
        "id": "Kusto-Internal",
        "resultCount": 4
      },
      {
        "name": "MSCredProvider",
        "id": "MSCredProvider",
        "resultCount": 2
      },
      {
        "name": "VS",
        "id": "VS",
        "resultCount": 7
      },
      {
        "name": "VsoMicrosoftExternals",
        "id": "VsoMicrosoftExternals",
        "resultCount": 3
      }
    ],
    "View": [
      {
        "name": "Local",
        "id": "Local",
        "resultCount": 3
      }
    ]
  }
}

Definitions

Name Description
FeedInfo

Defines the details of a feed.

PackageHit

Defines the matched terms in the field of the package result.

PackageResult

Defines the package result that matched a package search request.

PackageSearchRequest

Defines a package search request.

PackageSearchResponseContent

Defines a response item that is returned for a package search request.

SortOption

Defines how to sort the result.

FeedInfo

Defines the details of a feed.

Name Type Description
collectionId

string

Id of the collection.

collectionName

string

Name of the collection.

feedId

string

Id of the feed.

feedName

string

Name of the feed.

latestMatchedVersion

string

Latest matched version of package in this Feed.

latestVersion

string

Latest version of package in this Feed.

packageUrl

string

Url of package in this Feed.

views

string[]

List of views which contain the matched package.

PackageHit

Defines the matched terms in the field of the package result.

Name Type Description
fieldReferenceName

string

Reference name of the highlighted field.

highlights

string[]

Matched/highlighted snippets of the field.

PackageResult

Defines the package result that matched a package search request.

Name Type Description
description

string

Description of the package.

feeds

FeedInfo[]

List of feeds which contain the matching package.

hits

PackageHit[]

List of highlighted fields for the match.

id

string

Id of the package.

name

string

Name of the package.

protocolType

string

Type of the package.

PackageSearchRequest

Defines a package search request.

Name Type Description
$orderBy

SortOption[]

Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy.

$skip

integer

Number of results to be skipped.

$top

integer

Number of results to be returned.

filters

object

Filters to be applied. Set it to null if there are no filters to be applied.

includeFacets

boolean

Flag to opt for faceting in the result. Default behavior is false.

searchText

string

The search text.

PackageSearchResponseContent

Defines a response item that is returned for a package search request.

Name Type Description
count

integer

Total number of matched packages.

facets

object

A dictionary storing an array of Filter object against each facet.

infoCode

integer

Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose.

results

PackageResult[]

List of matched packages.

SortOption

Defines how to sort the result.

Name Type Description
field

string

Field name on which sorting should be done.

sortOrder

string

Order (ASC/DESC) in which the results should be sorted.