---
title: "WebImageSearch"
language: "en"
type: "Symbol"
summary: "WebImageSearch[string] gives a list of thumbnails of the top web image search results for the specified literal string. WebImageSearch[form] gives the top results obtained by doing the web image search specified by form. WebImageSearch[form, n] picks out the first n top results obtained by doing the web image search specified by form. WebImageSearch[form, elems] gives the elements of the web image search specified by elems. WebImageSearch[form, elems, n] picks out the first n elements of the web image search specified by elems."
keywords: 
- websearch
- web image search
- image search
- google
- bing
canonical_url: "https://reference.wolfram.com/language/ref/WebImageSearch.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Creating & Importing Images"
    link: "https://reference.wolfram.com/language/guide/CreatingAndImportingImages.en.md"
  - 
    title: "Knowledge Representation & Access"
    link: "https://reference.wolfram.com/language/guide/KnowledgeRepresentationAndAccess.en.md"
  - 
    title: "Listing of Supported External Services"
    link: "https://reference.wolfram.com/language/guide/ListingOfSupportedExternalServices.en.md"
  - 
    title: "Accessing External Services & APIs"
    link: "https://reference.wolfram.com/language/guide/AccessingExternalServicesAndAPIs.en.md"
  - 
    title: "People & History"
    link: "https://reference.wolfram.com/language/guide/PeopleAndHistory.en.md"
  - 
    title: "Web Operations"
    link: "https://reference.wolfram.com/language/guide/WebOperations.en.md"
  - 
    title: "Cultural Data"
    link: "https://reference.wolfram.com/language/guide/CulturalData.en.md"
  - 
    title: "Computation with Structured Datasets"
    link: "https://reference.wolfram.com/language/guide/ComputationWithStructuredDatasets.en.md"
related_workflows: 
  - 
    title: "Import an Image into a Notebook"
    link: "https://reference.wolfram.com/language/workflow/ImportAnImageIntoANotebook.en.md"
related_functions: 
  - 
    title: "WebSearch"
    link: "https://reference.wolfram.com/language/ref/WebSearch.en.md"
  - 
    title: "WikipediaData"
    link: "https://reference.wolfram.com/language/ref/WikipediaData.en.md"
  - 
    title: "WikipediaSearch"
    link: "https://reference.wolfram.com/language/ref/WikipediaSearch.en.md"
  - 
    title: "Import"
    link: "https://reference.wolfram.com/language/ref/Import.en.md"
  - 
    title: "ResourceData"
    link: "https://reference.wolfram.com/language/ref/ResourceData.en.md"
  - 
    title: "ServiceExecute"
    link: "https://reference.wolfram.com/language/ref/ServiceExecute.en.md"
  - 
    title: "$ServiceCreditsAvailable"
    link: "https://reference.wolfram.com/language/ref/$ServiceCreditsAvailable.en.md"
  - 
    title: "GeoImage"
    link: "https://reference.wolfram.com/language/ref/GeoImage.en.md"
  - 
    title: "WebImage"
    link: "https://reference.wolfram.com/language/ref/WebImage.en.md"
---
[EXPERIMENTAL]

# WebImageSearch

WebImageSearch["string"] gives a list of thumbnails of the top web image search results for the specified literal string.

WebImageSearch[form] gives the top results obtained by doing the web image search specified by form.

WebImageSearch[form, n] picks out the first n top results obtained by doing the web image search specified by form.

WebImageSearch[form, elems] gives the elements of the web image search specified by elems.

WebImageSearch[form, elems, n] picks out the first n elements of the web image search specified by elems.

## Details and Options

* ``WebImageSearch`` requires internet connectivity and uses external services that require [Service Credits](http://www.wolfram.com/service-credits/).

* ``WebImageSearch`` supports the following basic search forms:

|               |                                                         |
| ------------- | ------------------------------------------------------- |
| string        | string is the query for the search engine               |
| "string"      | complete string must occur in the image metadata        |
| {s1, s2, …}   | search for all si in the image metadata                 |
| s1 \| s2 \| … | at least one of the si must occur in the image metadata |
| "field" -> s1  | the si must occur in the given field                    |
| Except[q]     | q cannot occur in the image metadata                    |

* Possible fields include:

|           |                                                 |
| --------- | ----------------------------------------------- |
| "Country" | search only within a given country's web domain |
| "Site"    | search only within specified website            |

* Possible options include:

|                   |           |                                           |
| ----------------- | --------- | ----------------------------------------- |
| AllowAdultContent | False     | whether to include adult-type results     |
| Language          | None      | give only pages in the specified language |
| MaxItems          | 10        | number of results to return               |
| Method            | Automatic | external search service to use            |

* Possible settings for ``Method`` include ``"Google"`` and ``"Bing"``.

* Possible elements that can be specified by ``elems`` include:

|                   |                                         |
| ----------------- | --------------------------------------- |
| "Thumbnails"      | image thumbnails                        |
| "Images"          | full images                             |
| "ImageHyperlinks" | full image hyperlinks                   |
| "PageTitles"      | page titles                             |
| "PageHyperlinks"  | hyperlinks to pages where images appear |
| "FileFormats"     | formats of image files                  |

---

## Examples (17)

### Basic Examples (3)

Search for images of tigers:

```wl
In[1]:= WebImageSearch["tiger"]

Out[1]= [image]
```

---

Limit the result to four images:

```wl
In[1]:= WebImageSearch["bear", 4]

Out[1]= [image]
```

---

Take the two largest images from search results:

```wl
In[1]:= images = WebImageSearch["tuatara"];

In[2]:= TakeLargestBy[images, Times@@ImageDimensions[#]&, 2]

Out[2]= [image]
```

### Scope (10)

#### Search Forms (4)

Search for images that match a complete string:

```wl
In[1]:= WebImageSearch["\"field of flowers\"", 4]

Out[1]= [image]
```

---

Search for images whose metadata contains all specified strings:

```wl
In[1]:= WebImageSearch[{"flowers", "cats"}, 4]

Out[1]= [image]
```

---

Filter results by country:

```wl
In[1]:= WebImageSearch["ceviche", "Country" -> Entity["Country", "Peru"], MaxItems -> 4]

Out[1]= [image]
```

---

Filter results by site:

```wl
In[1]:= WebImageSearch["orange cat", "Site" -> "instagram.com" | URL["thecatsite.com"], MaxItems -> 4 ]

Out[1]= [image]
```

#### Elements (6)

##### FileFormats (1)

---

Get the file formats of images returned by the search query:

```wl
In[1]:= WebImageSearch["spikey logo", "FileFormats"]

Out[1]= {Entity["FileFormat", "JPG-1"], Entity["FileFormat", "JPG-1"], Entity["FileFormat", "JPG-1"], Entity["FileFormat", "JPG-1"], Entity["FileFormat", "JPG-1"], Entity["FileFormat", "PNG-1"], Entity["FileFormat", "PNG-1"], Entity["FileFormat", "PNG-1"], Entity["FileFormat", "PNG-1"], Entity["FileFormat", "PNG-1"]}
```

##### ImageHyperlinks (1)

---

Get hyperlinks to the full images returned by the search query:

```wl
In[1]:= WebImageSearch["james webb telescope", "ImageHyperlinks"]

Out[1]= {URL["http://www.spaceflightinsider.com/wp-content/uploads/2015/04/James-Webb-Space-Telescope-image-credit-European-Space-Agency-ESA-posted-on-SpaceFlight-Insider.jpg"], URL["http://cdn.phys.org/newman/gfx/news/hires/2015/1-projectscien.jpg"], URL[ ... /wp-content/uploads/2018/03/James-Webb-Telescope.jpg"], URL["http://www.spaceflightinsider.com/wp-content/uploads/2017/03/JWST_16658886757_b28e2c7a4f_L-1600.jpg"], URL["http://en.es-static.us/upl/2015/07/JWST-ESA-C-Carreau-sq-e1436474163705.jpg"]}
```

##### Images (1)

---

Get a list of full images:

```wl
In[1]:= WebImageSearch["saturn rings", "Images", 2]

Out[1]= [image]
```

##### PageHyperlinks (1)

---

Get hyperlinks to the pages containing the images returned by the search query:

```wl
In[1]:= WebImageSearch["james webb telescope", "PageHyperlinks"]

Out[1]= {URL["http://arstechnica.com/science/2016/09/if-proxima-centauri-b-has-an-atmosphere-james-webb-telescope-could-see-it/"], URL["http://museumplanetarium.org/event/mission-overview-james-webb-space-telescope/"], URL["https://astrobites.org/2015/02/1 ... m/128618/james-webb-space-telescope-takes-gloves-off/"], URL["http://www.businessinsider.com/nasa-new-space-telescope-built-2016-11"], URL["http://www.ibtimes.co.uk/nasas-hubble-successor-most-advanced-telescope-james-webb-ready-testing-1622022"]}
```

##### PageTitles (1)

---

Get the titles of the pages containing the images returned by the search query:

```wl
In[1]:= WebImageSearch["james webb telescope", "PageTitles"]

Out[1]= {"James Webb Space Telescope Takes The Gloves Off - Universe Today", "James Webb Telescope: Facts, Cost, Launch Date, UPSC - Leverage Edu", "Le lancement du télescope spatial James Webb repoussé à 2019", "Meet the largest science project in US gove ...  to be launched by 2021", "NASA’s Webb Telescope Packs Its Tennis Court-Sized Sunshield for a ...", "NASA’s $10 Billion James Webb Space Telescope Completes Final ...", "What could the James Webb telescope see of the closest exoplanet? | Ars ..."}
```

##### Thumbnails (1)

---

Get a list of thumbnails:

```wl
In[1]:= WebImageSearch["ocean waves", "Thumbnails", 4]

Out[1]= {[image], [image], [image], [image]}
```

### Options (3)

#### Language (1)

Search for images only on pages in a specified language:

```wl
In[1]:= WebImageSearch["さくら", 4, Language -> Entity["Language", "Japanese"]]

Out[1]= {[image], [image], [image], [image]}
```

#### MaxItems (1)

Specify the maximum number of images to retrieve:

```wl
In[1]:= WebImageSearch["desert plains", MaxItems -> 4]

Out[1]= {[image], [image], [image], [image]}
```

#### Method (1)

Specify a search engine:

```wl
In[1]:= WebImageSearch["white beaches", 4, Method -> "Google"]

Out[1]= {[image], [image], [image], [image]}
```

### Neat Examples (1)

Compare search results from different countries:

```wl
In[1]:=
resultsGreece = ImageResize[#, 150]& /@ WebImageSearch["temple", "Country" -> Entity["Country", "Greece"]];
resultsIndonesia = ImageResize[#, 150]& /@ WebImageSearch["temple", "Country" -> Entity["Country", "Indonesia"]];

In[2]:= ImageCollage[resultsGreece]

Out[2]= [image]

In[3]:= ImageCollage[resultsIndonesia]

Out[3]= [image]
```

## See Also

* [`WebSearch`](https://reference.wolfram.com/language/ref/WebSearch.en.md)
* [`WikipediaData`](https://reference.wolfram.com/language/ref/WikipediaData.en.md)
* [`WikipediaSearch`](https://reference.wolfram.com/language/ref/WikipediaSearch.en.md)
* [`Import`](https://reference.wolfram.com/language/ref/Import.en.md)
* [`ResourceData`](https://reference.wolfram.com/language/ref/ResourceData.en.md)
* [`ServiceExecute`](https://reference.wolfram.com/language/ref/ServiceExecute.en.md)
* [`\$ServiceCreditsAvailable`](https://reference.wolfram.com/language/ref/$ServiceCreditsAvailable.en.md)
* [`GeoImage`](https://reference.wolfram.com/language/ref/GeoImage.en.md)
* [`WebImage`](https://reference.wolfram.com/language/ref/WebImage.en.md)

## Tech Notes

* [Import an Image into a Notebook](https://reference.wolfram.com/language/workflow/ImportAnImageIntoANotebook.en.md)

## Related Guides

* [Creating & Importing Images](https://reference.wolfram.com/language/guide/CreatingAndImportingImages.en.md)
* [Knowledge Representation & Access](https://reference.wolfram.com/language/guide/KnowledgeRepresentationAndAccess.en.md)
* [Listing of Supported External Services](https://reference.wolfram.com/language/guide/ListingOfSupportedExternalServices.en.md)
* [Accessing External Services & APIs](https://reference.wolfram.com/language/guide/AccessingExternalServicesAndAPIs.en.md)
* [People & History](https://reference.wolfram.com/language/guide/PeopleAndHistory.en.md)
* [Web Operations](https://reference.wolfram.com/language/guide/WebOperations.en.md)
* [Cultural Data](https://reference.wolfram.com/language/guide/CulturalData.en.md)
* [Computation with Structured Datasets](https://reference.wolfram.com/language/guide/ComputationWithStructuredDatasets.en.md)

## History

* [Introduced in 2017 (11.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn111.en.md) \| [Updated in 2020 (12.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn121.en.md)