
open ( my_bytes_io ) # show it in the default system photo viewer temp_img. seek ( 0 ) # create a temporary image object temp_img = Image. copy_to ( my_bytes_io ) # we go back to address 0 again so PIL can read it from start to finish my_bytes_io. copy_to ( my_bytes_io, raw_image_data ) # or without the raw data which will be automatically taken # inside the copy_to() method image. get_raw_data () # this function writes the raw image data to the object image. seek ( 0 ) # take raw image data raw_image_data = image. results (): # here we tell the BytesIO object to go back to address 0 my_bytes_io. Choose ONE option only # - This param can also be omitted from _search_params if you do not wish to define any value _search_params = ) for image in gis. # For param marked with '#': # - Multiselect is currently not feasible. > gimages search -q puppies -d /path/ -w 500 -h 500 Programmatic usage from google_images_search import GoogleImagesSearch # you can provide API key and CX using arguments, # or you can set environment variables: GCS_DEVELOPER_KEY, GCS_CX gis = GoogleImagesSearch ( 'your_dev_api_key', 'your_project_cx' ) # define search params # option for commonly used search param are shown below for easy reference.

> gimages search -q puppies -d /path/on/your/drive/where/images/should/be/downloaded > export GCS_DEVELOPER_KEY =_your_dev_api_key_

> gimages -k _your_dev_api_key_ -c _your_project_cx_ search -q puppies Install package from : > pip install Google-Images-SearchĬLI usage # without environment variables: Visit and in the web form where you create/edit your custom search engine enable "Image search" option and for "Sites to search" option select "Search the entire web but emphasize included sites".Īfter setting up your Google developers account and project you should have been provided with developers API key and project CX. Visit and generate API key credentials for your project. Visit and enable "Custom Search API" for your project.

To be able to use this library, you need to enable Google Custom Search API, generate API key credentials and set a project:
