# google-it

> A CLI and Node.js library to help retrieve, display, and store Google search results

Latest version **1.6.4** (published 2022-11-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install google-it
pnpm add google-it
yarn add google-it
bun add google-it
```

Provides the command `google-it`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.4 |
| Published | 2022-11-14 |
| First published | 2017-09-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 39.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 109 |
| Author | Pat Needham |
| Maintainers | patneedham |
| Keywords | google-search, google-search-to-json |

## Links

- npm: https://www.npmjs.com/package/google-it
- Repository: https://github.com/PatNeedham/google-it
- Homepage: https://github.com/PatNeedham/google-it#readme
- Issues: https://github.com/PatNeedham/google-it/issues
- npm.io page: https://npm.io/package/google-it

## Dependencies (5)

- [ora](https://npm.io/package/ora.md) ^4.0.3
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.11
- [request](https://npm.io/package/request.md) ^2.88.0
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.6.4 (latest) — 2022-11-14
- 1.6.3 — 2022-06-13
- 1.6.2 — 2021-02-24
- 1.6.1 — 2021-01-17
- 1.6.0 — 2020-12-07
- 1.5.4 — 2020-10-31
- 1.5.3 — 2020-10-30
- 1.5.2 — 2020-10-04
- 1.5.1 — 2020-10-04
- 1.5.0 — 2020-01-28
- 1.4.3 — 2020-01-24
- 1.4.2 — 2020-01-04
- 1.4.1 — 2019-12-28
- 1.4.0 — 2019-12-26
- 1.3.0 — 2019-12-26
- … 13 more at https://npm.io/package/google-it/versions

## README

# google-it [![Build Status](https://travis-ci.org/PatNeedham/google-it.svg?branch=master)](https://travis-ci.org/PatNeedham/google-it) [![npm version](https://badge.fury.io/js/google-it.svg)](https://www.npmjs.com/package/google-it) [![Codecov Coverage](https://img.shields.io/codecov/c/github/PatNeedham/google-it/master.svg?style=flat-square)](https://codecov.io/gh/PatNeedham/google-it/) [![Maintainability](https://api.codeclimate.com/v1/badges/fe8329b7641ea86326e4/maintainability)](https://codeclimate.com/github/PatNeedham/google-it/maintainability)

A simple library to convert Google search results to JSON output, with an interactive display option coming in the near future.

## Install

`$ npm install --save -g google-it`

## Example Usage

`$ google-it --query="Latvian unicorn"`

![GIF of google-it](./images/google-it-demo.gif?raw=true "google-it")

Prevent display in the terminal, and save results to a JSON file:

`$ google-it --query="PWAs with react-router and redux" -o results.json -n`

![GIF of google-it w/o display, results saved to file](./images/google-it-output-no-display.gif?raw=true "google-it")

`$ google-it --query="open whisper systems" -O 5`

![GIF of opening-in-browser](./images/open-results-in-browser.gif?raw=true "google-it-to-browser")

`$ google-it --query="mechanical turk" --only-urls`

![Screenshot of only-urls option](./images/onlyUrls.png?raw=true "onlyUrls")

### Command Line Arguments
- [x] *query* - the query that should be sent to the Google search
- [x] *output* - name of the JSON file to save results to
- [x] *no-display* - prevent results from appearing in the terminal output. Should only be used with --output (-o) command when saving results to a file
- [ ] *save* - name of the html file if you want to save the actual response from the html request (useful for debugging purposes)
- [x] *limit* - number of search results to be returned
- [x] *only-urls* - only display the URLs, instead of the titles and snippets
- [ ] *verbose* - console.log useful statements to show what's currently taking place
- [ ] *interactive* - once results are returned, show them in an interactive prompt where user can scroll through them
- [ ] *bold-matching-text* - only takes effect when interactive (-i) flag is set as well, will bold test in results that matched the query
- [x] *includeSites* - option to limit results to comma-separated list of sites
- [x] *excludeSites* - option to exclude results that appear in comma-separated list of sites
- [x] *open* - opens the first X number of results in the browser after finishing query
- [x] *disableConsole* - intended to be used with programmatic use, so that the color-coded search results are not displayed in the terminal (via console.log) when not wanted.

### Programmatic Use in NodeJS environment

- [x] something like:

```js
const  googleIt = require('google-it')

googleIt({'query': 'covfefe irony'}).then(results => {
  // access to results object here
}).catch(e => {
  // any possible errors that might have occurred (like no Internet connection)
})

// with request options
const options = {
  'proxy': 'http://localhost:8118'
};
googleIt({options, 'query': 'covfefe irony'}).then(results => {
  // access to results object here
}).catch(e => {
  // any possible errors that might have occurred (like no Internet connection)
})
```

---
_Source: https://npm.io/package/google-it · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
