Use this library to get a search result from google.
MIT
javascript
let google = require('google-parser');
typescript
import * as google from 'google-parser'
This module supports only Promise and async / await.
google.img(search: string, safe: boolean): Promise<IImg[]>
google.jpg(search: string, safe: boolean): Promise<IImg[]>
google.google(search: string, safe: boolean): Promise<ISearch[]|ISearchError>
Add an optional argument for safe search.
interface IImg {
img: string,
url: string,
name: string
}
interface ISearch {
title: string,
url: string,
description: string
}
interface ISearchError {
error: true,
reson: "antibot"
}
The return is treated as an object. Please refer to the above type.