默认见解标记

警告

2020 年 10 月 30 日,必应搜索 API 从 Azure AI 服务迁移到必应搜索服务。 本文档仅供参考。 有关更新的文档,请参阅必应搜索 API 文档。 关于为必应搜索创建新的 Azure 资源的说明,请参阅通过 Azure 市场创建必应搜索资源

默认见解标记是将 displayName 字段设置为空字符串的标记。 以下示例显示了可能的默认见解(操作)列表。 响应包含的操作列表由图像而定。 对于每个操作,属性列表可能因图像而异,因此在尝试使用该属性之前请检查其是否存在。

{
  "_type" : "ImageKnowledge",
  "tags" : [
    {
      "displayName" : "",
      "actions" : [
        {
          "_type" : "ImageModuleAction",
          "actionType" : "PagesIncluding",
          "data" : {
            "value" : [...]
          }
        },
        {
          "_type" : "ImageShoppingSourcesAction",
          "actionType" : "ShoppingSources",
          "data" : {
            "offers" : [...]
          }
        },
        {
          "image" : {...},
          "actionType" : "MoreSizes"
        },
        {
          "_type" : "ImageModuleAction",
          "actionType" : "VisualSearch",
          "data" : {
            "value" : [...]
          }
        },
        {
          "_type" : "ImageRecipesAction",
          "actionType" : "Recipes",
          "data" : {
            "value" : [...]
          }
        },
        {
          "image" : {...},
          "actionType" : "ImageById"
        },
        {
          "_type" : "ImageModuleAction",
          "actionType" : "ProductVisualSearch",
          "data" : {
            "value" : [...]
          }
        },
        {
          "_type" : "ImageRelatedSearchesAction",
          "actionType" : "RelatedSearches",
          "data" : {
            "value" : [...]
          }
        },
        {
          "_type" : "ImageRelatedSearchesAction",
          "actionType" : "DocumentLevelSuggestions",
          "data" : {
            "value" : [...]
          }
        }
      ]
    },
    {...},
    {...},
    {...},
    {...}
  ],
  "image" : {
    "imageInsightsToken" : "bcid_AF8C9CA409421B..."
  }
}

PagesIncluding 见解

PagesIncluding 见解提供了包含此图像的网页列表。 它实际上是一个 Image 对象列表,hostPageUrl 字段包含包括图像的网页的 URL。 有关示例用法,请参阅 PagesIncluding 见解示例

{
  "_type" : "ImageModuleAction",
  "actionType" : "PagesIncluding",
  "data" : {
    "value" : [
      {
        "webSearchUrl" : "https://www.bing.com\/images\/search?",
        "name" : "Today's smoking hot country",
        "thumbnailUrl" : "https:\/\/tse2.mm.bing.net\/th?id=OIP...",
        "datePublished" : "2017-09-20T12:00:00.0000000Z",
        "contentUrl" : "http:\/\/contoso.com\/wordstuff",
        "hostPageUrl" : "http:\/\/contoso.com\/2017\/09\/20\/car",
        "contentSize" : "122540 B",
        "encodingFormat" : "jpeg",
        "hostPageDisplayUrl" : "contoso.com\/2017\/09\/20\/car",
        "width" : 894,
        "height" : 1200,
        "thumbnail" : {
          "width" : 474,
          "height" : 636
        },
        "imageInsightsToken" : "ccid_CO5GEthj*mid_5323B1",
        "insightsMetadata" : {
          "pagesIncludingCount" : 12,
          "availableSizesCount" : 7
        },
        "imageId" : "5323B1900FB9087B6B45D176D234E1F2F23CD3A5",
        "accentColor" : "55585B"
      }
    ]
  }
}

ShoppingSources 见解

ShoppingSources 见解提供了一个网站列表,用户可以在这些网站中购买图像中显示的商品。 产品/服务列表包括用户可以在其中购买商品的网页的 URL、商品的价格以及评级或评论详细信息。 有关示例用法,请参阅 ShoppingSources 示例

{
  "_type" : "ImageShoppingSourcesAction",
  "actionType" : "ShoppingSources",
  "data" : {
    "offers" : [
      {
        "name" : "Apple Pie",
        "url" : "https:\/\/contoso.com\/product_p\/l10.htm",
        "description" : "A taste of the crust, apple, and pie filling...",
        "seller" : {
          "name" : "Contoso"
        },
        "price" : 3.99,
        "priceCurrency" : "USD",
        "aggregateRating" : {
          "ratingValue" : 5
        },
        "lastUpdated" : "2018-04-16T00:00:00.0000000"
      }
    ]
  }
}

MoreSizes 见解

MoreSizes 见解标识必应在 Internet 上找到的图像的大小(更大或较小)的数目(请参阅 availableSizesCount 字段):

{
  "image" : {
    "webSearchUrl" : "https:\/\/www.bing.com\/images\/search?view=detai...",
    "name" : "Making Apple Pie",
    "thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?id=OIP....",
    "datePublished" : "2013-06-21T12:00:00.0000000Z",
    "contentUrl" : "http:\/\/contoso.com\/content\/uploads\/2013\/06\/apple-pie.jpg",
    "hostPageUrl" : "http:\/\/contoso.com\/2013\/06\/21\/making-apple-pie\/",
    "contentSize" : "134847 B",
    "encodingFormat" : "jpeg",
    "hostPageDisplayUrl" : "contoso.com\/2013\/06\/21\/making-apple-pie",
    "width" : 1050,
    "height" : 765,
    "thumbnail" : {
      "width" : 474,
      "height" : 345
    },
    "imageInsightsToken" : "ccid_tmaGQ2eU*mid_D12339146CF...",
    "insightsMetadata" : {
      "recipeSourcesCount" : 6,
      "pagesIncludingCount" : 103,
      "availableSizesCount" : 28
    },
    "imageId" : "D12339146CFEDF3D409CC7A66D2C98D0D71904D4",
    "accentColor" : "3A0B01"
  },
  "actionType" : "MoreSizes"
},

VisualSearch 见解

VisualSearch 见解提供了与原始图像在视觉上相似的图像列表(包含与原始图像中显示的内容类似的内容)。 有关示例用法,请参阅 VisualSearch 见解示例

{
  "_type" : "ImageModuleAction",
  "actionType" : "VisualSearch",
  "data" : {
    "value" : [
      {
        "webSearchUrl" : "https:\/\/www.bing.com\/images\/search?view=...",
        "name" : "An apple pie...",
        "thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?id=OIP.z...",
        "datePublished" : "2017-03-18T00:17:00.0000000Z",
        "contentUrl" : "http:\/\/contoso.net\/images\/8\/8a\/an_apple_pie.png",
        "hostPageUrl" : "http:\/\/contoso.com\/wiki\/an_apple_pie.png",
        "contentSize" : "87930 B",
        "encodingFormat" : "png",
        "hostPageDisplayUrl" : "contoso.com\/wiki\/an_apple_pie.png",
        "width" : 263,
        "height" : 192,
        "thumbnail" : {
          "width" : 474,
          "height" : 346
        },
        "imageInsightsToken" : "ccid_zhRxfGkI*mid_1DCBA7AA6D231...",
        "insightsMetadata" : {
          "recipeSourcesCount" : 6,
          "pagesIncludingCount" : 103,
          "availableSizesCount" : 28
        },
        "imageId" : "1DCBA7AA6D23147F9DD06D47DB3A38EB25389",
        "accentColor" : "3E0D01"
      }
    ]
  }
}

Recipes 见解

Recipes 见解提供了一个网页列表,这些网页中包含用于制作图像中显示的食物的配方。 有关示例用法,请参阅 Recipes 见解示例

{
  "_type" : "ImageRecipesAction",
  "actionType" : "Recipes",
  "data" : {
    "value" : [
      {
        "name" : "Granny's Apple Pie",
        "url" : "http:\/\/contoso.com\/recipes\/appetizer\/apple-pie.html",
        "description" : "I love Granny's apple pie. Sooooo delicious...",
        "thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?id=A63002cd9",
        "creator" : {
          "_type" : "Person",
          "name" : "Charlene Whitney"
        },
        "aggregateRating" : {
          "text" : "5",
          "ratingValue" : 5,
          "bestRating" : 5,
          "reviewCount" : 1
        },
        "cookTime" : "PT45M",
        "prepTime" : "PT1H",
        "totalTime" : "PT1H45M"
      }
    ]
  }
}

ImageById 见解

ImageById 见解提供了你请求其见解的图像的 Image 对象:

{
  "image" : {
    "webSearchUrl" : "https:\/\/www.bing.com\/images\/search?view=deta...",
    "name" : "Making Apple Pie",
    "thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?id=OIP...",
    "datePublished" : "2013-06-21T12:00:00.0000000Z",
    "contentUrl" : "http:\/\/contoso.com\/content\/uploads\/2013\/06\/apple-pie.jpg",
    "hostPageUrl" : "http:\/\/contoso.com\/2013\/06\/21\/making-apple-pie\/",
    "contentSize" : "134847 B",
    "encodingFormat" : "jpeg",
    "hostPageDisplayUrl" : "contoso.com\/2013\/06\/21\/making-apple-pie",
    "width" : 1050,
    "height" : 765,
    "thumbnail" : {
      "width" : 474,
      "height" : 345
    },
    "imageInsightsToken" : "ccid_tmaGQ2eU*mid_D12339146CFE...",
    "insightsMetadata" : {
      "recipeSourcesCount" : 6,
      "pagesIncludingCount" : 103,
      "availableSizesCount" : 28
    },
    "imageId" : "D12339146CFEDF3D409A66D2C98D0D71904D4",
    "accentColor" : "3A0B01"
  },
  "actionType" : "ImageById"
},

ProductVisualSearch 见解

ProductVisualSearch 见解提供了与原始图像中显示的产品在视觉上类似的产品图像列表。 insightsMetadata 字段可包含有关你可以从其购买产品的卖方和产品价格的信息。

{
  "_type" : "ImageModuleAction",
  "actionType" : "ProductVisualSearch",
  "data" : {
    "value" : [
      {
        "webSearchUrl" : "https:\/\/www.bing.com\/images\/search?view=detail...",
        "name" : "Contoso 4-Piece Kitchen Package...",
        "thumbnailUrl" : "https:\/\/tse3.mm.bing.net\/th?id=OIP.l9hzaabu-RJd...",
        "datePublished" : "2017-07-16T04:28:00.0000000Z",
        "contentUrl" : "https:\/\/www.contoso.com\/assets\/media\/images\/prod...",
        "hostPageUrl" : "https:\/\/www.contoso.com\/4-piece-kitchen-package...",
        "contentSize" : "13594 B",
        "encodingFormat" : "jpeg",
        "hostPageDisplayUrl" : "https:\/\/www.contoso.com\/4-piece-kitchen-package...",
        "width" : 450,
        "height" : 332,
        "thumbnail" : {
          "width" : 474,
          "height" : 349
        },
        "imageInsightsToken" : "ccid_l9hzaabu*mid_70A8B616355D681DB9A5A...",
        "insightsMetadata" : {
          "shoppingSourcesCount" : 1,
          "recipeSourcesCount" : 0,
          "aggregateOffer" : {
            "name":"4-Piece Kitchen Package with...",
            "priceCurrency":"USD",
            "lowPrice":2756,
            "offers" : [
              {
                "name" : "4-Piece Kitchen Package with...",
                "url" : "https:\/\/www.fabrikam.com\/1234.html?ref=bing",
                "description" : "This 36 Frenchdoor refrigerator by...",
                "seller" : {
                  "name" : "Fabrikam",
                  "image" : {
                    "url" : "https:\/\/tse1.mm.bing.net\/th?id=A818f811..."
                  }
                },
                "price" : 2756,
                "priceCurrency" : "USD",
                "availability" : "InStock",
                "lastUpdated" : "2018-02-20T00:00:00.0000000"
              }
            ],
            "offerCount":1
          },
          "pagesIncludingCount" : 4,
          "availableSizesCount" : 2
        },
        "imageId" : "70A8B616355D681DA5980A8D0514BCC995A3",
        "accentColor" : "60646B"
      }
    ]
  }
}

RelatedSearches 见解

RelatedSearches 见解提供了其他人(基于其他用户的搜索词)进行的相关搜索列表。 有关示例用法,请参阅 RelatedSearches 见解示例

{
  "_type" : "ImageRelatedSearchesAction",
  "actionType" : "RelatedSearches",
  "data" : {
    "value" : [
      {
        "text" : "Homemade Apple Pies Recipes",
        "displayText" : "Homemade Apple Pies Recipes",
        "webSearchUrl" : "https:\/\/www.bing.com\/images\/search?q=Homemade...",
        "thumbnail" : {
          "url" : "https:\/\/tse1.mm.bing.net\/th?q=Homemade+Apple+Pies"
        }
      }
    ]
  }
}

DocumentLevelSuggestions 见解

DocumentLevelSuggestions 见解提供了基于图像内容建议的搜索词列表:

{
  "_type" : "ImageRelatedSearchesAction",
  "actionType" : "DocumentLevelSuggestions",
  "data" : {
    "value" : [
      {
        "text" : "American Apple Pie",
        "displayText" : "American Apple Pie",
        "webSearchUrl" : "https:\/\/www.bing.com\/images\/search?q=American",
        "thumbnail" : {
          "url" : "https:\/\/tse3.mm.bing.net\/th?q=American+Apple+Pie."
        }
      }
    ]
  }
}

后续步骤

请参阅必应见解用法示例了解必应可如何显示视觉见解。

若要快速了解如何使用第一个请求,请参阅快速入门: