2 Replies Latest reply: Jan 4, 2018 10:21 AM by Sandeep Roy RSS

    API Connection to Google Places?

    Steven Stocki

      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=(deleted)

         (JSON);



      next


      DROP Table tmp;