# Google Place API in Javascript

**URL:** <https://forums.fusetools.com/t/google-place-api-in-javascript/1492>\
**Category:** Feature Suggestions\
**Created:** [January 19, 2016, 6:17am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492 "2016-01-19T06:17:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 19, 2016, 6:17am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/1 "2016-01-19T06:17:24Z")

</div>

I want to use Google Place API for Autocomplete text and Place Detail. Please help me if there is some way to do so using Javascript or any other method (I don’t want to use Google API Web Services for the same as it has some limitations). If something like that is not possible now please let me know whether it is in your future preferences or not, as my project is on hold due to this problem.

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [January 19, 2016, 3:56pm UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/2 "2016-01-19T15:56:27Z")

</div>

It is not possible to use the JavaScript API that Google supplies as this is for the DOM. You should be able to implement the API in JavaScript or Uno, but not use any of the existing SDKs.

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [January 19, 2016, 8:31pm UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/3 "2016-01-19T20:31:13Z")

</div>

I’ve had a look at this, and to do this in pure JS is pretty straight forward.

---

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 20, 2016, 9:01am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/4 "2016-01-20T09:01:39Z")

</div>

Thank You for your reply. Can you guide me, how to do the same. Please provide a sample/example for the same.

---

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 21, 2016, 7:45am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/5 "2016-01-21T07:45:07Z")

</div>

Is it possible to use [https://github.com/Srirangan/googleplaces.js/tree/master](https://github.com/Srirangan/googleplaces.js/tree/master) in Fuse. Please can you give some clue, how can I implement the same in Fuse.

---

<div class="post-metadata">

**Author:** ![jonas1](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jonas1/32/350_2.png) [@jonas1](https://forums.fusetools.com/u/jonas1)\
**Post date:** [January 21, 2016, 8:45am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/6 "2016-01-21T08:45:56Z")

</div>

Hi!

Here is some js that might help you.

```auto
var url = "https://maps.googleapis.com/maps/api/place/autocomplete/json&quot;;
var type = "address";
var language = "sv";
var key = "GOOGLE API KEY";
var input = "" //Address input
var params = "url="+url+"&type="+type+"&language="+language+"&key="+key+"&input="+input;

var http = new XMLHttpRequest();
http.open("GET", url+"?"+params, true);
http.onreadystatechange = function() {
    if(http.readyState == 4 && http.status == 200) {
        debug_log(http.responseText);
        var myArr = JSON.parse(http.responseText);
    }
}
http.send(params);

```

---

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 21, 2016, 8:48am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/7 "2016-01-21T08:48:51Z")

</div>

Thanks jonas for reply, but the code is using web service, but it has some limitations. I want JavaScript for using the API.

---

<div class="post-metadata">

**Author:** ![jonas1](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jonas1/32/350_2.png) [@jonas1](https://forums.fusetools.com/u/jonas1)\
**Post date:** [January 21, 2016, 9:01am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/8 "2016-01-21T09:01:52Z")

</div>

Hmm… not sure what you are meaning. The code above is just javascript, and it’s calling the Google Places API.

---

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 21, 2016, 9:34am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/9 "2016-01-21T09:34:13Z")

</div>

The code above is using HttpRequest (Google Place API Web Service) which has usage limit of 10000 requests for 24 hours(10 request for 1 place search) , which would exceed our reqiurement, whereas Google Places API for Javascript Library has unlimited usage.

For Further reference you can refer [https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete,https://developers.google.com/maps/documentation/javascript/places-autocomplete](https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete,https://developers.google.com/maps/documentation/javascript/places-autocomplete) and [https://developers.google.com/places/web-service/usage](https://developers.google.com/places/web-service/usage)

---

<div class="post-metadata">

**Author:** ![jonas1](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jonas1/32/350_2.png) [@jonas1](https://forums.fusetools.com/u/jonas1)\
**Post date:** [January 21, 2016, 10:42am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/10 "2016-01-21T10:42:59Z")

</div>

Okej, I understand. Only have experince using the Web Service, so can’t help you.

---

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 21, 2016, 10:51am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/11 "2016-01-21T10:51:54Z")

</div>

Thank you for your response.

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [January 21, 2016, 11:09am UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/12 "2016-01-21T11:09:02Z")

</div>

anupriyashakaya: The googleplaces.js npm package, and the google browser javascript are using the same endpoint, and has the same limitations.

---

<div class="post-metadata">

**Author:** ![anupriyashakya20](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@anupriyashakya20](https://forums.fusetools.com/u/anupriyashakya20)\
**Post date:** [January 21, 2016, 1:19pm UTC](https://forums.fusetools.com/t/google-place-api-in-javascript/1492/13 "2016-01-21T13:19:09Z")

</div>

Thanks for the information. I was also going through the same and came to know that npm google-places is using Web Services only. Google Places JavaScript Library do not have any limitations (as mentioned in [https://developers.google.com/maps/documentation/javascript/places](https://developers.google.com/maps/documentation/javascript/places)). I came through another work [https://github.com/Carrooi/Js-GoogleMapsLoader](https://github.com/Carrooi/Js-GoogleMapsLoader) is this would be helpful.
