user54321
user54321

Reputation: 632

Missing parameter "q" in bing image search API

When I tried to use similar products search from Bing search api with the following url with a valid api key in the header, it returns an error saying the request is missing a parameter "q". I need to search the image without a query string but just the image URL.

https://api.cognitive.microsoft.com/bing/v7.0/images/search?modulesRequested=SimilarProducts&mkt=en-us&form=BCSPRD&imgUrl=https%3A%2F%2Fm.media-amazon.com%2Fimages%2FG%2F01%2Fzappos%2Flanding%2Fpages%2Fmensclothing%2FMelodyTest1%2FMensShoes1.V506596164.jpg&count=1

Thanks in advance

Upvotes: 1

Views: 435

Answers (1)

Ronak
Ronak

Reputation: 736

The endpoint is different. "Search" endpoint is meant for searching for images, given a query. "Details" endpoint will do the trick here. You need to do something like this:

GET https://api.cognitive.microsoft.com/bing/v7.0/images/details?imgurl=YOUR_IMAGE_URL&modules=SimilarImages

Use this with your access key as a header and it will work.

Upvotes: 0

Related Questions