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.
Related
We're currently integrating Google Drive/Docs access in our mobile Apps and use the Google Document List API for this purpose. Are there any restrictions on the number of requests allowed for single API key?
I can't find any information in the Google API Console as the Document List API is not listed there. I can only activate the Google Drive API (which does not yet support functionalities we need).
The Documents List API does not use API keys in the same way as the newer APIs such as Drive. We (Google) do not give exact quota details for this API, but in general the value is extremely high. You may encounter 503 responses which indicate that you should perform exponential backoff. If, despite this, you are hitting an absolute ceiling, you should contact us and we will investigate, and look to increase your quota.
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.
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.
I want to parse google and yandex search results for my little website analyzer utility.
so i should send hundreds requests per minute. What is good practice for this issue?
Is google search api a good way?
The Google Search API may not be used for bots. Google will block your utility if you request too much searches.
http://code.google.com/apis/ajaxsearch/terms.html
You agree that when using the Service, You will not, and will not permit users or other third parties to:
Use any robot, spider, site search/retrieval application, or other device to retrieve or index any portion of Google Search Results or to collect information about users for any unauthorized purpose;
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/