google-images-url
v1.0.2
Published
🔗 URL generator for Google images
Downloads
8
Readme
Google Images URL
🔗 URL generator for Google images
Installation
npm install google-images-url
# or
yarn add google-images-url
Usage
import GoogleImagesUrl from 'GoogleImagesUrl'
GoogleImagesUrl.create('cute cats', { size: 'large' })
// > https://www.google.com/search?q=cute%20cats&tbs=isz:l,qdr:a&tbm=isch
API
GoogleImagesUrl(query, options)
query
- The term used for the search.options
- An object containing options to customize the Google Images URL.
query
The query is the term used for the search. It should be a string.
options
The options parameter is an object containing different values:
size
–{String|Object}
The size of the images. If a string is provided then it should be one of the following values:icon
,medium
orlarge
. If an object is provided it should containswidth
andheight
properties.color
-{String}
The color of the images. The string should be one of the following values:orange
,yellow
,green
,teal
,blue
,purple
,pink
,white
,gray
,black
orbrown
.types
-{String}
The type of images. The string should be one of the following values:face
,photo
,clipart
,lineart
oranimated
.showSizes
-{Boolean}
Show images sizes in results. Iftrue
show images sizes in results, otherwise no.time
-{String|Object}
The time range of the images. If a string is provided it should be one of the following values:anytime
,second
,minute
,hour
,day
,week
,month
oryear
. If an object is provided it should containsfrom
andto
properties. The values for these properties should be a string value representing a date in the format:mm/dd/yyyy
.sortBy
-{String}
The sorting algorithm. The string should be one of the following values:date
orrelevance
.
Tests
npm test
# or
yarn test