aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 7fca40f62248d4b6f3fc07e431086c699a948bc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# free-google-images
Reverse Engineered Google Image Search API

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.
`search` returns an promise that resolves to an array with objects like this (should be self-explanatory):

```js
{
	preview: {
		url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQpttHz6N94mnwy5NbULk733B3srNYPMsmaYQ&usqp=CAU',
		size: { width: 300, height: 168 }
	},
	image: {
		url: 'https://en.free-wallpapers.su/data/media/3/big/anm5679.jpg',
		size: { width: 1920, height: 1080 }
	},
	color: 'rgb(232,190,194)',
	link: 'https://en.free-wallpapers.su/img116919.htm',
	title: 'Astolfo. Desktop wallpaper. 1920x1080'
}
```

### Example

```js
const {search} = require("free-google-images");
search("astolfo+images").then(results => results.forEach(r => console.log(r.image.url)))
```