I am trying to determine how the daily Google Maps REST API request limit applies in the case of JavaScript run from the client machine requesting information via AJAX.
For example, if I make a Geocode request in a php script to one of the REST APIs with
$response = simplexml_load_file($rest_request_url);
I’d expect Google to know the servers IP and subtract 1 from the total allowed for that day. However, if I were do the same from JavaScript with an AJAX GET request, how would Google know it was the server that hosted that JavaScript if it was run from the client machine and log the server IP rather than the clients IP?
This may fall more generally under the bracket of how JavaScript executes generally, however the above illustrates the point well.
Google elucidates this situation in their Geocoding documentation here: https://developers.google.com/maps/articles/geocodestrat#client. This isn’t Maps, but the info there is analogous. Of note:
Emphasis mine. Google doesn’t care about the server is hosting the HTML file in which the map happens to be embedded. As far Google is concerned, no requests are coming from your server at all. The requests originate solely from the client visiting your web site.
As a practical matter, the request limits are there to prevent people from carpet-bombing the Maps API with the intent to mine and/or cache the data, and to force really heavy users to pay for a subscription.