Google Maps/Place Geocoding - javascript

Currently I am using Google Maps for both Autocomplete as well as Geocoding function.
However, I realized that Google Maps geocoding is rather inaccurate for most cases and also chanced upon a few links suggesting to use Google Places API.
As the Google Maps method which I have implemented is based on Javascript approach and it does not require any API key. Therefore, it does not have much restriction since it is based on client side limit.
However for Google Places, it seems that it requires an API key and have a different set of usage limit.
Before I convert and explore on Google Places API:
May I know is there any better free alternative for geocoding solution which is good/accurate?
Is it possible to configure Google Places geocoding in a way similar to Google Maps so that the usage limitation is held at client level?
Or is there a strategy that I can try/consider. Example, create a few Google Places account/API key, and develop some logic e.g. (if apikey1 exceed limits, switch to api2 etc..)? Before that, is it able to track or detect the current limit via portal or coding level respectively?

May I know is there any better free alternative for geocoding solution which is good/accurate?
I think Google Maps offers the most accurate among free geocoding services. Reading from this SO thread, if you're really concerened about precision, then consider using paid services.
Is it possible to configure Google Places geocoding in a way similar to Google Maps so that the usage limitation is held at client level?
Here's a statement from Google about Usage Limits
The Google Places API Web Service enforces a default limit of 1 000
requests per 24 hour period, which you can increase free of charge. If
your app exceeds the limit, the app will start failing. Verify your
identity to get up to 150 000 requests per 24 hour period, by enabling
billing on the Google API Console. A credit card is required for
verification. We ask for your credit card purely to validate your
identity. Your card will not be charged for use of the Google Places
API Web Service.
The limit for free usage is 150 000 requests per 24 hour period. If
your app exceeds the limit, the app will start failing again. Purchase
a Google Maps APIs Premium Plan license to get more than 150 000
requests per 24 hour period.
Please take steps to increase your limit early if you expect to exceed
the default number of requests allowed.
Is there a strategy that I can try/consider. Example, create a few Google Places account/API key, and develop some logic e.g. (if apikey1 exceed limits, switch to api2 etc..)?
It seems there is no such feature. If you want to exceed the free quota, consider
payment.

You're right, there are many restrictions on the Google APIs. In fact, in the terms of use, the Google Maps API requires that you use the geocode information with a map presentation—you can't just print the numbers.
And yes, the Google Maps API guesses an approximate location based on the address input. For instance, if you give it a complete address that is not a real place, it will try to give you somewhere in between the real places that would probably be next to it. This is one of the reasons you will often get inaccurate geocode information from them. Overall, the API is great for what it is designed to do.
As someone who works in this industry, I'm not actually aware of any completely free geocoding and autocompleting service. Most products have a free tier though (up to so many uses per week or per month, etc).
(Full disclosure: I'm a developer at SmartyStreets where I work on the US Autocomplete API as well as the US Street Address API, which provides geocoding.)

Related

Google Maps Geocoding No Longer Free?

It's been a while since I've played around with geocoding, but going through their documentation it seems to me that Google now charges $0.005 for each geocoding call. Do they no longer allow the 2,500 free requests/day? I'm in Canada if that makes a difference (the documentation listed the prices for Canada, Brazil, and India... not sure if its different in the states)... or am I missing something? I have a list of about 4,500 addresses that I need to geocode to put on a map. I'm also using PHP to make the calls to the javascript API.
Google Maps APIs are no longer available without API keys. Additionally, you must supply credit card information before you can access their API at all. Judging by your usage, you may be able to fall within their new free $200 credit per month.
You can visit the Google Maps API pricing to view pricing information and see if it will still work for you. If not, or you would just like to switch, another option may be OpenStreetMap.

Aren't Javascript analytics scripts susceptible to easy data hacks?

On Production environments, Javascript based analytics scripts (Google Analytics, Facebook Pixel etc.), are injected into most web applications, along with the Unique ID/Pixel ID, in plain Javascript.
For example, airbnb uses Google Analytics. I can open up my dev console and run
setInterval(function() {ga('send', 'pageview');}, 1000);
which will cause the analytics pixel to be requested every 1 second, forever. That is 3600 requests an hour from my machine alone.
Now, this can easily be done in a distributed fashion, causing millions of requests per second, completely skewing the Google Analytics data for the pageview event. I understand that the huge amounts of data collected would correct this skewing to a certain extend, but that can be easily compensated by hiking up the amount of requests.
My question is this: are there any safeguards to prevent competitors or malicious individuals from destroying the data integrity of applications in this manner? Does GA or Facebook provide such options?
Yes,but the unsafe part don't comes for the Javascript. For example, you can use the measurement protocol to flood data to one account. Here you can see a lot of people in the same comunity having thoubles with this (and it's quiet simple to solve.)
https://stackoverflow.com/search?q=spam+google+analytics
All this measurement systems uses HTTP calls to fill the data on your "database". If you are able to build the correct call you can Spam Everyone and everywhere (but don't do it, don't be evil).
https://developers.google.com/analytics/devguides/collection/protocol/v1/?hl=es-419
This page of Google Analytics explain what is the protocol measurement, Javascript only work as framework to build and send the hit.
https://developers.google.com/analytics/devguides/collection/protocol/v1/?hl=es-419
But, so not everything is lost.
For example, if you try to do that on you browser with that code, The Google Analytics FrameWork limit to 1 call per second and 150 per session (or cookie value). Yes it's not complicated to jump that barrier, but after that other barriers will come.
So if you use the Javascript framework are safe. Now imagine you do the same with python, sending http to the Google Analytics server. It's possible but:
So here are 2 important things to says.
Google Analytics has a proactive "firewall", to detect Spammers and ban them.(How and when they do this is not public), but in my case i see a lot of less spammer that few years ago.
Also there is a couple of good practices to avoid this. For example, store only domains under a white list, creating a filter to allow only traffic from your domain
https://support.google.com/analytics/answer/1033162?hl=en
Also it's a very good practice to protect you ecommerce, using a filter to include only data from certain store or with certain parameter, "for example brand == my brand" or "CustomDimension== true". Exclude transactions with products over $1.000 (check your limits and apply proactive filters). All this barrier make complex to broke.
If you do this, you will protect your domain a lot(because it's too much complicated to know the combination of UA + Domain Valid when you create a robot), but you know, all the system can be broken. In my experience i only see 2 or 3 cases of damage comming from spammer or people who wanna hurt, and in all this case could be prevented if I created a proactive filter. Usually spammer only spam ads into your account,almost never want to hurt you. Facebook, Piwik and other Tools happens more or less the same.

Decrease amount of Google Places autocomplete requests

Since June 22, 2016, the Google Maps Javascript API requires a key (again). This means they're tracking your usage. When you use the Google Places API in an AutoComplete textbox, a request is made for every character you type meaning that if you search in such a textbox for a city that contains 10 characters, you consumed 10 requests for that day.
I want to lower the amount of requests by setting a time-out before updating the autocomplete popup (like: "wait 750ms before triggering the request"), but I can't find a way to do it.
Is there a way to lower the amount of requests used by the Google Places Javascript API Autocomplete component?
Edit: I am aware of this article but that handles the Android API, I'm using the JavaScript API.
You can build your own widget using the AutocompleteService class, and set your own thresholds.
But honestly, I would hate an app that takes such a long time to react to my keystrokes. I would initially blame the phone for not reacting to my touches, but likely realize, eventually, that it is just this one app that is slow to react to my keystrokes, and find a replacement app. Consider that.

Why does not the JQuery Locationpicker needs an API key [duplicate]

This question already has answers here:
What's the API Key for in Google Maps API V3?
(5 answers)
Closed 7 years ago.
I frequently use this JQuery Locationpicker plugin, and I am wondering about why it seems like it doesn't need a Google API key to work, as it looks like it's using the Google Maps Javascript API.
This API establishes some usage limits, and this is one of the things that it's bugging me.
Could it be that it's using by default the plugin's developer API KEY? Is there another Google Javascript API that doesn't need an API KEY?
EDIT:
I'm still a little confused about this issue, but I have finally found another question that mostly covers it. Thank you all.
When you load the Google Maps API it knows your IP address. It rate limits you under the standard plan based on your IP.
The key is not currently required for the javascript API, it is recommended, as it allows you to track your usage on the API console, and allows google to contact you if you exceed the free API limits.
The API limits from the documentation:
The JavaScript API has the following limits in place:
Standard Usage Limits
Users of the standard API:
Free until exceeding 25,000 map loads per 24 hours for 90 consecutive days
Enable pay-as-you-go billing to unlock higher quotas:
After exceeding the free usage limits, billing at $0.50 USD / 1000 additional requests, up to 1,000,000 per 24 hours.

Bing Image Search API

Does anyone know if Bing limits the number of requests an application can have for the Image Search API? I looked through the terms and couldn't find anything but the wording that they 'reserve' the right to do so. My application would pull several images for each user - so there could potentially be a lot of requests. Any feedback?
Zach
It's not clear whether this is actually enforced but the guidelines say
"[You must] Restrict your usage to
less than 7 queries per second (QPS)
per IP address. You may be permitted
to exceed this limit under some
conditions, but this must be approved
through discussion with
api_tou#microsoft.com."
http://msdn.microsoft.com/en-us/library/dd440746.aspx
I think, it is possible that this guide contains outdated information about restrictions. There are no info about queries number in the current version of terms (ver. March 2011). At the same time, there is a line about restricted advertisment on the page where the bing images or videos results are situated - this is essential.
Actually, Free Bing Search API is limited to 5000 Transactions/month & the Source type can be..
Web
Images
News
Videos
Related Search
Spelling Suggestions
More Info, https://datamarket.azure.com/dataset/5BA839F1-12CE-4CCE-BF57-A49D98D29A44

Categories