Using Bing Reverse Image API by uploading an image
Our Bing Reverse Image API supports searching by uploading an image. This provides convenience if you aren't already hosting your images in the cloud.
The API endpoint is https://serpapi.com/search?engine=bing_reverse_image
Head to the playground for a live and interactive demo.
API parameters
image_id
Required
Parameter defines the Image ID you want to use for the search. The Image ID can be obtained using the Image API. Use this parameter instead of image_url. These parameters can't be used together. Uploaded images expire after 10 minutes. The image's width and height must each be 4,000 pixels or less.
API examples
Step 1 - Upload an image to the Image API to obtain the image_id
Make a multipart/form-data POST request to the /image endpoint with the binary image in a field named image. The maximum file size is 500 KB. Find out more details in the Image API documentation.
POST
-
https://serpapi.com/image
Multipart form data
-
image=@/path/to/image.png
Example in cURL
-
curl -X POST https://serpapi.com/image \ -F "image=@/path/to/image.png" \ -F "api_key=secret_api_key"
JSON Output Example
{
"message": "Image uploaded successfully.",
"image_id": "IubYInicu2lclFiun2RiZGKWnJyaZmqaZmxoYJKUYm5iYGKSZGJpaJCcYm6oV5CXHm9obmlsYGRqYmEAALNwDuI"
}
Step 2 - Search using the image_id parameter
{
...
"image_info": {
"link": "https://www.bing.com/images/search?view=detailv2&FORM=OIIRPO",
"width": 727,
"height": 275,
"format": "png",
"file_size": "7267 B"
},
"related_content": [
{
"position": 1,
"title": "Worldline India Payment Gateway Integration - SDK & API, Web, Android ...",
"link": "https://www.bing.com/images/search?view=detailv2&FORM=OIIRPO&id=CB76A0C4CE64B5C44ABB9C91C88182254F658A44&simid=608016943737939116",
"thumbnail": "https://tse3.mm.bing.net/th/id/OIP.LiZstBQen1QF7LIx20viDwAAAA?r=0&pid=Api",
"date": "2024-01-19T00:31:00Z",
"source": "https://www.paynimo.com/paynimokit/",
"original": "https://www.paynimo.com/paynimokit/images/rubyrails.png",
"cdn_original": "https://th.bing.com/th/id/R.2e266cb4141e9f5405ecb231db4be20f?rik=RIplTyWCgciRnA&pid=ImgRaw&r=0",
"domain": "www.paynimo.com",
"width": 439,
"height": 256,
"format": "png",
"thumbnail_width": 439,
"thumbnail_height": 256,
"file_size": "4587 B"
},
{
"position": 2,
"title": "Getting Started with Ruby On Rails in 2020 - DEV Community",
"link": "https://www.bing.com/images/search?view=detailv2&FORM=OIIRPO&id=66AFC0A65D3AC0C1468911FA37BFC910A416C235&simid=608006863421916271",
"thumbnail": "https://tse4.mm.bing.net/th/id/OIP.KPNfutQxbf-JlBKygKpHWwHaDH?r=0&pid=Api",
"date": "2020-01-06T01:14:00Z",
"source": "https://dev.to/camfilho/getting-started-with-ruby-on-rails-in-2020-4jfn",
"original": "https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https://thepracticaldev.s3.amazonaws.com/i/w6ritc6hnogxyg5b4t44.jpg",
"cdn_original": "https://th.bing.com/th/id/R.28f35fbad4316dff899412b280aa475b?rik=NcIWpBDJvzf6EQ&pid=ImgRaw&r=0",
"domain": "media2.dev.to",
"width": 1000,
"height": 420,
"thumbnail_width": 474,
"thumbnail_height": 199,
"file_size": "22940 B"
},
{
"position": 3,
"title": "The Sparkling Web Journey: Dive into Ruby on Rails | AlphaDC",
"link": "https://www.bing.com/images/search?view=detailv2&FORM=OIIRPO&id=1925FB3D56822D4892979F4E305BD1A535ECBDBE&simid=608006438221256263",
"thumbnail": "https://tse3.mm.bing.net/th/id/OIP.F8cz2N-LPOtoDqk0yPLlaAHaB2?r=0&pid=Api",
"date": "2024-01-01T16:43:00Z",
"source": "https://alphadc.net/blog/review/the-sparkling-web-journey-dive-into-ruby-on-rails/",
"original": "https://alphadc.net/wp-content/uploads/2023/06/rails-featured.jpg",
"cdn_original": "https://th.bing.com/th/id/R.17c733d8df8b3ceb680ea934c8f2e568?rik=vr3sNaXRWzBOnw&pid=ImgRaw&r=0",
"domain": "alphadc.net",
"width": 1000,
"height": 250,
"format": "jpeg",
"thumbnail_width": 474,
"thumbnail_height": 118,
"file_size": "8727 B"
},
...
],
"related_searches": [
{
"name": "Railroad Company Logos",
"link": "https://www.bing.com/images/search?q=Railroad+Company+Logos&mmreqh=iDNcfmaJeLDy9aRblXLv3srp%2fVeXSxMdFH%2bkNT5%2f3EU%3d&FORM=IDINTS",
"thumbnail": "https://tse2.mm.bing.net/th?q=Railroad+Company+Logos&r=0&pid=Api&mkt=en-US&cc=US&setlang=en&adlt=moderate",
"serpapi_link": "https://serpapi.com/search.json?device=desktop&engine=bing_images&q=Railroad+Company+Logos"
},
{
"name": "UK Railway Logo",
"link": "https://www.bing.com/images/search?q=UK+Railway+Logo&mmreqh=l8%2fY2f2ZcinJ%2b6eBipig8VNSEfONHgI2MscexQljUns%3d&FORM=IDINTS",
"thumbnail": "https://tse1.mm.bing.net/th?q=UK+Railway+Logo&r=0&pid=Api&mkt=en-US&cc=US&setlang=en&adlt=moderate",
"serpapi_link": "https://serpapi.com/search.json?device=desktop&engine=bing_images&q=UK+Railway+Logo"
},
{
"name": "Indian Railway Red Logo",
"link": "https://www.bing.com/images/search?q=Indian+Railway+Red+Logo&mmreqh=tk0QEz%2bdlh95X8y97NhnDIiya2klBaBhxDe%2fJ8QnLSE%3d&FORM=IDINTS",
"thumbnail": "https://tse1.mm.bing.net/th?q=Indian+Railway+Red+Logo&r=0&pid=Api&mkt=en-US&cc=US&setlang=en&adlt=moderate",
"serpapi_link": "https://serpapi.com/search.json?device=desktop&engine=bing_images&q=Indian+Railway+Red+Logo"
},
...
],
...
}