]> git.lizzy.rs Git - google_images.git/blob - README.md
Create README.md
[google_images.git] / README.md
1 # google_images
2 Reverse Engineered Google Image Search API
3
4 ## Usage
5
6 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.
7 `search` returns an promise that resolves to an array with objects like this (should be self-explanatory):
8
9 ```js
10 {
11         preview: {
12                 url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQpttHz6N94mnwy5NbULk733B3srNYPMsmaYQ&usqp=CAU',
13                 size: { width: 168, height: 300 }
14         },
15         image: {
16                 url: 'https://en.free-wallpapers.su/data/media/3/big/anm5679.jpg',
17                 size: { width: 1080, height: 1920 }
18         },
19         color: 'rgb(232,190,194)',
20         link: 'https://en.free-wallpapers.su/img116919.htm',
21         title: 'Astolfo. Desktop wallpaper. 1920x1080'
22 }
23 ```
24
25 ### Example
26
27 ```js
28 const {search} = require("google_images");
29 search("astolfo+images").then(results => results.forEach(r => console.log(r.image.url)))
30 ```
31