aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-03-05 20:52:02 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-03-05 20:52:02 +0100
commit053a02bbb65c4844582e518fee96782e351fd0c5 (patch)
treebb2571d1eab5857c1cc0fbce7a54452681b5751a /README.md
parent47982b0f41790d9fdb6bdac7084c02015b5d3049 (diff)
downloadgoogle_images-053a02bbb65c4844582e518fee96782e351fd0c5.tar.xz
Add safeSearch option
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index 2dfea40..856c488 100644
--- a/README.md
+++ b/README.md
@@ -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
```