npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xapp/stentor-service-google-places

v1.87.3

Published

Service to integrate with Google Places API

Readme

@xapp/stentor-service-google-places

Service for integrating with Google Places API, built on Stentor's FetchService.

Installation

npm install @xapp/stentor-service-google-places

Usage

Basic Setup with API Key

import { GooglePlacesService } from "@xapp/stentor-service-google-places";

const service = new GooglePlacesService({
    apiKey: "your-google-places-api-key"
});

Setup with Authentication Function

import { GooglePlacesService } from "@xapp/stentor-service-google-places";

const service = new GooglePlacesService({
    authenticate: async () => {
        // Your authentication logic here
        return { apiKey: await getApiKeyFromSomewhere() };
    }
});

Get Place Details

// Get basic place details
const placeDetails = await service.getPlaceDetails("ChIJN1t_tDeuEmsRUsoyG83frY4");

// Get specific fields only
const placeDetails = await service.getPlaceDetails(
    "ChIJN1t_tDeuEmsRUsoyG83frY4",
    ["name", "formatted_address", "geometry", "photos"]
);

API Reference

GooglePlacesService

Constructor Options

  • apiKey?: string - Google Places API key
  • authenticate?: () => Promise<{ apiKey: string }> - Function that returns API key
  • urlBase?: string - Custom API base URL (defaults to Google Places API)

Methods

getPlaceDetails(placeId: string, fields?: string[]): Promise<GooglePlaceDetails>

Retrieves detailed information about a place.

Parameters:

  • placeId - The unique identifier for a place
  • fields - Optional array of fields to return (reduces API cost)

Returns: Promise resolving to place details

Available Fields:

  • Basic: place_id, name, formatted_address, geometry
  • Contact: formatted_phone_number, international_phone_number, website
  • Atmosphere: photos, rating, user_ratings_total, reviews, price_level
  • Details: opening_hours, business_status, types, vicinity

Error Handling

The service throws descriptive errors for:

  • Missing API key or authentication function
  • HTTP errors (4xx/5xx status codes)
  • Google Places API errors (INVALID_REQUEST, OVER_QUERY_LIMIT, etc.)

Types

All TypeScript interfaces are exported for use in your application:

import { 
    GooglePlaceDetails, 
    GooglePlaceDetailsResponse,
    GooglePlacesGeometry,
    GooglePlacesPhoto,
    GooglePlacesReview
} from "@xapp/stentor-service-google-places";