google geocoding limit - ruby-on-rails

there is a limit of 2400 geocoding request for google service. even if each request is cached and not duplicated its possible to exceed this limit if the request is being made from a rails app.
short of purchasing the premium package(which i dont know the cost of), what else can one do?
thanks

I believe that if you geocode on the client side that you won't have any issues with geocoding limits. Calls to google.maps.Geocoder() and the google.loader.ClientLocation() both count against the IP of the client machine rather than your server IP. If you need to some on the server side I would second Geoff's suggestion to use Geokit's multigeocoder.

I do all of my geocoding from the application servers using geokit. That allows me a backup of yahoo maps using their multigeocoder. That way - if one fails, the other succeeds. Geokit also provides an identical interface to the two services, so you only need to code to the one abstraction layer. The google limit is per server per day, so if you have multiple app servers you can spread out the load to increase your limit. Yahoo's limits are 5000/server/day.
Hope this helps, good luck!

This is what I did:
1. Try to use the Navigator's Location functionality.
2. If that fails, use Google Gears (I dont think it consumes google limit)
3. If that fails use Google Maps API
4. If that fails (limit exceeded), geolocate based on user IP and maxmind database (free)
The source here may be of some help: gvkalra.appspot.com/reachme

You can use google fusion tables to geocode your data. Limits are pretty high there.

Related

Google Places Api Daily Limit Issue

Hi I have made an app and enable Google Places api for that project.
I create a project on google developer portal and add the key in to my iOS app After that I start to send request to google Api and My search Works very well as I also know that google has per day request limit on each Api
Now today I send Max. 30 request and after that from google Api I was given error that your daily quota is reached which is 1k request / day.
I did not find any solution on any where Kindly help me to solve this problem.
You need to request more quota:
https://developers.google.com/places/uplift
If you reached the quota while testing your app, make sure that you have used the developer key for that purpose.
What kind of Search are you using?
Some types of searches cost more than others.
For example, one of the autocomplete search types, Text Search, has a 10x multiplier. (https://developers.google.com/places/web-service/usage)
Make sure that you look at the usage limits specified for each API/service you are using.
Additionally, if you are looking at your online dashboard you can see the real-time number of requests that have been made / are being made to each API/service by project. This can help debug when these requests may be being made and how many are occurring per call you believe to be making.

Working with Geolocation and Google Maps API [HELP]

I'm new to the mobile development world and right now I'm building an app that uses jQuery mobile and PhoneGap. Here's my logic:
I have a table that contains the users and their addresses. I grab the user address and pass it trough the maps API to catch the location. But I'm doing this for every single record and sometimes the API breaks because the number of simultaneous requests.
How can I know what users are closest to me without running it through the maps API?
Thanks a lot!
Rafael, Google limits the number of requests you can do because it's against their TOS to do batch geocoding without paying for a (rather pricey) business license. You'll need to find a service that allows you to geocode addresses en masse.
I would recommend one like LiveAddress API which will not only geocode the addresses but also confirm the validity and fill out missing or incorrect information. Each request to the API may include up to 100 addresses. There's a non-API version if you just want to verify an existing list of addresses in a spreadsheet or CSV file.
I do work at SmartyStreets and would be happy to help you with any other questions about your addresses.

Twitter - Constant search for term

I wonder if anyone can help me, I'm getting a little confused as to
which API to use. If anyone can offer some guidance I would really
appreciate it.
I'm trying to create an website where users can monitor Twitter for
certain hashtags. The site will continually search twitter for any new
updates and store any tweet related to that particular hashtag. This process will run for up to 60 days.
As far as I can gather, my two options are:
Using the Search API
The problem with this API is that if I have a 1000 users all
monitoring different hashtags, I am quickly going to reach my API
limit since I will be making a fair few requests, potentially once
every 2-3 minutes. Is there a way to use oauth in conjunction with the
search API so that the limits are user based and not application
based? That way, the limit will be user specific and I won't have to
worry.
Using the Stream API
I thought this might be a better solution, but it seems you are
limited to how many connections you can have open. The documentation
seems unclear as to how this works... is the connection limit per twitter account
or service ip? For example, if my site had 1000 users each of those users was
monitoring a hashtag, would those 1000 stream api connections be
against my servers ip or would they against the user?
You will want to use the Streaming API. You will open a single connection that will track the terms for all of the users. When users add new terms to track you will restart the stream with the new terms. The single stream will be for a bot Twitter account you create and not your users accounts.

How should I use Twitter API?

I want to develop a web application that uses the Twitter API. Before going any further there are some questions that require answer:
Should I store on my server the list of followers/following or should I query the API each time?
Same as 1 but for tweets instead of people.
If I store messages in my application, search should be performed on the local database or using the API?
Mostly sure unimportant details: ASP.NET (MVC?) and MSSQL will be used.
i would use the api, and if you find the app is pulling data slowly or you're running into limits, cache some of the results in the session (like the followers list could be cached and refreshed if it's more than 10 minutes old). you could also put the cache in mssql if you need even greater persistence.
System.Web.Caching.Cache is useful for that...
the twitter search api has a lot of options and can search through wider time ranges, so i would use that.
TweetSharp is an easy-to-use twitter api for .net that simplifies a lot of the operations:
http://tweetsharp.com/
Roughly, this can help you to make a decision:
Can your application run even if that API server is down or do you have any API call count limit?
If you answer "Yes" to any of this questions, cache that information.

Google geocoding API (City => long, lat)

Does Google offer a RESTful API where I can pass it a city name (or zip) and it returns the longitude & latitude.
I know how to do this with using the Google Maps API, but I really don't want to have my users download the huge 200k Google Maps API solely so that I can geocode a location.
Does anyone know of a URL based (REST) city/zip to longitude & latitude API?
Since geocoding this information then kicks off multiple other processes, doing this first step is of critical importance to have it perform quickly b/c its a bottleneck right now using the Google Maps API b/c of the huge download and JavaScript loadup.
Yahoo PlaceFinder is a new service offered by Yahoo! that provides services for converting addresses (including city names) into latitude / longitude pairs. The service is also capable of doing the opposite (converting coordinates into an address).
Unlike Google's Geocoding API the TOS for Yahoo PlaceFinder do not forbid using the data outside of their maps API.
You could use geonames.org web sevices (or download the server)
http://www.geonames.org/export/reverse-geocoding.html
Also keep in mind that you will likely run over your quotas for the day if you have heavy traffic using the direct HTTP call method. Google limits usage based on IP address, so using the client side code will greatly increase the number of geocode lookups you can do per day since they'll be associated with user's computers rather than your server(s).
$.get("http://ipinfo.io", function(response) {
console.log(response.city, response.country);
}, "jsonp");
Here's a more detailed JSFiddle example that also prints out the full response information, so you can see all of the available details: http://jsfiddle.net/zK5FN/2/

Resources