Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stockisteven
Contributor
Contributor

API Connection to Google Places?

I looked through about 12 different threads and perhaps I am not understanding it.

I built a sample file below for 2 addresses.

My goal is to retrieve back the business name of each address below by using googles API.

When I run this I get an error saying 

"This statement only works with lib:// paths in this script mode"

Note: I can't use legacy mode so is there a solution per below ? Thanks

LIB CONNECT TO 'Google Business API';



tmp1:

LOAD* INLINE

[Address, City, State, Zip,Lat,Long

111 Huntington Ave , Boston, MA, 02199,-71.081452,42.346097

13 Cayuga Rd, Tewksbury, MA, 01876,-72.081452,41.346097];


tmp:

NoConcatenate

LOAD*,

Lat&','&Long as GPS

Resident tmp1;

Drop table tmp1;




for vRow = 0 to NoOfRows('tmp') -1


let vAddress = peek('GPS', vRow , 'tmp');



//Latest API call update 02/03/2016

Addresses:

LOAD

    //vAddress here is the Lon/Lat cordinates up top.

'$(vAddress)' as Address,

        "place_id",

"rating",

"reference",

"scope",

"vicinity"


   From [https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$(vAddress)&radius=1&key=(dele...)

   (JSON);



next


DROP Table tmp;


2 Replies
stockisteven
Contributor
Contributor
Author

bump - thanks

Anonymous
Not applicable

Hi Steven, To avoid the error shown in the screenshot .. You have to use legacy mode any how.

If you don't want to use legacy mode then using rest connector but it will work for single request,  not overriding multiple parameters.