REST API integration Google Map Current Location

I would like to get the REST API of the list of places near my “current location”.

So I would like to know how should I solve this issue? How should I write the API link? Is it possible to include Page Variable in this?

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=

Hi, try to do like this. You do not need authorization header, you need “key” query parameter for authorization:

Hi @Yury_Gunko ,

is it possible to use Page.Variable for Query Parameter?

Thanks in advance.

Hi, of course, yes.


Then, add new data variable at the page where you define your page variable and bind “location” query parameter to it.

Hi @Yury_Gunko ,

Thanks. Will test out and see.

Hi @Yury_Gunko,

I am just wondering do you know what will be the issue for this? As I failed to do testing.

Error: TypeError: Failed to fetch. Does the server allow CORS?status: undefined
Resource settings for Get collection (GET)
-------------------
Resource URL: https://maps.googleapis.com/maps/api/place/nearbysearch/json
Relative path:

Hi @Yury_Gunko ,

Ok, I am able to bypass CORS.
But, would love to know how to get the array? As you can see I failed to do so.

Error: Error: 
The result was not an array. Maybe the data you're looking for is inside one of the response object keys?

{
  "html_attributions": [],
  "results": [],
  "status": "INVALID_REQUEST"
}
status: -1


Resource settings for Get collection (GET)
-------------------
Resource URL: https://maps.googleapis.com/maps/api/place/nearbysearch/json?
Relative path:

This how it will looks like (https://maps.googleapis.com/maps/api/place/nearbysearch/json?)

{
   "html_attributions" : [],
   "next_page_token" : "Aap_uEDNv1VT9MxTwtIzws4uOfbAibMLy1VyKTIMjoDFz7RZ6gonuJGqA2904BvW-y0qXKWSKPLgEReWMHygCzwKMTX-5ZE3uoci__GupUTNJt2QPj3uosDIB20H5LMWY9z-VOaXhzqw8Ygr09cQanaiCdC75ppwRP2O28CyIWLtgnEesSXg9YYDQMJ53WXHabp5y9a4gf3yfBiFmIREuVjAOFRklaiV9mEuhoywAXrHqTn2iBvjCq3BSxeqotvq06KvA76mS5bTe6xRN9eTnmtFbR_FTbB2C969BOkdDpnftGDIQ3HRf4EqTUHG5NHjUIJ_f1R-wuSMG3c0jX3ecRqQsrLONRnRacfs5TNupoRQbLNWk4bbwHjl5aLq4-h169U5tCh_gHp7uj8mTFjOfx_Ef62MQbECja9AyGELA0A6yye8x1ZX2pX1ntMiDFyw",
   "results" : [
      {
         "business_status" : "OPERATIONAL",
         "geometry" : {
            "location" : {
               "lat" : -33.8703417,
               "lng" : 151.1979222
            },
            "viewport" : {
               "northeast" : {
                  "lat" : -33.86900816970849,
                  "lng" : 151.1991662802915
               },
               "southwest" : {
                  "lat" : -33.87170613029149,
                  "lng" : 151.1964683197085
               }
            }
         }

Hi, try to do “Get record” query, not “Get collection”. If you query collection of records the result should be an array of records.

1 Like

Hi @Yury_Gunko ,

Thanks, it works. But, No Results were received. I have entered the right keys (parameter) and value. Wonder where went wrong.

Hi, how did you bypass cors? Thanks!