Skip to content

Instantly share code, notes, and snippets.

View kandiyorov's full-sized avatar
🏠
Working from home

PMK kandiyorov

🏠
Working from home
View GitHub Profile
@nathanjohnson320
nathanjohnson320 / gist:7283784
Last active February 2, 2021 10:35
Use the Google Places API with node.js
exports.randeats = function(req, res){
var key = req.query.key;
var location = encodeURIComponent(req.query.location);
var radius = 16000;
var sensor = false;
var types = "restaurant";
var keyword = "fast";
var https = require('https');
var url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?" + "key=" + key + "&location=" + location + "&radius=" + radius + "&sensor=" + sensor + "&types=" + types + "&keyword=" + keyword;