# place-search-sdk

> Search for near by place, get geolocation, place images and place details

Latest version **1.4.0** (published 2019-02-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install place-search-sdk
pnpm add place-search-sdk
yarn add place-search-sdk
bun add place-search-sdk
```

## 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.4.0 |
| Published | 2019-02-08 |
| First published | 2017-05-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Abhishek Singh |
| Maintainers | abhi11210646 |
| Keywords | got, place, search, api, querystring |

## Links

- npm: https://www.npmjs.com/package/place-search-sdk
- Repository: https://github.com/abhi11210646/place-search-sdk
- Homepage: https://github.com/abhi11210646/place-search-sdk#readme
- Issues: https://github.com/abhi11210646/place-search-sdk/issues
- npm.io page: https://npm.io/package/place-search-sdk

## Dependencies (2)

- [got](https://npm.io/package/got.md) 6.7.1
- [querystring](https://npm.io/package/querystring.md) 0.2.0

## Recent versions

- 1.4.0 (latest) — 2019-02-08
- 1.3.1 — 2018-12-16
- 1.3.0 — 2018-12-16
- 1.2.2 — 2018-03-25
- 1.2.1 — 2018-03-25
- 1.2.0 — 2018-03-25
- 1.0.5 — 2017-05-19
- 1.0.4 — 2017-05-19
- 1.0.3 — 2017-05-19
- 1.0.2 — 2017-05-19
- 1.0.1 — 2017-05-14
- 1.0.0 — 2017-05-14

## README

# Place Search
> Search for near by place, get geolocation, place images and place details!


## Installation

```
$ npm i place-search-sdk

```


## Usage

**Note**: You'll need to Enable place API key in google developer [console](https://console.developers.google.com). Follow these steps of 
[officially document](https://developers.google.com/places/web-service/get-api-key).
***Node Version: > 6.x.x***

```js
const googlePlace = require('place-search-sdk');

const client = new googlePlace('API-KEY')
```
### Geolocation 
```js
client.getGeoLocation('jalandhar')
	.then(latlong => {
		/*
        	{
        	    lat: 30.05758,
        	    lng: 31.94734
        	}
		 */
	});
  ```
### Near By Search
```js
client.nearBySearch({geoCode: {lat:30.097575, lng: 31.3784737} , searchType: 'restaurant'})
.then(result=>{
    /*[{
         return all places with details title, place id, photo reference, geomatric location, rating etc etc.
        	name:
            icon:
            rating:
            photo_reference: 
            address: 
            placeId: 
        }]
	*/
});
```
### Place Image
photo_reference is a id returned by nearby search.
```js
'maxwidth','maxheight' have default value to 400px, 400px respectively.
client.getPlaceImage('photo_reference', 'maxwidth','maxheight')
	.then(result=>{
    /*[{
        	   will return image of place.
        }]
	*/
});
```
### Place Details
placeId is a id returned by nearby search.
```js
client.getPlaceDetails('placeid')
	.then(result=>{
    /*[{
        	will return all details of a place. like
        	address: 
            phoneNumber: 
            phoneNumberInternational: 
            rating: 
            website: 
            utc_offset:
            photos: 
            reviews: 
            opening_hours:
        }]
	*/
});

```

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