diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-05 20:52:02 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-05 20:52:02 +0100 |
commit | 053a02bbb65c4844582e518fee96782e351fd0c5 (patch) | |
tree | bb2571d1eab5857c1cc0fbce7a54452681b5751a /README.md | |
parent | 47982b0f41790d9fdb6bdac7084c02015b5d3049 (diff) | |
download | google_images-053a02bbb65c4844582e518fee96782e351fd0c5.tar.xz |
Add safeSearch option
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -5,7 +5,7 @@ The usage of this API does NOT require an API key, nor is it rate limited. ## Usage -Exports `search` function that takes query string as first argument and optionally user agent as second. Usage of the user agent argument has not been tested. +Exports `search` function that takes query string as first argument, a boolean safeSearch as second and optionally user agent as second. Usage of the user agent argument has not been tested. `search` returns an promise that resolves to an array with objects like this (should be self-explanatory): ```js @@ -31,5 +31,7 @@ const google_images = require("free-google-images"); google_images.search("astolfo+images").then(results => results.forEach(r => console.log(r.image.url))) google_images.searchRandom("astolfo+images").then(result => console.log(result.image.url)) + +google_images.searchRandom("hentai", true).then(result => console.log(result.image.url)) // no results because of safe search ``` |