# google-search-parser

> Google Search ads and results parser

Latest version **1.0.0** (published 2013-12-01) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install google-search-parser
pnpm add google-search-parser
yarn add google-search-parser
bun add google-search-parser
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2013-12-01 |
| First published | 2013-12-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | odysseas |

## Links

- npm: https://www.npmjs.com/package/google-search-parser
- Repository: https://github.com/ogt/google-search-parser
- npm.io page: https://npm.io/package/google-search-parser

## Dependencies (2)

- [needle](https://npm.io/package/needle.md) 0.6.3
- [cheerio](https://npm.io/package/cheerio.md) 0.12.4

## Recent versions

- 1.0.0 (latest) — 2013-12-01

## README

google-search-parser
====================
[![Build Status](https://travis-ci.org/ogt/google-search-parser.png)](https://travis-ci.org/ogt/google-search-parser)

Parses  ads, results from the HTML of  google search page results into json.

### Usage:

```javascript
  var parser = require('google-search-parser')
  parser.parseUrl("https://www.google.com/search?output=search&sclient=psy-ab&q=racoon&gbv=1");
  parser.parseFile('./test/data/example.html');
  parser.parseFile('./test/data/moto-g.html');
  parser.parseWords('moto x', function(result) {
    console.log(result);
  });
```

### Result format:

--
This module takes as input the HTML from a google search results and return a json structure of the following form
```
query_string : "",
ads : [
    {
        Domain : '', // e.g. ebay.com or amazon.com  (the domain portion of the display url)
        Title : '',
        Line1 : '',
        Line2 : '',  // If just one line - split by ' - ' to produce line 1 and line 2
        DisplayURL : '',
        URL : '',
        IsTop3 : true,
        IsBottom : false,
        Extensions : {  // http://cl.ly/0h0f2Y1h0d0g
            Review : {
                Quote : '',
                Author : '',
                Url : '',
            },
            Social : {
                Count : 100
            }
            Ratings : {
                Count : 999,
                Rating : 8.3
            },
            SiteLinks : [
                {
                    Title : '',
                    Url : ''
                }
                ...
            ],
            HasCallExtension : True/False
            HasLocation : True/False
            HasMobileApp : True/False
            HasDeal : True/False
            HasSocial : True/False
            HasSiteLinks : True/False
            HasRatings : True/False
            HasReviews :True/False
         }

    },
    ...
]
results : [
    {
        Domain :
        Title
        URL
        Text
        Extensions : {
           PublishedBy : { // http://cl.ly/1D3J0F262o2E
               Photo :
               Who :
               Date :
               Followers :
           }
           Sitelinks : [   // http://cl.ly/3l0H1U390R0b
               {
                   Title
                   URL
                   Text
               }
               ..

           ]
        }

    }
    ...
]
```

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