serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
45 stars 3 forks source link

[Google Images API] Allow searches with `filetype:` operator #1652

Open marm123 opened 3 weeks ago

marm123 commented 3 weeks ago

One of our users asked to filter images by file type. This is supported in Google by using the filetype:x operator, where the x is the image extension (png, jpg, etc.)

In the past, we've implemented a validator that disallowed using certain filetype: values in https://github.com/serpapi/SerpApi/pull/3278, and suggested using tbs with the ift=x value. This seems to no longer work, and the filetype: is the correct approach.

EDIT. It looks like the tbs=ift:x is supported as opposed to the tbs=ift=x as suggested in the error message. However, I believe we should still allow filetype searches, or at least update the error message to ift:x instead of ift=x.

How to set the filetype search in Advanced Search for Google Images: image

The result of the above:

image

Our Playground:

image

Playground | Google Search Intercom