goog-places-api
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

goog-places-api

Modern library for Google Places https://developers.google.com/places/?hl=ru

NPM version Build Status Dependency Status Coverage percentage experimental

Install

npm install goog-places-api --save

or

yarn add goog-places-api

Usage

import Api from "goog-places-api";

const api = Api("key1");

// Iterator for all places in area

for await (const loc of api.nearby("55.7494733,37.3523209", 50000, {
    keyword: "restaurant",
})) {

    // Get detail for current place

    const location = await api.details(loc.place_id);

    console.log(location.name);

    // Get first photo to buffer

    const buf = await api.photo(location.photos[0].photo_reference);

    // Write photo to file

    require("fs").writeFileSync(__dirname + "/1.jpg", buf);

    break;
}

Test

npm install
npm test

Readme

Keywords

none

Package Sidebar

Install

npm i goog-places-api

Weekly Downloads

0

Version

0.0.3

License

ISC

Last publish

Collaborators

  • arvitaly