New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

googleplaces

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

googleplaces

Node.js library for the Google Places API

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
562
increased by61.49%
Maintainers
1
Weekly downloads
 
Created
Source

googleplaces.js

A node.js library for the Google Places API

ugh?

googleplaces.js makes it easy to talk to the Google Places API from your server side Node.js application

can i use in the browser?

Google already maintains a dedicated client side JavaScript library

what's supported in 0.3.0?

what's coming up next?

can i contribute?

Yes, fork, hack and send me a PR

get started

1. google

2. npm

$ npm install googleplaces

3. configure

# set environment variables
export GOOGLE_PLACES_API_KEY = "your key here"
export GOOGLE_PLACES_OUTPUT_FORMAT = "json"

examples

var GooglePlaces = require("googleplaces");
var googlePlaces = new GooglePlaces(process.env.GOOGLE_PLACES_API_KEY, process.env.GOOGLE_PLACES_OUTPUT_FORMAT);
var parameters;

/**
 * Place search - https://developers.google.com/places/documentation/#PlaceSearchRequests
 */
parameters = {
  location:[-33.8670522, 151.1957362],
  types:"doctor"
};
googlePlaces.placeSearch(parameters, function (error, response) {
  if (error) throw error;
  console.log(response.results);
});

places details

var GooglePlaces = require("googleplaces");
var googlePlaces = new GooglePlaces(process.env.GOOGLE_PLACES_API_KEY, process.env.GOOGLE_PLACES_OUTPUT_FORMAT);
var parameters;

/**
 * Place details requests - https://developers.google.com/places/documentation/#PlaceDetails
 */
parameters = {
  location:[-33.8670522, 151.1957362],
  types:"doctor"
};
googlePlaces.placeSearch(parameters, function (error, response) {
  if (error) throw error;
  googlePlaces.placeDetailsRequest({reference:response.results[0].reference}, function (error, response) {
    if (error) throw error;
    console.log(response.result);
  });
});
var GooglePlaces = require("googleplaces");
var googlePlaces = new GooglePlaces(process.env.GOOGLE_PLACES_API_KEY, process.env.GOOGLE_PLACES_OUTPUT_FORMAT);
var parameters;

/**
 * Text search - https://developers.google.com/places/documentation/#TextSearchRequests
 */
parameters = {
  query:"restaurants in dublin"
};
googlePlaces.textSearch(parameters, function (error, response) {
  if (error) throw error;
  console.log(response.results);
});

Keywords

FAQs

Package last updated on 06 Dec 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc