Hello,
I am trying to use Google Maps to find places that meet a certain criteria, such as a certain type of restaurant. I was able to successful make a Custom Action using “nearbysearch”, which will return 20 place objects at a time.
I would like to add those 20 objects to an Adalo db. This is my challenge. It will only add the first search result as one record to the db. The other 19 are not added.
How do you define an action that will add all 20 results into a db?
This is an example of the search string I used:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=42.352376%2C-71.046554&radius=500&type=restaurant&key=*myKey*
Below is a portion of the result that I received from my Google Maps search.
Thank you in advance for any help you can provide.
{
"html_attributions" : [],
"next_page_token" : "AZose0kN-DIcoYVRC-OOXHwny2hKzzPscDgGlS9qc8snULJqp4r_IDNzo9iLJvlltrUrSG4MpEpfxyD316R5UroV6TlXmkcK6UbID-6HyMoEt3qRVCd0G6lrJB-XeRoJIIuASVTe8u5q_jibgZ_6e_xcPs0361CpNkMsXNzBvsZa69XRCd0eM0W0R7CdE4MPLyzzgnS_k3JBVmc-hgYstLF4y3reTs-8pPHOQ3bXuftfdpx40FgXfBjCerC0XK5DicQYNZ-D0BWuAe3WdRZWSHxdFh9JivRl-dT0X438Lpvs3JV0C6rLJum6RE66yuvPZ_2r5rlr6Hk6WJQJ4OthqLjI9R6EP99GtlxiQulg33oArwKFoBhmtwYMhUNHb6oabObSxgeuA3p-tkk3B7Ns_WRnwOgZpudfhHVwEIqZAbnOf8uLzmC25GZF1vu40pwB",
"results" : [
{
"business_status" : "OPERATIONAL",
"geometry" : {
"location" : {
"lat" : 42.35123,
"lng" : -71.0487471
},
"viewport" : {
"northeast" : {
"lat" : 42.3525322802915,
"lng" : -71.04736741970849
},
"southwest" : {
"lat" : 42.3498343197085,
"lng" : -71.0500653802915
}
}
},
"icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/restaurant-71.png",
"icon_background_color" : "#FF9E67",
"icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/restaurant_pinlet",
"name" : "Flour Bakery + Cafe",
"opening_hours" : {
"open_now" : true
},
"photos" : [
{
"height" : 2160,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/100281328131250007584\"\u003eJoe Pato\u003c/a\u003e"
],
"photo_reference" : "AZose0kdMR5xkviT__s9SGHxURYHUiOMt7_2fGcdeDou4uJ98KzVUjifeZAU12lhG3VdzjtuqgUSLrptY7rOYaydCpRhtrzmlqUYMSzuPcYg6sC_7odEX0T5VIPbjtUU8qU205vnQ1IrmDml4cLCUCanGfqyFh8jyRlm6XL2BKWUCOR2ERqs",
"width" : 3840
}
],
"place_id" : "ChIJFXmZ8X9w44kR_4B7jZwILFQ",
"plus_code" : {
"compound_code" : "9X22+FG Boston, MA, USA",
"global_code" : "87JC9X22+FG"
},
"price_level" : 2,
"rating" : 4.6,
"reference" : "ChIJFXmZ8X9w44kR_4B7jZwILFQ",
"scope" : "GOOGLE",
"types" : [
"bakery",
"restaurant",
"food",
"point_of_interest",
"store",
"establishment"
],
"user_ratings_total" : 1565,
"vicinity" : "12 Farnsworth Street, Boston"
},
{
"business_status" : "OPERATIONAL",
"geometry" : {
"location" : {
"lat" : 42.3504581,
"lng" : -71.04822969999999
},
"viewport" : {
"northeast" : {
"lat" : 42.3517800802915,
"lng" : -71.0470300697085
},
"southwest" : {
"lat" : 42.3490821197085,
"lng" : -71.0497280302915
}
}
},
"icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/restaurant-71.png",
"icon_background_color" : "#FF9E67",
"icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/restaurant_pinlet",
"name" : "Menton",
"opening_hours" : {
"open_now" : false
},
"photos" : [
{
"height" : 1867,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/105296461670705606973\"\u003eMenton\u003c/a\u003e"
],
"photo_reference" : "AZose0n0uQvFuuAqe5ef97a1w_b-ZEmF2I_6v2MJbCayXPnnyJQkeyCLjZO_uelLdTOCRs16a-xQtnbHuacS-34PZh7uAhxie44Er2ZY9VyCyelcaxC2zNdKtrkF3MqVRH4Kb5BI6ayUUdDS70OIS7BMnPJfdPShDwdhSdR99bFbMHQ1hcl9",
"width" : 2800
}
],
"place_id" : "ChIJzxItH4B644kR5yivbnoZZgE",
"plus_code" : {
"compound_code" : "9X22+5P Boston, MA, USA",
"global_code" : "87JC9X22+5P"
},
"price_level" : 4,
"rating" : 4.5,
"reference" : "ChIJzxItH4B644kR5yivbnoZZgE",
"scope" : "GOOGLE",
"types" : [ "bar", "restaurant", "food", "point_of_interest", "establishment" ],
"user_ratings_total" : 485,
"vicinity" : "354 Congress Street, Boston"
},```