Socket
Socket
Sign inDemoInstall

place-search-sdk

Package Overview
Dependencies
15
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    place-search-sdk

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


Version published
Weekly downloads
15
increased by1400%
Maintainers
1
Install size
3.88 MB
Created
Weekly downloads
 

Readme

Source

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. Follow these steps of officially document. Node Version: > 6.x.x

const googlePlace = require('place-search-sdk');

const client = new googlePlace('API-KEY')

Geolocation

client.getGeoLocation('jalandhar')
	.then(latlong => {
		/*
        	{
        	    lat: 30.05758,
        	    lng: 31.94734
        	}
		 */
	});
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.

'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.

client.getPlaceDetails('placeid')
	.then(result=>{
    /*[{
        	will return all details of a place. like
        	address: 
            phoneNumber: 
            phoneNumberInternational: 
            rating: 
            website: 
            utc_offset:
            photos: 
            reviews: 
            opening_hours:
        }]
	*/
});

Keywords

FAQs

Last updated on 08 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc